chore: bump node to v16.4.0 (main) (#29699)

This commit is contained in:
electron-roller[bot] 2021-06-28 18:05:38 +02:00 committed by GitHub
parent da2baabb96
commit e4807ac020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 191 additions and 596 deletions

2
DEPS
View file

@ -17,7 +17,7 @@ vars = {
'chromium_version': 'chromium_version':
'93.0.4552.0', '93.0.4552.0',
'node_version': 'node_version':
'v16.2.0', 'v16.4.0',
'nan_version': 'nan_version':
# The following commit hash of NAN is v2.14.2 with *only* changes to the # The following commit hash of NAN is v2.14.2 with *only* changes to the
# test suite. This should be updated to a specific tag when one becomes # test suite. This should be updated to a specific tag when one becomes

View file

@ -1,3 +1,4 @@
expose_ripemd160.patch expose_ripemd160.patch
expose_aes-cfb.patch expose_aes-cfb.patch
expose_des-ede3.patch expose_des-ede3.patch
fix_sync_evp_get_cipherbynid_and_evp_get_cipherbyname.patch

View file

@ -0,0 +1,82 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 28 Jun 2021 10:41:09 +0200
Subject: fix: sync EVP_get_cipherbynid and EVP_get_cipherbyname
This commit syncs the results of EVP_get_cipherbynid and
EVP_get_cipherbyname. Node.js logic assumes that calling EVP_get_cipherbynid
on a NID returned from a call to `getCipherInfo` with the cipher name
will return the same cipher information - this assumption holds in OpenSSL
and should also hold in BoringSSL.
This will be upstreamed.
diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c
index 8205e121c152fe4e2d8df34a1ac2fe0498381f31..0870ffe6bff3f647907d7df66d7bf74916be1836 100644
--- a/crypto/cipher_extra/cipher_extra.c
+++ b/crypto/cipher_extra/cipher_extra.c
@@ -69,20 +69,58 @@
const EVP_CIPHER *EVP_get_cipherbynid(int nid) {
switch (nid) {
- case NID_rc2_cbc:
- return EVP_rc2_cbc();
- case NID_rc2_40_cbc:
- return EVP_rc2_40_cbc();
+ case NID_rc4:
+ return EVP_rc4();
+ case NID_des_cbc:
+ return EVP_des_cbc();
+ case NID_des_ede3_ecb:
+ return EVP_des_ede3();
case NID_des_ede3_cbc:
return EVP_des_ede3_cbc();
- case NID_des_ede_cbc:
- return EVP_des_cbc();
case NID_aes_128_cbc:
return EVP_aes_128_cbc();
+ case NID_aes_128_cfb128:
+ return EVP_aes_128_cfb128();
case NID_aes_192_cbc:
return EVP_aes_192_cbc();
case NID_aes_256_cbc:
return EVP_aes_256_cbc();
+ case NID_aes_256_cfb128:
+ return EVP_aes_256_cfb128();
+ case NID_aes_128_ctr:
+ return EVP_aes_128_ctr();
+ case NID_aes_192_ctr:
+ return EVP_aes_192_ctr();
+ case NID_aes_256_ctr:
+ return EVP_aes_256_ctr();
+ case NID_aes_128_ecb:
+ return EVP_aes_128_ecb();
+ case NID_aes_192_ecb:
+ return EVP_aes_192_ecb();
+ case NID_aes_256_ecb:
+ return EVP_aes_256_ecb();
+ case NID_aes_128_gcm:
+ return EVP_aes_128_gcm();
+ case NID_aes_192_gcm:
+ return EVP_aes_192_gcm();
+ case NID_aes_256_gcm:
+ return EVP_aes_256_gcm();
+ case NID_aes_128_ofb128:
+ return EVP_aes_128_ofb();
+ case NID_aes_192_ofb128:
+ return EVP_aes_192_ofb();
+ case NID_aes_256_ofb128:
+ return EVP_aes_256_ofb();
+ case NID_des_ecb:
+ return EVP_des_ecb();
+ case NID_des_ede_ecb:
+ return EVP_des_ede();
+ case NID_des_ede_cbc:
+ return EVP_des_ede_cbc();
+ case NID_rc2_cbc:
+ return EVP_rc2_cbc();
+ case NID_rc2_40_cbc:
+ return EVP_rc2_40_cbc();
default:
return NULL;
}

View file

@ -5,7 +5,7 @@ feat_add_uv_loop_watcher_queue_code.patch
feat_initialize_asar_support.patch feat_initialize_asar_support.patch
expose_get_builtin_module_function.patch expose_get_builtin_module_function.patch
build_add_gn_build_files.patch build_add_gn_build_files.patch
fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch fix_add_default_values_for_variables_in_common_gypi.patch
feat_add_new_built_with_electron_variable_to_config_gypi.patch feat_add_new_built_with_electron_variable_to_config_gypi.patch
feat_add_flags_for_low-level_hooks_and_exceptions.patch feat_add_flags_for_low-level_hooks_and_exceptions.patch
fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
@ -23,9 +23,5 @@ fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch
fix_allow_preventing_initializeinspector_in_env.patch fix_allow_preventing_initializeinspector_in_env.patch
src_allow_embedders_to_provide_a_custom_pageallocator_to.patch src_allow_embedders_to_provide_a_custom_pageallocator_to.patch
fix_crypto_tests_to_run_with_bssl.patch fix_crypto_tests_to_run_with_bssl.patch
fix_handle_new_tostring_behavior_in_v8_serdes_test.patch
src_remove_extra_semis_from_member_fns.patch
src_add_node_use_v8_platform_in_initializeonceperprocess.patch
tls_tweak_clientcertengine_argument_parsing.patch
src_add_get_set_pair_for_unhandled_rejections_mode.patch src_add_get_set_pair_for_unhandled_rejections_mode.patch
fix_account_for_debugger_agent_race_condition.patch fix_account_for_debugger_agent_race_condition.patch

View file

@ -888,10 +888,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+} +}
diff --git a/filenames.json b/filenames.json diff --git a/filenames.json b/filenames.json
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..24ab6333726076d6e2057e45410c88a21dd00193 index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee5a9e0646
--- /dev/null --- /dev/null
+++ b/filenames.json +++ b/filenames.json
@@ -0,0 +1,528 @@ @@ -0,0 +1,530 @@
+// This file is automatically generated by generate_gn_filenames_json.py +// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT +// DO NOT EDIT
+{ +{
@ -1068,6 +1068,9 @@ index 0000000000000000000000000000000000000000..24ab6333726076d6e2057e45410c88a2
+ "lib/internal/crypto/webcrypto.js", + "lib/internal/crypto/webcrypto.js",
+ "lib/internal/crypto/x509.js", + "lib/internal/crypto/x509.js",
+ "lib/internal/constants.js", + "lib/internal/constants.js",
+ "lib/internal/debugger/_inspect.js",
+ "lib/internal/debugger/inspect_client.js",
+ "lib/internal/debugger/inspect_repl.js",
+ "lib/internal/dgram.js", + "lib/internal/dgram.js",
+ "lib/internal/dns/promises.js", + "lib/internal/dns/promises.js",
+ "lib/internal/dns/utils.js", + "lib/internal/dns/utils.js",
@ -1091,9 +1094,6 @@ index 0000000000000000000000000000000000000000..24ab6333726076d6e2057e45410c88a2
+ "lib/internal/heap_utils.js", + "lib/internal/heap_utils.js",
+ "lib/internal/histogram.js", + "lib/internal/histogram.js",
+ "lib/internal/idna.js", + "lib/internal/idna.js",
+ "lib/internal/inspector/_inspect.js",
+ "lib/internal/inspector/inspect_client.js",
+ "lib/internal/inspector/inspect_repl.js",
+ "lib/internal/inspector_async_hook.js", + "lib/internal/inspector_async_hook.js",
+ "lib/internal/js_stream_socket.js", + "lib/internal/js_stream_socket.js",
+ "lib/internal/legacy/processbinding.js", + "lib/internal/legacy/processbinding.js",
@ -1287,6 +1287,7 @@ index 0000000000000000000000000000000000000000..24ab6333726076d6e2057e45410c88a2
+ "src/node_trace_events.cc", + "src/node_trace_events.cc",
+ "src/node_types.cc", + "src/node_types.cc",
+ "src/node_url.cc", + "src/node_url.cc",
+ "src/node_url_tables.cc",
+ "src/node_util.cc", + "src/node_util.cc",
+ "src/node_v8.cc", + "src/node_v8.cc",
+ "src/node_wasi.cc", + "src/node_wasi.cc",
@ -1378,6 +1379,7 @@ index 0000000000000000000000000000000000000000..24ab6333726076d6e2057e45410c88a2
+ "src/node_perf_common.h", + "src/node_perf_common.h",
+ "src/node_platform.h", + "src/node_platform.h",
+ "src/node_process.h", + "src/node_process.h",
+ "src/node_process-inl.h",
+ "src/node_report.h", + "src/node_report.h",
+ "src/node_revert.h", + "src/node_revert.h",
+ "src/node_root_certs.h", + "src/node_root_certs.h",
@ -1626,7 +1628,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ args = rebase_path(inputs + outputs, root_build_dir) + args = rebase_path(inputs + outputs, root_build_dir)
+} +}
diff --git a/src/node_version.h b/src/node_version.h diff --git a/src/node_version.h b/src/node_version.h
index 810425a5562f6a45304a94cb1d58e3b812983401..9cc414d689feefc9a932d87c6a571259271254ee 100644 index a1a67f0f9034e448a650658df951f160430981ae..c04f70fd1357418b85f1cc64ba9ee0af97076592 100644
--- a/src/node_version.h --- a/src/node_version.h
+++ b/src/node_version.h +++ b/src/node_version.h
@@ -89,7 +89,10 @@ @@ -89,7 +89,10 @@

View file

@ -13,8 +13,29 @@ process and provide embedder modules (electrons
renderer/browser/worker/sandboxed bootstrap scripts). These are loaded renderer/browser/worker/sandboxed bootstrap scripts). These are loaded
through LoadEmbedderJavaScriptSource() through LoadEmbedderJavaScriptSource()
diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js
index b45af42d12ff7df8a9e125e87f51af3456811c23..c84ff7feb07aebf656ada7e37d812d9d8a81300f 100644
--- a/lib/internal/fs/watchers.js
+++ b/lib/internal/fs/watchers.js
@@ -290,10 +290,12 @@ function emitCloseNT(self) {
// Legacy alias on the C++ wrapper object. This is not public API, so we may
// want to runtime-deprecate it at some point. There's no hurry, though.
-ObjectDefineProperty(FSEvent.prototype, 'owner', {
- get() { return this[owner_symbol]; },
- set(v) { return this[owner_symbol] = v; }
-});
+if (!'owner' in FSEvent.prototype) {
+ ObjectDefineProperty(FSEvent.prototype, 'owner', {
+ get() { return this[owner_symbol]; },
+ set(v) { return this[owner_symbol] = v; }
+ });
+}
async function* watch(filename, options = {}) {
const path = toNamespacedPath(getValidatedPath(filename));
diff --git a/src/node_native_module.cc b/src/node_native_module.cc diff --git a/src/node_native_module.cc b/src/node_native_module.cc
index b3a104547f392d9e0296ea467d902d76c29517e1..65a1e324fcdc8cc1daf3aa8d88588684e3e1fa86 100644 index f788732ae569d460a0e596397e589774ba4be4f1..186c24c0ba37781d8d9d0443d18b4f4bb0e02bef 100644
--- a/src/node_native_module.cc --- a/src/node_native_module.cc
+++ b/src/node_native_module.cc +++ b/src/node_native_module.cc
@@ -19,6 +19,7 @@ NativeModuleLoader NativeModuleLoader::instance_; @@ -19,6 +19,7 @@ NativeModuleLoader NativeModuleLoader::instance_;

View file

@ -8,7 +8,7 @@ they use themselves as the entry point. We should try to upstream some form
of this. of this.
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index 4e6765de3b1668740c318310147625d795c7a18d..27a2060c0f0f5895b97514a21e9ffdfe0558347e 100644 index f7e9ffa74a4f19caa96680b3c955937f7ab31ea0..d1fb880f5f904909a1535f8253ab0b29203304bf 100644
--- a/lib/internal/bootstrap/pre_execution.js --- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js
@@ -102,10 +102,12 @@ function patchProcessObject(expandArgv1) { @@ -102,10 +102,12 @@ function patchProcessObject(expandArgv1) {
@ -29,10 +29,10 @@ index 4e6765de3b1668740c318310147625d795c7a18d..27a2060c0f0f5895b97514a21e9ffdfe
// TODO(joyeecheung): most of these should be deprecated and removed, // TODO(joyeecheung): most of these should be deprecated and removed,
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 23f7fcce7cfe8879be95fd949af70da1869e17b3..5e2fca90e26ea18be8c406ceb0bbc3523a39f6c5 100644 index afb1eca73a2d91b76d098114de18ad7e29846e5c..01070c214e961d31ac508cfca669df2733abbff6 100644
--- a/lib/internal/modules/cjs/loader.js --- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js
@@ -1083,6 +1083,13 @@ Module.prototype._compile = function(content, filename) { @@ -1069,6 +1069,13 @@ Module.prototype._compile = function(content, filename) {
if (getOptionValue('--inspect-brk') && process._eval == null) { if (getOptionValue('--inspect-brk') && process._eval == null) {
if (!resolvedArgv) { if (!resolvedArgv) {
// We enter the repl if we're not given a filename argument. // We enter the repl if we're not given a filename argument.

View file

@ -7,7 +7,7 @@ This is used so that we can modify the flag at runtime where
config can only be set at compile time. config can only be set at compile time.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index ca7274622fd95d06cf529db0751da9e189ad556e..74b148e4912a44f6be260f9200e976bae97c0fd8 100644 index 8b70f79d2b278f2f6b15abc2eba5045b1ca503b4..bfc6edfae4b4b4f8b7ee2a97209e1801d7c2d4c9 100644
--- a/lib/internal/bootstrap/node.js --- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js
@@ -193,7 +193,7 @@ const { @@ -193,7 +193,7 @@ const {

View file

@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
out in memory on 64-bit machines, and will summarily fail to work. out in memory on 64-bit machines, and will summarily fail to work.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index f165e57b1b0456bf719285093578e059310d36f4..c6d133e4de88c67ce7bd92cd2572381806e06b1b 100644 index 9481fdb6dd4628833e60ae7099f03eca41edd057..60789d5553352563eb41a341860df70175153e4c 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
@ -20,7 +20,7 @@ index f165e57b1b0456bf719285093578e059310d36f4..c6d133e4de88c67ce7bd92cd25723818
# Disable V8 untrusted code mitigations. # Disable V8 untrusted code mitigations.
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations # See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
@@ -124,6 +124,9 @@ @@ -125,6 +125,9 @@
'obj_dir%': '<(PRODUCT_DIR)/obj.target', 'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a', 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
}], }],

View file

@ -24,7 +24,7 @@ Environment on the V8 context of blink, so no new V8 context is created.
As a result, a renderer process may have multiple Node Environments in it. As a result, a renderer process may have multiple Node Environments in it.
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index bf041fb682a2c2b56d044a174f99a579a75f0d14..a99f2f4f01b16fc70f3038a25da22c788714b3f6 100644 index b60be116b6139bd4b7c10485bfdad2c1b905c995..c9d491f01651ef57fb793dda108469cb7ddccc5c 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -139,6 +139,8 @@ using v8::Undefined; @@ -139,6 +139,8 @@ using v8::Undefined;

View file

@ -6,7 +6,7 @@ Subject: feat: initialize asar support
This patch initializes asar support in Node.js. This patch initializes asar support in Node.js.
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index e52da0868e1ad2df0a23138a4a8d8d2a3d677fab..4e6765de3b1668740c318310147625d795c7a18d 100644 index 83ccfe90c110657f54e068d522c3a75c7f19c75a..f7e9ffa74a4f19caa96680b3c955937f7ab31ea0 100644
--- a/lib/internal/bootstrap/pre_execution.js --- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js
@@ -74,6 +74,7 @@ function prepareMainThreadExecution(expandArgv1 = false) { @@ -74,6 +74,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
@ -17,7 +17,7 @@ index e52da0868e1ad2df0a23138a4a8d8d2a3d677fab..4e6765de3b1668740c318310147625d7
} }
function patchProcessObject(expandArgv1) { function patchProcessObject(expandArgv1) {
@@ -457,6 +458,10 @@ function loadPreloadModules() { @@ -469,6 +470,10 @@ function loadPreloadModules() {
} }
} }

View file

@ -9,10 +9,10 @@ errors. This is remedied by adding a small timeout to the test.
We'll either upstream this or figure out a better solution. We'll either upstream this or figure out a better solution.
diff --git a/test/inspector-cli/test-inspector-cli-address.js b/test/inspector-cli/test-inspector-cli-address.js diff --git a/test/sequential/test-debugger-address.js b/test/sequential/test-debugger-address.js
index ff31747016c2d49ac87fa272eba3231e9d4fbae5..e4f7b13aad3c60100e56df00165d1af550f1a117 100644 index ff31747016c2d49ac87fa272eba3231e9d4fbae5..e4f7b13aad3c60100e56df00165d1af550f1a117 100644
--- a/test/inspector-cli/test-inspector-cli-address.js --- a/test/sequential/test-debugger-address.js
+++ b/test/inspector-cli/test-inspector-cli-address.js +++ b/test/sequential/test-debugger-address.js
@@ -59,6 +59,7 @@ function launchTarget(...args) { @@ -59,6 +59,7 @@ function launchTarget(...args) {
cli = startCLI([`${host || '127.0.0.1'}:${port}`]); cli = startCLI([`${host || '127.0.0.1'}:${port}`]);
return cli.waitForPrompt(); return cli.waitForPrompt();
@ -21,10 +21,10 @@ index ff31747016c2d49ac87fa272eba3231e9d4fbae5..e4f7b13aad3c60100e56df00165d1af5
.then(() => cli.command('sb("alive.js", 3)')) .then(() => cli.command('sb("alive.js", 3)'))
.then(() => cli.waitFor(/break/)) .then(() => cli.waitFor(/break/))
.then(() => cli.waitForPrompt()) .then(() => cli.waitForPrompt())
diff --git a/test/inspector-cli/test-inspector-cli-pid.js b/test/inspector-cli/test-inspector-cli-pid.js diff --git a/test/sequential/test-debugger-pid.js b/test/sequential/test-debugger-pid.js
index 97de9f40369d2d1df9674c6df5bbaf78022667c6..3d51a8963ba24e5e5f6a64cd792859535670dd9a 100644 index 97de9f40369d2d1df9674c6df5bbaf78022667c6..3d51a8963ba24e5e5f6a64cd792859535670dd9a 100644
--- a/test/inspector-cli/test-inspector-cli-pid.js --- a/test/sequential/test-debugger-pid.js
+++ b/test/inspector-cli/test-inspector-cli-pid.js +++ b/test/sequential/test-debugger-pid.js
@@ -38,6 +38,7 @@ function launchTarget(...args) { @@ -38,6 +38,7 @@ function launchTarget(...args) {
cli = startCLI(['-p', `${target.pid}`]); cli = startCLI(['-p', `${target.pid}`]);
return cli.waitForPrompt(); return cli.waitForPrompt();

View file

@ -1,17 +1,16 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net> From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Wed, 19 Sep 2018 12:20:44 -0700 Date: Wed, 19 Sep 2018 12:20:44 -0700
Subject: fix: add default values for 'enable_lto' and 'build_v8_with_gn' in Subject: fix: add default values for variables in common.gypi
common.gypi
common.gypi is a file that's included in the node header bundle, despite common.gypi is a file that's included in the node header bundle, despite
the fact that we do not build node with gyp. the fact that we do not build node with gyp.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index 4bc75c7c41c6dda95e244b28a7827c83611bdc56..f165e57b1b0456bf719285093578e059310d36f4 100644 index aa42c69f96391b72e5e3cbada27fd662cb0cc69d..9481fdb6dd4628833e60ae7099f03eca41edd057 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -81,6 +81,22 @@ @@ -81,6 +81,23 @@
##### end V8 defaults ##### ##### end V8 defaults #####
@ -30,6 +29,7 @@ index 4bc75c7c41c6dda95e244b28a7827c83611bdc56..f165e57b1b0456bf719285093578e059
+ # these values being accurate. + # these values being accurate.
+ 'build_v8_with_gn': 'false', + 'build_v8_with_gn': 'false',
+ 'enable_lto%': 'false', + 'enable_lto%': 'false',
+ 'llvm_version': '0.0',
+ +
'conditions': [ 'conditions': [
['OS == "win"', { ['OS == "win"', {

View file

@ -6,7 +6,7 @@ Subject: fix: add v8_enable_reverse_jsargs defines in common.gypi
This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this. This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index c6d133e4de88c67ce7bd92cd2572381806e06b1b..b426185cb20b24def9a757eefb58c62686a8636a 100644 index 60789d5553352563eb41a341860df70175153e4c..9067a6a27606099ec5decbc4cd74283fced77711 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -65,6 +65,7 @@ @@ -65,6 +65,7 @@
@ -25,7 +25,7 @@ index c6d133e4de88c67ce7bd92cd2572381806e06b1b..b426185cb20b24def9a757eefb58c626
##### end V8 defaults ##### ##### end V8 defaults #####
# When building native modules using 'npm install' with the system npm, # When building native modules using 'npm install' with the system npm,
@@ -373,6 +375,9 @@ @@ -381,6 +383,9 @@
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', { ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'], 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
}], }],

View file

@ -11,7 +11,7 @@ initialize it in the browser process. This adds a new
EnvironmentFlags option which allows preventing that invocation. EnvironmentFlags option which allows preventing that invocation.
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index bcadb23b0ebdadf8dc724afb022ca492d0df8f66..96dbf0d8325715c8f4db115884e4b68f2c7b7502 100644 index de29d45adde76587f2a9cd50392ba45b8e24839e..09c0d22ff91856704f61024646c946a39baf53d8 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -341,12 +341,14 @@ Environment* CreateEnvironment( @@ -341,12 +341,14 @@ Environment* CreateEnvironment(
@ -36,10 +36,10 @@ index bcadb23b0ebdadf8dc724afb022ca492d0df8f66..96dbf0d8325715c8f4db115884e4b68f
#endif #endif
diff --git a/src/env-inl.h b/src/env-inl.h diff --git a/src/env-inl.h b/src/env-inl.h
index f88e7648155186ce27b19ca6e4954bf764e7a2f8..6d34c5125e93bc0f0ce414be573438aec091dbb5 100644 index b3b1ea908253b9240cc37931f34b2a8c8c9fa3ab..dc37298aa0e13bb79030123f38070d0254691b28 100644
--- a/src/env-inl.h --- a/src/env-inl.h
+++ b/src/env-inl.h +++ b/src/env-inl.h
@@ -816,6 +816,10 @@ inline bool Environment::tracks_unmanaged_fds() const { @@ -877,6 +877,10 @@ inline bool Environment::tracks_unmanaged_fds() const {
return flags_ & EnvironmentFlags::kTrackUnmanagedFds; return flags_ & EnvironmentFlags::kTrackUnmanagedFds;
} }
@ -51,10 +51,10 @@ index f88e7648155186ce27b19ca6e4954bf764e7a2f8..6d34c5125e93bc0f0ce414be573438ae
return emit_filehandle_warning_; return emit_filehandle_warning_;
} }
diff --git a/src/env.h b/src/env.h diff --git a/src/env.h b/src/env.h
index 6b8444f0bc578cd8bccb9f5589531460b68b3cc4..2b0088bc29639c4da38a148368fb0dbfa3a19b4c 100644 index 7b136f70fbad1e0a90406add90d5e538577e2a2b..eaf8a17c99aa6a4135c54616f68b15e0620e4378 100644
--- a/src/env.h --- a/src/env.h
+++ b/src/env.h +++ b/src/env.h
@@ -1177,6 +1177,7 @@ class Environment : public MemoryRetainer { @@ -1197,6 +1197,7 @@ class Environment : public MemoryRetainer {
inline bool owns_process_state() const; inline bool owns_process_state() const;
inline bool owns_inspector() const; inline bool owns_inspector() const;
inline bool tracks_unmanaged_fds() const; inline bool tracks_unmanaged_fds() const;

View file

@ -442,21 +442,10 @@ index f4d5a651ed6b888d3527a462ab5fccee58ea48b6..c0046099df9ec0c7a33ed9baa2127da8
// Next statement should not throw an exception. // Next statement should not throw an exception.
diff --git a/test/parallel/test-crypto-getcipherinfo.js b/test/parallel/test-crypto-getcipherinfo.js diff --git a/test/parallel/test-crypto-getcipherinfo.js b/test/parallel/test-crypto-getcipherinfo.js
index 98d2a52eceac4bc564fd2878f77b50c336a67a66..30461eddc0b9a0622bbf2b8c5585ed0c986bfa90 100644 index 98d2a52eceac4bc564fd2878f77b50c336a67a66..bcb2de6e354c26816000f2400d9c1d46de01888a 100644
--- a/test/parallel/test-crypto-getcipherinfo.js --- a/test/parallel/test-crypto-getcipherinfo.js
+++ b/test/parallel/test-crypto-getcipherinfo.js +++ b/test/parallel/test-crypto-getcipherinfo.js
@@ -17,6 +17,10 @@ assert.strictEqual(getCipherInfo(-1), undefined); @@ -62,9 +62,13 @@ assert(getCipherInfo('aes-128-cbc', { ivLength: 16 }));
assert.strictEqual(getCipherInfo('cipher that does not exist'), undefined);
ciphers.forEach((cipher) => {
+ if (cipher.endsWith('gcm')) {
+ common.printSkipMessage(`Skipping unsupporter gcm cipher ${cipher}`);
+ return;
+ }
const info = getCipherInfo(cipher);
assert(info);
const info2 = getCipherInfo(info.nid);
@@ -62,9 +66,13 @@ assert(getCipherInfo('aes-128-cbc', { ivLength: 16 }));
assert(!getCipherInfo('aes-128-ccm', { ivLength: 1 })); assert(!getCipherInfo('aes-128-ccm', { ivLength: 1 }));
assert(!getCipherInfo('aes-128-ccm', { ivLength: 14 })); assert(!getCipherInfo('aes-128-ccm', { ivLength: 14 }));

View file

@ -7,10 +7,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead
This API is used by Electron to create Node's tracing controller. This API is used by Electron to create Node's tracing controller.
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index 46e3360ef9c023bfb4cb45393a81c4af55e8d805..bcadb23b0ebdadf8dc724afb022ca492d0df8f66 100644 index b7e213602b57d5cf15890726ae773d6067877c44..de29d45adde76587f2a9cd50392ba45b8e24839e 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -454,6 +454,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { @@ -456,6 +456,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
return env->platform(); return env->platform();
} }

View file

@ -11,38 +11,11 @@ and BoringSSL which Electron uses via Chromium. Each incompatibility typically h
Where possible, we should seek to make this patch as minimal as possible. Where possible, we should seek to make this patch as minimal as possible.
Upstreams for code herein (update when changed): Upstreams:
* https://boringssl-review.googlesource.com/c/boringssl/+/47824 - https://github.com/nodejs/node/pull/39054
* https://boringssl-review.googlesource.com/c/boringssl/+/47844 - https://github.com/nodejs/node/pull/39138
* https://github.com/nodejs/node/pull/38926 - https://github.com/nodejs/node/pull/39136
* https://github.com/nodejs/node/pull/38925
* https://github.com/nodejs/node/pull/38901
* https://github.com/nodejs/node/pull/38900
* https://github.com/nodejs/node/pull/38864
* https://github.com/nodejs/node/pull/38744
diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc
index 5ce466582823ae1304731610da61b7fde77fc65a..cd3c7cea3b83be95a6663909ad9e1a2d2f2eb25a 100644
--- a/src/crypto/crypto_cipher.cc
+++ b/src/crypto/crypto_cipher.cc
@@ -148,7 +148,7 @@ void GetCipherInfo(const FunctionCallbackInfo<Value>& args) {
if (info->Set(
env->context(),
env->name_string(),
- OneByteString(env->isolate(), EVP_CIPHER_name(cipher))).IsNothing()) {
+ OneByteString(env->isolate(), OBJ_nid2sn(EVP_CIPHER_nid(cipher)))).IsNothing()) {
return;
}
@@ -906,7 +906,7 @@ bool PublicKeyCipher::Cipher(
void* label = OPENSSL_memdup(oaep_label.data(), oaep_label.size());
CHECK_NOT_NULL(label);
if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(),
- reinterpret_cast<unsigned char*>(label),
+ static_cast<unsigned char*>(label),
oaep_label.size())) {
OPENSSL_free(label);
return false;
diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc
index f4b7bd3ad8548a0b69943ddea669e6f1991b7a49..221d652fa7de246e5f69fcf392e334087bac0199 100644 index f4b7bd3ad8548a0b69943ddea669e6f1991b7a49..221d652fa7de246e5f69fcf392e334087bac0199 100644
--- a/src/crypto/crypto_common.cc --- a/src/crypto/crypto_common.cc
@ -110,18 +83,6 @@ index f4b7bd3ad8548a0b69943ddea669e6f1991b7a49..221d652fa7de246e5f69fcf392e33408
buf += 2; buf += 2;
Local<Object> obj = Object::New(env->isolate()); Local<Object> obj = Object::New(env->isolate());
if (!Set(env->context(), if (!Set(env->context(),
diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc
index 8feefde819ea8b67c92afd2af7edf1fcc00aabd0..7eb17ee53475fbbedb456f535b7d4a76ea66693e 100644
--- a/src/crypto/crypto_context.cc
+++ b/src/crypto/crypto_context.cc
@@ -13,6 +13,7 @@
#include <openssl/x509.h>
#include <openssl/pkcs12.h>
+#include <openssl/rand.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif // !OPENSSL_NO_ENGINE
diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc
index 1c48f98656fd211403354bb88331450e51ffb3e5..19029e058eb7ebbea283ad49be47c0c6246cf4e7 100644 index 1c48f98656fd211403354bb88331450e51ffb3e5..19029e058eb7ebbea283ad49be47c0c6246cf4e7 100644
--- a/src/crypto/crypto_dh.cc --- a/src/crypto/crypto_dh.cc
@ -261,18 +222,10 @@ index 0aa96ada47abe4b66fb616c665101278bbe0afb6..1e9a4863c5faea5f6b275483ca16f3a6
void HKDFConfig::MemoryInfo(MemoryTracker* tracker) const { void HKDFConfig::MemoryInfo(MemoryTracker* tracker) const {
diff --git a/src/crypto/crypto_random.cc b/src/crypto/crypto_random.cc diff --git a/src/crypto/crypto_random.cc b/src/crypto/crypto_random.cc
index b24f8f32136ffaed54310d5dc02e57b0f69450d6..50a6663966cdb147a702df21240fa449850c3549 100644 index 7cb4513f9ad0eaadd055b169520ae1e5073b7e2d..50a6663966cdb147a702df21240fa449850c3549 100644
--- a/src/crypto/crypto_random.cc --- a/src/crypto/crypto_random.cc
+++ b/src/crypto/crypto_random.cc +++ b/src/crypto/crypto_random.cc
@@ -8,6 +8,7 @@ @@ -150,7 +150,7 @@ Maybe<bool> RandomPrimeTraits::AdditionalConfig(
#include "v8.h"
#include <openssl/bn.h>
+#include <openssl/rand.h>
namespace node {
@@ -149,7 +150,7 @@ Maybe<bool> RandomPrimeTraits::AdditionalConfig(
params->bits = bits; params->bits = bits;
params->safe = safe; params->safe = safe;
@ -281,22 +234,6 @@ index b24f8f32136ffaed54310d5dc02e57b0f69450d6..50a6663966cdb147a702df21240fa449
if (!params->prime) { if (!params->prime) {
THROW_ERR_CRYPTO_OPERATION_FAILED(env, "could not generate prime"); THROW_ERR_CRYPTO_OPERATION_FAILED(env, "could not generate prime");
return Nothing<bool>(); return Nothing<bool>();
diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc
index 5fa91cce1a6ad2bc1167e20a4dadcfdfc2343440..5bbeb01ab58ac7f95e2c4ee1357f50540be86229 100644
--- a/src/crypto/crypto_rsa.cc
+++ b/src/crypto/crypto_rsa.cc
@@ -210,7 +210,10 @@ WebCryptoCipherStatus RSA_Cipher(
if (label_len > 0) {
void* label = OPENSSL_memdup(params.label.get(), label_len);
CHECK_NOT_NULL(label);
- if (EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(), label, label_len) <= 0) {
+ if (EVP_PKEY_CTX_set0_rsa_oaep_label(
+ ctx.get(),
+ static_cast<unsigned char*>(label),
+ label_len) <= 0) {
OPENSSL_free(label);
return WebCryptoCipherStatus::FAILED;
}
diff --git a/src/crypto/crypto_sig.cc b/src/crypto/crypto_sig.cc diff --git a/src/crypto/crypto_sig.cc b/src/crypto/crypto_sig.cc
index 7b113a8dcb06b0b0e1329ce0daf7305598ea6545..b04e53a7f24885ffb6639430988d0ffb524b028e 100644 index 7b113a8dcb06b0b0e1329ce0daf7305598ea6545..b04e53a7f24885ffb6639430988d0ffb524b028e 100644
--- a/src/crypto/crypto_sig.cc --- a/src/crypto/crypto_sig.cc
@ -311,19 +248,10 @@ index 7b113a8dcb06b0b0e1329ce0daf7305598ea6545..b04e53a7f24885ffb6639430988d0ffb
const EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey.get()); const EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey.get());
const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key); const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
index 0d533ce42531d147a4c99fef5a72c311e0796150..76c8c037ffd3c8b67179d7d881ad6ea530b00686 100644 index 13c40dcb757661220288465c39101de0b4018e90..7d1d4400319292a8ddf3afe013b5678f84c25576 100644
--- a/src/crypto/crypto_util.cc --- a/src/crypto/crypto_util.cc
+++ b/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc
@@ -20,6 +20,8 @@ @@ -139,7 +139,6 @@ void InitCryptoOnce() {
#endif
#endif
+#include <openssl/rand.h>
+
namespace node {
using v8::ArrayBuffer;
@@ -118,7 +120,6 @@ void InitCryptoOnce() {
OPENSSL_init_ssl(0, settings); OPENSSL_init_ssl(0, settings);
OPENSSL_INIT_free(settings); OPENSSL_INIT_free(settings);
settings = nullptr; settings = nullptr;
@ -331,15 +259,15 @@ index 0d533ce42531d147a4c99fef5a72c311e0796150..76c8c037ffd3c8b67179d7d881ad6ea5
#ifndef _WIN32 #ifndef _WIN32
if (per_process::cli_options->secure_heap != 0) { if (per_process::cli_options->secure_heap != 0) {
@@ -137,6 +138,7 @@ void InitCryptoOnce() { @@ -160,6 +159,7 @@ void InitCryptoOnce() {
break;
}
} }
+#endif
#endif #endif
/* Override FIPS settings in cnf file, if needed. */ +#endif
@@ -488,24 +490,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj, // Turn off compression. Saves memory and protects against CRIME attacks.
// No-op with OPENSSL_NO_COMP builds of OpenSSL.
sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
@@ -490,24 +490,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
V(BIO) \ V(BIO) \
V(PKCS7) \ V(PKCS7) \
V(X509V3) \ V(X509V3) \
@ -364,7 +292,7 @@ index 0d533ce42531d147a4c99fef5a72c311e0796150..76c8c037ffd3c8b67179d7d881ad6ea5
V(USER) \ V(USER) \
#define V(name) case ERR_LIB_##name: lib = #name "_"; break; #define V(name) case ERR_LIB_##name: lib = #name "_"; break;
@@ -665,7 +657,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) { @@ -667,7 +657,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsUint32()); CHECK(args[0]->IsUint32());
Environment* env = Environment::GetCurrent(args); Environment* env = Environment::GetCurrent(args);
uint32_t len = args[0].As<Uint32>()->Value(); uint32_t len = args[0].As<Uint32>()->Value();
@ -373,7 +301,7 @@ index 0d533ce42531d147a4c99fef5a72c311e0796150..76c8c037ffd3c8b67179d7d881ad6ea5
if (data == nullptr) { if (data == nullptr) {
// There's no memory available for the allocation. // There's no memory available for the allocation.
// Return nothing. // Return nothing.
@@ -677,7 +669,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) { @@ -679,7 +669,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
data, data,
len, len,
[](void* data, size_t len, void* deleter_data) { [](void* data, size_t len, void* deleter_data) {
@ -382,7 +310,7 @@ index 0d533ce42531d147a4c99fef5a72c311e0796150..76c8c037ffd3c8b67179d7d881ad6ea5
}, },
data); data);
Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store); Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store);
@@ -685,10 +677,12 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) { @@ -687,10 +677,12 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
} }
void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) { void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
@ -396,7 +324,7 @@ index 0d533ce42531d147a4c99fef5a72c311e0796150..76c8c037ffd3c8b67179d7d881ad6ea5
} // namespace } // namespace
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
index f2f61aa45185812e9248845b664539be4fe24550..303ba4c3b7c4c2fc5dee906e22d5e7642b8351c8 100644 index ac95612a0b1a856d7fe07efde59786e811f1b98d..aa62753d7c929027f5265fa4330b0429c726f7ef 100644
--- a/src/crypto/crypto_util.h --- a/src/crypto/crypto_util.h
+++ b/src/crypto/crypto_util.h +++ b/src/crypto/crypto_util.h
@@ -15,7 +15,9 @@ @@ -15,7 +15,9 @@
@ -410,18 +338,18 @@ index f2f61aa45185812e9248845b664539be4fe24550..303ba4c3b7c4c2fc5dee906e22d5e764
#include <openssl/dsa.h> #include <openssl/dsa.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index a99f2f4f01b16fc70f3038a25da22c788714b3f6..ceb532648b33a6c2f3b8a135b315985cfff5419e 100644 index c9d491f01651ef57fb793dda108469cb7ddccc5c..6a55535b5c6ef72b1cdb366299840a2e78643911 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -1020,7 +1020,7 @@ InitializationResult InitializeOncePerProcess(int argc, char** argv) { @@ -1035,7 +1035,7 @@ InitializationResult InitializeOncePerProcess(
return result;
} }
if (init_flags & kInitOpenSSL) {
-#if HAVE_OPENSSL -#if HAVE_OPENSSL
+#if HAVE_OPENSSL && !defined(OPENSSL_IS_BORINGSSL) +#if HAVE_OPENSSL && !defined(OPENSSL_IS_BORINGSSL)
{ {
std::string extra_ca_certs; std::string extra_ca_certs;
if (credentials::SafeGetenv("NODE_EXTRA_CA_CERTS", &extra_ca_certs)) if (credentials::SafeGetenv("NODE_EXTRA_CA_CERTS", &extra_ca_certs))
diff --git a/src/node_metadata.h b/src/node_metadata.h diff --git a/src/node_metadata.h b/src/node_metadata.h
index 4486d5af2c1622c7c8f44401dc3ebb986d8e3c2e..db1769f1b3f1617ed8dbbea57b5e324183b42be2 100644 index 4486d5af2c1622c7c8f44401dc3ebb986d8e3c2e..db1769f1b3f1617ed8dbbea57b5e324183b42be2 100644
--- a/src/node_metadata.h --- a/src/node_metadata.h

View file

@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Wed, 14 Apr 2021 12:03:27 -0700
Subject: fix: handle new ToString() behavior in v8 serdes test
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2739980
diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js
index 1d3b6ff81168e704aa67e7abe1556c460e06ffa9..4dffedd3c32b4b1b6eb75e46f8bfb447260046bb 100644
--- a/test/parallel/test-v8-serdes.js
+++ b/test/parallel/test-v8-serdes.js
@@ -50,7 +50,7 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
{
const ser = new v8.DefaultSerializer();
ser._getDataCloneError = common.mustCall((message) => {
- assert.strictEqual(message, '[object Object] could not be cloned.');
+ assert.strictEqual(message, '#<Object> could not be cloned.');
return new Error('foobar');
});

View file

@ -7,10 +7,10 @@ This broke the build at some point. Does it still? We should probably remove
this patch and find out! this patch and find out!
diff --git a/src/node_internals.h b/src/node_internals.h diff --git a/src/node_internals.h b/src/node_internals.h
index b75092d662dc975d147be353b65d14b59ad9e17a..899af0ce5f0c5311008743307294d77e7909564b 100644 index 31076551e70c46da2c32cafd7ac08aee91366537..d57c51ebcc3c9dda1ef41b10ee49453839781deb 100644
--- a/src/node_internals.h --- a/src/node_internals.h
+++ b/src/node_internals.h +++ b/src/node_internals.h
@@ -378,10 +378,11 @@ class TraceEventScope { @@ -391,10 +391,11 @@ class TraceEventScope {
TraceEventScope(const char* category, TraceEventScope(const char* category,
const char* name, const char* name,
void* id) : category_(category), name_(name), id_(id) { void* id) : category_(category), name_(name), id_(id) {

View file

@ -8,10 +8,10 @@ load libraries from embedded applications without modifications of
node's module code. node's module code.
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index fbfc17ba6d188537c9fc3dbfb86cae9b708541f7..0390f2a9a2c82f33918407091c086dcc3cbffae1 100644 index d969a6449cf545c4bb313450dce3940a47be40a2..51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3 100644
--- a/lib/internal/modules/cjs/loader.js --- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js
@@ -1236,7 +1236,7 @@ Module._initPaths = function() { @@ -1222,7 +1222,7 @@ Module._initPaths = function() {
modulePaths = paths; modulePaths = paths;
// Clone as a shallow copy, for introspection. // Clone as a shallow copy, for introspection.

View file

@ -6,10 +6,10 @@ Subject: Pass all globals through "require"
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62) (cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 0390f2a9a2c82f33918407091c086dcc3cbffae1..9e9f9a73d6ec98f4907b8ebc0950a1709c7ececf 100644 index 51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3..9a304f05cf4e09038531007efff28c4f57218c1d 100644
--- a/lib/internal/modules/cjs/loader.js --- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js
@@ -123,6 +123,13 @@ const { @@ -121,6 +121,13 @@ const {
CHAR_COLON CHAR_COLON
} = require('internal/constants'); } = require('internal/constants');
@ -23,7 +23,7 @@ index 0390f2a9a2c82f33918407091c086dcc3cbffae1..9e9f9a73d6ec98f4907b8ebc0950a170
const { const {
isProxy isProxy
} = require('internal/util/types'); } = require('internal/util/types');
@@ -1104,10 +1111,12 @@ Module.prototype._compile = function(content, filename) { @@ -1090,10 +1097,12 @@ Module.prototype._compile = function(content, filename) {
if (requireDepth === 0) statCache = new SafeMap(); if (requireDepth === 0) statCache = new SafeMap();
if (inspectorWrapper) { if (inspectorWrapper) {
result = inspectorWrapper(compiledWrapper, thisValue, exports, result = inspectorWrapper(compiledWrapper, thisValue, exports,

View file

@ -7,7 +7,7 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were
a real filesystem. a real filesystem.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 81a9547b9071bc7956a6c7c8be0c02eeccb6e993..ca7274622fd95d06cf529db0751da9e189ad556e 100644 index 863d4ef5608bcebc9b49c3988509be9cfb18b6cd..8b70f79d2b278f2f6b15abc2eba5045b1ca503b4 100644
--- a/lib/internal/bootstrap/node.js --- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js
@@ -62,6 +62,10 @@ setupBuffer(); @@ -62,6 +62,10 @@ setupBuffer();
@ -22,10 +22,10 @@ index 81a9547b9071bc7956a6c7c8be0c02eeccb6e993..ca7274622fd95d06cf529db0751da9e1
const nativeModule = internalBinding('native_module'); const nativeModule = internalBinding('native_module');
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 9e9f9a73d6ec98f4907b8ebc0950a1709c7ececf..23f7fcce7cfe8879be95fd949af70da1869e17b3 100644 index 9a304f05cf4e09038531007efff28c4f57218c1d..afb1eca73a2d91b76d098114de18ad7e29846e5c 100644
--- a/lib/internal/modules/cjs/loader.js --- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js
@@ -86,7 +86,7 @@ const fs = require('fs'); @@ -84,7 +84,7 @@ const fs = require('fs');
const internalFS = require('internal/fs/utils'); const internalFS = require('internal/fs/utils');
const path = require('path'); const path = require('path');
const { sep } = path; const { sep } = path;
@ -34,7 +34,7 @@ index 9e9f9a73d6ec98f4907b8ebc0950a1709c7ececf..23f7fcce7cfe8879be95fd949af70da1
const packageJsonReader = require('internal/modules/package_json_reader'); const packageJsonReader = require('internal/modules/package_json_reader');
const { safeGetenv } = internalBinding('credentials'); const { safeGetenv } = internalBinding('credentials');
const { const {
@@ -157,7 +157,7 @@ function stat(filename) { @@ -155,7 +155,7 @@ function stat(filename) {
const result = statCache.get(filename); const result = statCache.get(filename);
if (result !== undefined) return result; if (result !== undefined) return result;
} }

View file

@ -7,10 +7,10 @@ Subject: refactor: alter child_process.fork to use execute script with
When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary. When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary.
diff --git a/lib/child_process.js b/lib/child_process.js diff --git a/lib/child_process.js b/lib/child_process.js
index 26e1bb33d0c9ef7a68c2cc41612eb6c7c0d46575..c55742324ed7508652de3060a8648062b7258244 100644 index 62c552d567eaad07ffe65ea5cb24be101b57ebdd..73c11500d7e4a540f26cc7ee3b692a2f4b158b19 100644
--- a/lib/child_process.js --- a/lib/child_process.js
+++ b/lib/child_process.js +++ b/lib/child_process.js
@@ -137,6 +137,15 @@ function fork(modulePath /* , args, options */) { @@ -161,6 +161,15 @@ function fork(modulePath /* , args, options */) {
throw new ERR_CHILD_PROCESS_IPC_REQUIRED('options.stdio'); throw new ERR_CHILD_PROCESS_IPC_REQUIRED('options.stdio');
} }

View file

@ -12,10 +12,10 @@ which is the only option right now.
Upstreamed at https://github.com/nodejs/node/pull/38915. Upstreamed at https://github.com/nodejs/node/pull/38915.
diff --git a/src/env-inl.h b/src/env-inl.h diff --git a/src/env-inl.h b/src/env-inl.h
index 6d34c5125e93bc0f0ce414be573438aec091dbb5..abb2a9cf2652639e3ce636565190d2ed433334b2 100644 index dc37298aa0e13bb79030123f38070d0254691b28..6b9c340fee164c09ec51037121efc91ec0ab4a8b 100644
--- a/src/env-inl.h --- a/src/env-inl.h
+++ b/src/env-inl.h +++ b/src/env-inl.h
@@ -509,6 +509,24 @@ inline bool Environment::abort_on_uncaught_exception() const { @@ -570,6 +570,24 @@ inline bool Environment::abort_on_uncaught_exception() const {
return options_->abort_on_uncaught_exception; return options_->abort_on_uncaught_exception;
} }
@ -41,10 +41,10 @@ index 6d34c5125e93bc0f0ce414be573438aec091dbb5..abb2a9cf2652639e3ce636565190d2ed
options_->force_context_aware = value; options_->force_context_aware = value;
} }
diff --git a/src/env.h b/src/env.h diff --git a/src/env.h b/src/env.h
index 2b0088bc29639c4da38a148368fb0dbfa3a19b4c..f84e5989c8fc316b72f2f1f75bb293534b32eaef 100644 index eaf8a17c99aa6a4135c54616f68b15e0620e4378..dcc163be2c2fa632660dde78012440fe50b03aa3 100644
--- a/src/env.h --- a/src/env.h
+++ b/src/env.h +++ b/src/env.h
@@ -1101,6 +1101,9 @@ class Environment : public MemoryRetainer { @@ -1121,6 +1121,9 @@ class Environment : public MemoryRetainer {
void PrintSyncTrace() const; void PrintSyncTrace() const;
inline void set_trace_sync_io(bool value); inline void set_trace_sync_io(bool value);

View file

@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 1 Jun 2021 14:50:44 +0200
Subject: src: add NODE_USE_V8_PLATFORM in InitializeOncePerProcess
This PR adds an extra `NODE_USE_V8_PLATFORM` guard inside
`InitializeOncePerProcess`. We don't use Node.js V8 platform and instead
use Chromium's gin library to handle V8 setup.
This prevents `v8::V8::Initialize` from being called twice.
Upstreamed at https://github.com/nodejs/node/pull/38888.
diff --git a/src/node.cc b/src/node.cc
index ceb532648b33a6c2f3b8a135b315985cfff5419e..cbe3ed49d016cfd1cc01a6f7d0795e0e085768e8 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -1040,11 +1040,14 @@ InitializationResult InitializeOncePerProcess(int argc, char** argv) {
V8::SetEntropySource(crypto::EntropySource);
#endif // HAVE_OPENSSL
+#if NODE_USE_V8_PLATFORM
per_process::v8_platform.Initialize(
static_cast<int>(per_process::cli_options->v8_thread_pool_size));
V8::Initialize();
performance::performance_v8_start = PERFORMANCE_NOW();
per_process::v8_initialized = true;
+#endif
+
return result;
}

View file

@ -7,10 +7,10 @@ Subject: src: allow embedders to provide a custom PageAllocator to
For certain embedder use cases there are more complex memory allocation requirements that the default V8 page allocator does not handle, for example using MAP_JIT when running under a hardened runtime environment on macOS. This allows such embedders to provide their own allocator that does handle these cases. For certain embedder use cases there are more complex memory allocation requirements that the default V8 page allocator does not handle, for example using MAP_JIT when running under a hardened runtime environment on macOS. This allows such embedders to provide their own allocator that does handle these cases.
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index 96dbf0d8325715c8f4db115884e4b68f2c7b7502..981b324891e6c2def77e773de360fff43e0577fd 100644 index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095984e4381 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -470,8 +470,9 @@ MultiIsolatePlatform* CreatePlatform( @@ -472,8 +472,9 @@ MultiIsolatePlatform* CreatePlatform(
MultiIsolatePlatform* CreatePlatform( MultiIsolatePlatform* CreatePlatform(
int thread_pool_size, int thread_pool_size,
@ -22,7 +22,7 @@ index 96dbf0d8325715c8f4db115884e4b68f2c7b7502..981b324891e6c2def77e773de360fff4
.release(); .release();
} }
@@ -481,8 +482,9 @@ void FreePlatform(MultiIsolatePlatform* platform) { @@ -483,8 +484,9 @@ void FreePlatform(MultiIsolatePlatform* platform) {
std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create( std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create(
int thread_pool_size, int thread_pool_size,

View file

@ -1,336 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 20 May 2021 11:33:53 +0200
Subject: src: remove extra semis from member fns
Refs https://github.com/nodejs/node/pull/37917 and https://github.com/nodejs/node/pull/36811
Upstreamed at https://github.com/nodejs/node/pull/38744
diff --git a/src/crypto/crypto_aes.h b/src/crypto/crypto_aes.h
index a5e37409548e69ed4766eeec7e6c1bf919af10bc..d6eefffb4a846cb5827d655f93fd0f571ef15541 100644
--- a/src/crypto/crypto_aes.h
+++ b/src/crypto/crypto_aes.h
@@ -52,8 +52,8 @@ struct AESCipherConfig final : public MemoryRetainer {
AESCipherConfig& operator=(AESCipherConfig&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(AESCipherConfig);
- SET_SELF_SIZE(AESCipherConfig);
+ SET_MEMORY_INFO_NAME(AESCipherConfig)
+ SET_SELF_SIZE(AESCipherConfig)
};
struct AESCipherTraits final {
diff --git a/src/crypto/crypto_dh.h b/src/crypto/crypto_dh.h
index 7c69afb0a46ab419d63f063e2e898c71e60657f2..fecbf41070bda4a1d6bb6b43e339d01605e81406 100644
--- a/src/crypto/crypto_dh.h
+++ b/src/crypto/crypto_dh.h
@@ -114,9 +114,9 @@ using DHKeyExportJob = KeyExportJob<DHKeyExportTraits>;
struct DHBitsConfig final : public MemoryRetainer {
std::shared_ptr<KeyObjectData> private_key;
std::shared_ptr<KeyObjectData> public_key;
- SET_NO_MEMORY_INFO();
- SET_MEMORY_INFO_NAME(DHBitsConfig);
- SET_SELF_SIZE(DHBitsConfig);
+ SET_NO_MEMORY_INFO()
+ SET_MEMORY_INFO_NAME(DHBitsConfig)
+ SET_SELF_SIZE(DHBitsConfig)
};
struct DHBitsTraits final {
diff --git a/src/crypto/crypto_dsa.h b/src/crypto/crypto_dsa.h
index 3f241b33ba06cf43c60514aec18d3b60f2141c6d..647b4d9004e8cbbab20bcb6b8f93a2e0fbb5b45f 100644
--- a/src/crypto/crypto_dsa.h
+++ b/src/crypto/crypto_dsa.h
@@ -16,8 +16,8 @@ struct DsaKeyPairParams final : public MemoryRetainer {
unsigned int modulus_bits;
int divisor_bits;
SET_NO_MEMORY_INFO()
- SET_MEMORY_INFO_NAME(DsaKeyPairParams);
- SET_SELF_SIZE(DsaKeyPairParams);
+ SET_MEMORY_INFO_NAME(DsaKeyPairParams)
+ SET_SELF_SIZE(DsaKeyPairParams)
};
using DsaKeyPairGenConfig = KeyPairGenConfig<DsaKeyPairParams>;
@@ -38,9 +38,9 @@ struct DsaKeyGenTraits final {
using DsaKeyPairGenJob = KeyGenJob<KeyPairGenTraits<DsaKeyGenTraits>>;
struct DSAKeyExportConfig final : public MemoryRetainer {
- SET_NO_MEMORY_INFO();
- SET_MEMORY_INFO_NAME(DSAKeyExportConfig);
- SET_SELF_SIZE(DSAKeyExportConfig);
+ SET_NO_MEMORY_INFO()
+ SET_MEMORY_INFO_NAME(DSAKeyExportConfig)
+ SET_SELF_SIZE(DSAKeyExportConfig)
};
struct DSAKeyExportTraits final {
diff --git a/src/crypto/crypto_ec.h b/src/crypto/crypto_ec.h
index 444fca58d497795bdb15876654705f79e6c93b75..317ee877a12b6b0267a86c75dd9325309011400d 100644
--- a/src/crypto/crypto_ec.h
+++ b/src/crypto/crypto_ec.h
@@ -60,8 +60,8 @@ struct ECDHBitsConfig final : public MemoryRetainer {
std::shared_ptr<KeyObjectData> public_;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(ECDHBitsConfig);
- SET_SELF_SIZE(ECDHBitsConfig);
+ SET_MEMORY_INFO_NAME(ECDHBitsConfig)
+ SET_SELF_SIZE(ECDHBitsConfig)
};
struct ECDHBitsTraits final {
diff --git a/src/crypto/crypto_hash.h b/src/crypto/crypto_hash.h
index b2ecce0c5b8501ad3f168758fda1194b64bacf13..9f004d1dda6ea55923d26040c47efd7885879cbc 100644
--- a/src/crypto/crypto_hash.h
+++ b/src/crypto/crypto_hash.h
@@ -52,8 +52,8 @@ struct HashConfig final : public MemoryRetainer {
HashConfig& operator=(HashConfig&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(HashConfig);
- SET_SELF_SIZE(HashConfig);
+ SET_MEMORY_INFO_NAME(HashConfig)
+ SET_SELF_SIZE(HashConfig)
};
struct HashTraits final {
diff --git a/src/crypto/crypto_hkdf.h b/src/crypto/crypto_hkdf.h
index 06774bcde97378261e6c4a1658964a4d69b9b19d..666aad65474a2ee0610c597226f5874c7c30aa1a 100644
--- a/src/crypto/crypto_hkdf.h
+++ b/src/crypto/crypto_hkdf.h
@@ -29,8 +29,8 @@ struct HKDFConfig final : public MemoryRetainer {
HKDFConfig& operator=(HKDFConfig&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(HKDFConfig);
- SET_SELF_SIZE(HKDFConfig);
+ SET_MEMORY_INFO_NAME(HKDFConfig)
+ SET_SELF_SIZE(HKDFConfig)
};
struct HKDFTraits final {
diff --git a/src/crypto/crypto_hmac.h b/src/crypto/crypto_hmac.h
index fd7dba2ed8a09839296ca2e35346076fb445af30..d7427ce883c2e17c55a96da1b7b6f69a4c5e192a 100644
--- a/src/crypto/crypto_hmac.h
+++ b/src/crypto/crypto_hmac.h
@@ -54,8 +54,8 @@ struct HmacConfig final : public MemoryRetainer {
HmacConfig& operator=(HmacConfig&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(HmacConfig);
- SET_SELF_SIZE(HmacConfig);
+ SET_MEMORY_INFO_NAME(HmacConfig)
+ SET_SELF_SIZE(HmacConfig)
};
struct HmacTraits final {
diff --git a/src/crypto/crypto_keygen.h b/src/crypto/crypto_keygen.h
index 3dcbd2f0cecfd1d576222de6de5be6ee65699fff..532bcdb80c78cf3e77d6bdeb36e1fc985e198b6d 100644
--- a/src/crypto/crypto_keygen.h
+++ b/src/crypto/crypto_keygen.h
@@ -112,7 +112,7 @@ class KeyGenJob final : public CryptoJob<KeyGenTraits> {
return v8::Just(errors->ToException(env).ToLocal(err));
}
- SET_SELF_SIZE(KeyGenJob);
+ SET_SELF_SIZE(KeyGenJob)
private:
KeyGenJobStatus status_ = KeyGenJobStatus::FAILED;
diff --git a/src/crypto/crypto_keys.h b/src/crypto/crypto_keys.h
index 98e497a5b220c799ac05df6788b3006d2df5dd14..3662b3a3b8688b1921bdc50bda87f5088308881b 100644
--- a/src/crypto/crypto_keys.h
+++ b/src/crypto/crypto_keys.h
@@ -149,8 +149,8 @@ class KeyObjectData : public MemoryRetainer {
size_t GetSymmetricKeySize() const;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(KeyObjectData);
- SET_SELF_SIZE(KeyObjectData);
+ SET_MEMORY_INFO_NAME(KeyObjectData)
+ SET_SELF_SIZE(KeyObjectData)
private:
explicit KeyObjectData(ByteSource symmetric_key);
diff --git a/src/crypto/crypto_pbkdf2.h b/src/crypto/crypto_pbkdf2.h
index 42b95627e0da624d538429019f90b8f6ee02b0fb..6fda7cd3101002561ff98736b8a7a77cc2cee998 100644
--- a/src/crypto/crypto_pbkdf2.h
+++ b/src/crypto/crypto_pbkdf2.h
@@ -39,8 +39,8 @@ struct PBKDF2Config final : public MemoryRetainer {
PBKDF2Config& operator=(PBKDF2Config&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(PBKDF2Config);
- SET_SELF_SIZE(PBKDF2Config);
+ SET_MEMORY_INFO_NAME(PBKDF2Config)
+ SET_SELF_SIZE(PBKDF2Config)
};
struct PBKDF2Traits final {
diff --git a/src/crypto/crypto_random.h b/src/crypto/crypto_random.h
index 1a2a88dc2920ff452eef488dc55a253da49319ed..c9a827f6171e15b5af08cd91d4cbc4ac77f1e202 100644
--- a/src/crypto/crypto_random.h
+++ b/src/crypto/crypto_random.h
@@ -16,9 +16,9 @@ namespace crypto {
struct RandomBytesConfig final : public MemoryRetainer {
unsigned char* buffer;
size_t size;
- SET_NO_MEMORY_INFO();
- SET_MEMORY_INFO_NAME(RandomBytesConfig);
- SET_SELF_SIZE(RandomBytesConfig);
+ SET_NO_MEMORY_INFO()
+ SET_MEMORY_INFO_NAME(RandomBytesConfig)
+ SET_SELF_SIZE(RandomBytesConfig)
};
struct RandomBytesTraits final {
@@ -54,8 +54,8 @@ struct RandomPrimeConfig final : public MemoryRetainer {
int bits;
bool safe;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(RandomPrimeConfig);
- SET_SELF_SIZE(RandomPrimeConfig);
+ SET_MEMORY_INFO_NAME(RandomPrimeConfig)
+ SET_SELF_SIZE(RandomPrimeConfig)
};
struct RandomPrimeTraits final {
@@ -89,8 +89,8 @@ struct CheckPrimeConfig final : public MemoryRetainer {
int checks = 1;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(CheckPrimeConfig);
- SET_SELF_SIZE(CheckPrimeConfig);
+ SET_MEMORY_INFO_NAME(CheckPrimeConfig)
+ SET_SELF_SIZE(CheckPrimeConfig)
};
struct CheckPrimeTraits final {
diff --git a/src/crypto/crypto_rsa.h b/src/crypto/crypto_rsa.h
index acc233ccbb36d28dcda2578987e285ae4f394a8e..eea53815f04e22d573885295c18182f7d85b8e7e 100644
--- a/src/crypto/crypto_rsa.h
+++ b/src/crypto/crypto_rsa.h
@@ -31,8 +31,8 @@ struct RsaKeyPairParams final : public MemoryRetainer {
int saltlen = 0;
SET_NO_MEMORY_INFO()
- SET_MEMORY_INFO_NAME(RsaKeyPairParams);
- SET_SELF_SIZE(RsaKeyPairParams);
+ SET_MEMORY_INFO_NAME(RsaKeyPairParams)
+ SET_SELF_SIZE(RsaKeyPairParams)
};
using RsaKeyPairGenConfig = KeyPairGenConfig<RsaKeyPairParams>;
@@ -88,8 +88,8 @@ struct RSACipherConfig final : public MemoryRetainer {
RSACipherConfig(RSACipherConfig&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(RSACipherConfig);
- SET_SELF_SIZE(RSACipherConfig);
+ SET_MEMORY_INFO_NAME(RSACipherConfig)
+ SET_SELF_SIZE(RSACipherConfig)
};
struct RSACipherTraits final {
diff --git a/src/crypto/crypto_scrypt.h b/src/crypto/crypto_scrypt.h
index b51d6c194ad67a0512460c241413d6cae2617e38..4ca888e31d4e523b7cc0a7a8a2204d772a2c0a16 100644
--- a/src/crypto/crypto_scrypt.h
+++ b/src/crypto/crypto_scrypt.h
@@ -41,8 +41,8 @@ struct ScryptConfig final : public MemoryRetainer {
ScryptConfig& operator=(ScryptConfig&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(ScryptConfig);
- SET_SELF_SIZE(ScryptConfig);
+ SET_MEMORY_INFO_NAME(ScryptConfig)
+ SET_SELF_SIZE(ScryptConfig)
};
struct ScryptTraits final {
diff --git a/src/crypto/crypto_sig.h b/src/crypto/crypto_sig.h
index fa44811c3ee44d102947f77708047de97ba0b44f..5f9104fc5d3c007f56f2450719584b90dfbc7bdd 100644
--- a/src/crypto/crypto_sig.h
+++ b/src/crypto/crypto_sig.h
@@ -127,8 +127,8 @@ struct SignConfiguration final : public MemoryRetainer {
SignConfiguration& operator=(SignConfiguration&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(SignConfiguration);
- SET_SELF_SIZE(SignConfiguration);
+ SET_MEMORY_INFO_NAME(SignConfiguration)
+ SET_SELF_SIZE(SignConfiguration)
};
struct SignTraits final {
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
index 303ba4c3b7c4c2fc5dee906e22d5e7642b8351c8..1fe961a99b3f115c1381f3641d718a21988e9659 100644
--- a/src/crypto/crypto_util.h
+++ b/src/crypto/crypto_util.h
@@ -190,8 +190,8 @@ struct CryptoErrorStore final : public MemoryRetainer {
v8::Local<v8::String> exception_string = v8::Local<v8::String>()) const;
SET_NO_MEMORY_INFO()
- SET_MEMORY_INFO_NAME(CryptoErrorStore);
- SET_SELF_SIZE(CryptoErrorStore);
+ SET_MEMORY_INFO_NAME(CryptoErrorStore)
+ SET_SELF_SIZE(CryptoErrorStore)
private:
std::vector<std::string> errors_;
@@ -504,7 +504,7 @@ class DeriveBitsJob final : public CryptoJob<DeriveBitsTraits> {
return v8::Just(errors->ToException(env).ToLocal(err));
}
- SET_SELF_SIZE(DeriveBitsJob);
+ SET_SELF_SIZE(DeriveBitsJob)
void MemoryInfo(MemoryTracker* tracker) const override {
tracker->TrackFieldWithSize("out", out_.size());
CryptoJob<DeriveBitsTraits>::MemoryInfo(tracker);
diff --git a/src/crypto/crypto_x509.h b/src/crypto/crypto_x509.h
index 3bebc8e37d158bfe0bc214a4be2db89c823247d4..05bfb6e7cb3e2046f621c0bbdeee01210fa2ec12 100644
--- a/src/crypto/crypto_x509.h
+++ b/src/crypto/crypto_x509.h
@@ -98,8 +98,8 @@ class X509Certificate : public BaseObject {
X509* get() { return cert_->get(); }
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(X509Certificate);
- SET_SELF_SIZE(X509Certificate);
+ SET_MEMORY_INFO_NAME(X509Certificate)
+ SET_SELF_SIZE(X509Certificate)
class X509CertificateTransferData : public worker::TransferData {
public:
diff --git a/src/node_blob.h b/src/node_blob.h
index 965f65390bdd41cb872f86b3d6f5faacb6af85af..9d6178996c8fd59c6b4f348072aa58ba9f9d925b 100644
--- a/src/node_blob.h
+++ b/src/node_blob.h
@@ -46,8 +46,8 @@ class Blob : public BaseObject {
}
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(Blob);
- SET_SELF_SIZE(Blob);
+ SET_MEMORY_INFO_NAME(Blob)
+ SET_SELF_SIZE(Blob)
// Copies the contents of the Blob into an ArrayBuffer.
v8::MaybeLocal<v8::Value> GetArrayBuffer(Environment* env);
diff --git a/src/node_sockaddr.h b/src/node_sockaddr.h
index 704fe0c5116f8f95884325b0b49c731009869112..8add38b465e324942801785f9fb94a81fc612547 100644
--- a/src/node_sockaddr.h
+++ b/src/node_sockaddr.h
@@ -173,8 +173,8 @@ class SocketAddressBase : public BaseObject {
}
void MemoryInfo(MemoryTracker* tracker) const override;
- SET_MEMORY_INFO_NAME(SocketAddressBase);
- SET_SELF_SIZE(SocketAddressBase);
+ SET_MEMORY_INFO_NAME(SocketAddressBase)
+ SET_SELF_SIZE(SocketAddressBase)
TransferMode GetTransferMode() const override {
return TransferMode::kCloneable;

View file

@ -1,38 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 2 Jun 2021 11:19:45 +0200
Subject: tls: tweak clientCertEngine argument parsing
This PR slightly tweaks the argument parsing within configSecureContext.
BoringSSL defines OPENSSL_NO_ENGINE and jasnell@35274cb changed behavior
so that if a bad clientCertEngine argument is passed,
ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED() will be thrown before
ERR_INVALID_ARG_TYPE.
Upstreamed at https://github.com/nodejs/node/pull/38900.
diff --git a/lib/internal/tls.js b/lib/internal/tls.js
index 0ebecb57c887798e2475b84b1783721806d4a7d1..40d511a25c5d4bcfb3802a692fa0059f7497b584 100644
--- a/lib/internal/tls.js
+++ b/lib/internal/tls.js
@@ -305,15 +305,15 @@ function configSecureContext(context, options = {}, name = 'options') {
}
}
- if (clientCertEngine !== undefined) {
+ if (typeof clientCertEngine === 'string') {
if (typeof context.setClientCertEngine !== 'function')
throw new ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED();
- if (typeof clientCertEngine !== 'string') {
- throw new ERR_INVALID_ARG_TYPE(`${name}.clientCertEngine`,
+ else
+ context.setClientCertEngine(clientCertEngine);
+ } else if (clientCertEngine !== undefined) {
+ throw new ERR_INVALID_ARG_TYPE(`${name}.clientCertEngine`,
['string', 'null', 'undefined'],
clientCertEngine);
- }
- context.setClientCertEngine(clientCertEngine);
}
if (ticketKeys !== undefined) {

View file

@ -178,8 +178,9 @@ int NodeMain(int argc, char* argv[]) {
if (flags_exit_code != 0) if (flags_exit_code != 0)
exit(flags_exit_code); exit(flags_exit_code);
node::InitializationSettingsFlags flags = node::kRunPlatformInit;
node::InitializationResult result = node::InitializationResult result =
node::InitializeOncePerProcess(argc, argv); node::InitializeOncePerProcess(argc, argv, flags);
if (result.early_return) if (result.early_return)
exit(result.exit_code); exit(result.exit_code);