Skip to content

Commit

Permalink
chore: bump node to v12.9.0 (master) (#19863)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
electron-bot and codebytere committed Aug 22, 2019
1 parent 12b00ca commit 6667969
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vars = {
'chromium_version':
'956a430350ccbeb16cf544f79c1990f1eae4d4fe',
'node_version':
'v12.8.1',
'v12.9.0',
'nan_version':
'2ee313aaca52e2b478965ac50eb5082520380d1b',

Expand Down
1 change: 1 addition & 0 deletions patches/node/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
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)
7 changes: 4 additions & 3 deletions patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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;

Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions script/node-disabled-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 6667969

Please sign in to comment.