diff --git a/LICENSE b/LICENSE index 2db8824ea9aabb..2831dc3b5ee4f3 100644 --- a/LICENSE +++ b/LICENSE @@ -774,6 +774,17 @@ The externally maintained libraries used by Node.js are: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ +- SipHash, located at deps/v8/src/third_party/siphash, is licensed as follows: + """ + SipHash reference C implementation + + Copyright (c) 2016 Jean-Philippe Aumasson + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to the public + domain worldwide. This software is distributed without any warranty. + """ + - zlib, located at deps/zlib, is licensed as follows: """ zlib.h -- interface of the 'zlib' general purpose compression library diff --git a/common.gypi b/common.gypi index 8f997dca4d6dbd..caeac71b5ccf87 100644 --- a/common.gypi +++ b/common.gypi @@ -44,6 +44,9 @@ # Old time default, now explicitly stated. 'v8_use_snapshot': 'true', + # Turn on SipHash for hash seed generation, addresses HashWick + 'v8_use_siphash': 'true', + # These are more relevant for V8 internal development. # Refs: https://github.com/nodejs/node/issues/23122 # Refs: https://github.com/nodejs/node/issues/23167 diff --git a/configure.py b/configure.py index 83703964e54709..1f12998b64c63c 100755 --- a/configure.py +++ b/configure.py @@ -477,6 +477,11 @@ dest='without_snapshot', help=optparse.SUPPRESS_HELP) +parser.add_option('--without-siphash', + action='store_true', + dest='without_siphash', + help=optparse.SUPPRESS_HELP) + parser.add_option('--code-cache-path', action='store', dest='code_cache_path', @@ -1122,6 +1127,7 @@ def configure_v8(o): o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks. o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true' + o['variables']['v8_use_siphash'] = 'false' if options.without_siphash else 'true' o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0 o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform) o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) diff --git a/deps/v8/gypfiles/features.gypi b/deps/v8/gypfiles/features.gypi index 7e5af8883a8ffd..28ae99dac810b1 100644 --- a/deps/v8/gypfiles/features.gypi +++ b/deps/v8/gypfiles/features.gypi @@ -178,6 +178,9 @@ ['v8_use_snapshot=="true" and v8_use_external_startup_data==1', { 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',], }], + ['v8_use_siphash=="true"', { + 'defines': ['V8_USE_SIPHASH',], + }], ['dcheck_always_on!=0', { 'defines': ['DEBUG',], }], diff --git a/deps/v8/gypfiles/v8.gyp b/deps/v8/gypfiles/v8.gyp index 857ff0ecece3a8..7acd2ac9413dec 100644 --- a/deps/v8/gypfiles/v8.gyp +++ b/deps/v8/gypfiles/v8.gyp @@ -130,6 +130,7 @@ 'v8_enable_verify_predictable=<(v8_enable_verify_predictable)', 'v8_target_cpu=<(v8_target_arch)', 'v8_use_snapshot=<(v8_use_snapshot)', + 'v8_use_siphash=<(v8_use_siphash)', ] }, 'conditions': [ @@ -1528,6 +1529,8 @@ '../src/string-stream.h', '../src/strtod.cc', '../src/strtod.h', + '../src/third_party/siphash/halfsiphash.cc', + '../src/third_party/siphash/halfsiphash.h', '../src/third_party/utf8-decoder/utf8-decoder.h', '../src/torque-assembler.h', '../src/tracing/trace-event.cc', diff --git a/node.gyp b/node.gyp index 13fa0d01e17cdb..f5b09f5ffae941 100644 --- a/node.gyp +++ b/node.gyp @@ -1,6 +1,7 @@ { 'variables': { 'v8_use_snapshot%': 'false', + 'v8_use_siphash%': 'true', 'v8_trace_maps%': 0, 'node_use_dtrace%': 'false', 'node_use_etw%': 'false', diff --git a/tools/license-builder.sh b/tools/license-builder.sh index d0d3d766a6c02c..55f630285eaceb 100755 --- a/tools/license-builder.sh +++ b/tools/license-builder.sh @@ -64,6 +64,8 @@ addlicense "OpenSSL" "deps/openssl" \ addlicense "Punycode.js" "lib/punycode.js" \ "$(curl -sL https://raw.githubusercontent.com/bestiejs/punycode.js/master/LICENSE-MIT.txt)" addlicense "V8" "deps/v8" "$(cat ${rootdir}/deps/v8/LICENSE)" +addlicense "SipHash" "deps/v8/src/third_party/siphash" \ + "$(sed -e '/You should have received a copy of the CC0/,$d' -e 's/^\/\* *//' -e 's/^ \* *//' deps/v8/src/third_party/siphash/halfsiphash.cc)" addlicense "zlib" "deps/zlib" \ "$(sed -e '/The data format used by the zlib library/,$d' -e 's/^\/\* *//' -e 's/^ *//' ${rootdir}/deps/zlib/zlib.h)"