Browse Source

chore: bump node to v12.9.0 (master) (#19863)

Co-authored-by: Shelley Vohr <[email protected]>
Electron Bot 5 years ago
parent
commit
6667969887

+ 1 - 1
DEPS

@@ -12,7 +12,7 @@ vars = {
   'chromium_version':
     '956a430350ccbeb16cf544f79c1990f1eae4d4fe',
   'node_version':
-    'v12.8.1',
+    'v12.9.0',
   'nan_version':
     '2ee313aaca52e2b478965ac50eb5082520380d1b',
 

+ 1 - 0
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

+ 29 - 0
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 <[email protected]>
+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)

+ 4 - 3
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

+ 4 - 4
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);

+ 6 - 7
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 <[email protected]>
-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;

+ 3 - 3
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;

+ 5 - 0
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",