From 6667969887cbace3ff091e2ad0bc4c73da325a0f Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 22 Aug 2019 17:12:11 -0400 Subject: [PATCH] chore: bump node to v12.9.0 (master) (#19863) Co-authored-by: Shelley Vohr --- DEPS | 2 +- patches/node/.patches | 1 + ...s_boringssl_guard_to_oaep_hash_check.patch | 29 +++++++++++++++++++ patches/node/build_add_gn_build_files.patch | 7 +++-- ..._apis_are_not_available_in_boringssl.patch | 8 ++--- ...efined_version_of_internalmodulestat.patch | 13 ++++----- ...dder_overriding_of_internal_fs_calls.patch | 6 ++-- script/node-disabled-tests.json | 5 ++++ 8 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 patches/node/add_openssl_is_boringssl_guard_to_oaep_hash_check.patch diff --git a/DEPS b/DEPS index 5f1af076f748..d4790cfedb9c 100644 --- a/DEPS +++ b/DEPS @@ -12,7 +12,7 @@ vars = { 'chromium_version': '956a430350ccbeb16cf544f79c1990f1eae4d4fe', 'node_version': - 'v12.8.1', + 'v12.9.0', 'nan_version': '2ee313aaca52e2b478965ac50eb5082520380d1b', diff --git a/patches/node/.patches b/patches/node/.patches index 34c5fde38767..7d119718f66f 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -38,3 +38,4 @@ chore_read_nobrowserglobals_from_global_not_process.patch chore_split_createenvironment_into_createenvironment_and.patch chore_handle_default_configuration_not_being_set_in_the_electron_env.patch revert_crypto_add_outputlength_option_to_crypto_createhash.patch +add_openssl_is_boringssl_guard_to_oaep_hash_check.patch diff --git a/patches/node/add_openssl_is_boringssl_guard_to_oaep_hash_check.patch b/patches/node/add_openssl_is_boringssl_guard_to_oaep_hash_check.patch new file mode 100644 index 000000000000..a7c9e2ff2e70 --- /dev/null +++ b/patches/node/add_openssl_is_boringssl_guard_to_oaep_hash_check.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Wed, 21 Aug 2019 12:43:26 -0700 +Subject: Add OPENSSL_IS_BORINGSSL guard to oaep_hash check + +Adds an ifndef guard to the oaep_hash nullptr check in +PublicKeyCipher::Cipher, since BORINGSSL does not expose either +EVP_PKEY_OP_TYPE_CRYPT or EVP_PKEY_CTRL_RSA_OAEP_MD. + +diff --git a/src/node_crypto.cc b/src/node_crypto.cc +index 59b60f1aea11666a7393831f8a465c247b66b009..1b44572c3a126c1ba3f610dbefb226acb34d246d 100644 +--- a/src/node_crypto.cc ++++ b/src/node_crypto.cc +@@ -5156,11 +5156,15 @@ bool PublicKeyCipher::Cipher(Environment* env, + if (EVP_PKEY_CTX_set_rsa_padding(ctx.get(), padding) <= 0) + return false; + ++#ifdef OPENSSL_IS_BORINGSSL ++ env->ThrowError("oaepHash option not supported in BoringSSL."); ++#else + if (oaep_hash != nullptr) { + if (!EVP_PKEY_CTX_md(ctx.get(), EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_RSA_OAEP_MD, oaep_hash)) + return false; + } ++#endif + + size_t out_len = 0; + if (EVP_PKEY_cipher(ctx.get(), nullptr, &out_len, data, len) <= 0) diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 8a6bef5cd548..2632a9569806 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -1673,10 +1673,11 @@ index 0189dd762919162c8a897d291bdda3cfd600eab6..7b3e90af88b873c32f8ed51712f7dfdf split = ['internal'] + split else: # `lib/**/*.js` so drop the 'lib' part split = split[1:] -+ - filename = '/'.join(split) ++ + if len(split): + filename = '/'.join(split) - return os.path.splitext(filename)[0] -+ ++ + # Electron-specific: when driving the node build from Electron, we generate + # config.gypi in a separate directory and pass the absolute path to js2c. + # This overrides the absolute path so that the variable names in the diff --git a/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch b/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch index c70f92ca4a36..e7a0c299438a 100644 --- a/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch +++ b/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch @@ -39,7 +39,7 @@ index bca482cc9724fef680196a192a6bbd7b4d2e4fde..1cc2372fe2e385e9a9db27e38f0da61d break; case EVP_PKEY_EC: + // FIXME(zcbenz): This is not available in BoringSSL. -+#if 0 ++#ifndef OPENSSL_IS_BORINGSSL case EVP_PKEY_X25519: case EVP_PKEY_X448: +#endif @@ -51,7 +51,7 @@ index bca482cc9724fef680196a192a6bbd7b4d2e4fde..1cc2372fe2e385e9a9db27e38f0da61d case EVP_PKEY_ED25519: return env()->crypto_ed25519_string(); + // FIXME(zcbenz): This is not available in BoringSSL. -+#if 0 ++#ifndef OPENSSL_IS_BORINGSSL case EVP_PKEY_ED448: return env()->crypto_ed448_string(); case EVP_PKEY_X25519: @@ -67,7 +67,7 @@ index bca482cc9724fef680196a192a6bbd7b4d2e4fde..1cc2372fe2e385e9a9db27e38f0da61d return nullptr; + // FIXME(zcbenz): This is not available in BoringSSL. -+#if 0 ++#ifndef OPENSSL_IS_BORINGSSL if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0) return nullptr; @@ -85,7 +85,7 @@ index bca482cc9724fef680196a192a6bbd7b4d2e4fde..1cc2372fe2e385e9a9db27e38f0da61d env->SetMethod(target, "generateKeyPairNid", GenerateKeyPairNid); NODE_DEFINE_CONSTANT(target, EVP_PKEY_ED25519); + // FIXME(zcbenz): This is not available in BoringSSL. -+#if 0 ++#ifndef OPENSSL_IS_BORINGSSL NODE_DEFINE_CONSTANT(target, EVP_PKEY_ED448); NODE_DEFINE_CONSTANT(target, EVP_PKEY_X25519); NODE_DEFINE_CONSTANT(target, EVP_PKEY_X448); diff --git a/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch b/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch index d88e462aa056..60bb81f87958 100644 --- a/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch +++ b/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch @@ -1,21 +1,20 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Shelley Vohr -Date: Thu, 13 Sep 2018 09:10:02 -0700 +Date: Wed, 21 Aug 2019 11:06:16 -0700 Subject: FIXME: use redefined version of internalModuleStat Instantiate redefined version of the internalModuleStat function (see lib/common/asar.js in the electron/electron repo). For some reason -this has to be done after the upgrade to the Node.js v8.7.0. `const -internalModuleStat` in the very beginning of the file holds a reference +this has to be done after the upgrade to the Node.js v8.7.0. in the very beginning of the file holds a reference to a native Node.js implementation of the function. diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 70da676a40feeaa82d3a0ccd1c17882ab5d6edf3..ffc7fb6fd5857b807198d4d26b7b899e63cde4a1 100644 +index 437546e38ad30c518dce45f2f9ab104bdffbbe38..adb6dffa8f89035078c6e5b8a975c4874a5b0eb8 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -93,6 +93,8 @@ const relativeResolveCache = Object.create(null); - let requireDepth = 0; - let statCache = null; +@@ -117,6 +117,8 @@ function enrichCJSError(err) { + } + function stat(filename) { + // FIXME(codebytere): determine why this needs to be done and remove + const internalModuleStat = process.binding('fs').internalModuleStat; diff --git a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch index 755dc804b923..4c96d6b40a88 100644 --- a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch +++ b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch @@ -35,9 +35,9 @@ index ffc7fb6fd5857b807198d4d26b7b899e63cde4a1..2a7ffbff213f23536b94664c3ecffa18 const { safeGetenv } = internalBinding('credentials'); const { makeRequireFunction, -@@ -93,14 +90,12 @@ const relativeResolveCache = Object.create(null); - let requireDepth = 0; - let statCache = null; +@@ -117,14 +117,12 @@ const relativeResolveCache = Object.create(null); + } + function stat(filename) { - // FIXME(codebytere): determine why this needs to be done and remove - const internalModuleStat = process.binding('fs').internalModuleStat; diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 9a978974a1ca..7c38d497bc2e 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -138,7 +138,9 @@ "parallel/test-tls-set-ciphers-error", "parallel/test-tls-set-ciphers", "parallel/test-tls-socket-failed-handshake-emits-error", + "parallel/test-tls-socket-allow-half-open-option", "parallel/test-tls-ticket", + "parallel/test-tls-write-error", "parallel/test-trace-events-api-worker-disabled", "parallel/test-tls-ticket-cluster", "parallel/test-trace-events-dynamic-enable", @@ -248,6 +250,8 @@ "es-module/test-esm-json-cache", "es-module/test-esm-snapshot", "es-module/test-esm-no-extension", + "es-module/test-esm-scope-node-modules", + "es-module/test-esm-cjs-load-error-note", "report/test-report-config", "report/test-report-getreport", "report/test-report-signal", @@ -309,6 +313,7 @@ "message/events_unhandled_error_common_trace", "message/events_unhandled_error_nexttick", "message/events_unhandled_error_sameline", + "message/events_unhandled_error_subclass", "message/if-error-has-good-stack", "message/internal_assert", "message/internal_assert_fail",