From 2509f6974c9f809d489cba267c65fd37f5a70239 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 28 2021 07:40:24 +0000 Subject: import rh-nodejs12-nodejs-12.22.2-1.el7 --- diff --git a/.gitignore b/.gitignore index 1b30db8..08162fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/node-ssl-shim-6fc0b05.tar.gz -SOURCES/node-v12.21.0-stripped.tar.gz +SOURCES/node-ssl-shim-70e39fd.tar.gz +SOURCES/node-v12.22.2-stripped.tar.gz diff --git a/.rh-nodejs12-nodejs.metadata b/.rh-nodejs12-nodejs.metadata index 7fd6bad..6a195dd 100644 --- a/.rh-nodejs12-nodejs.metadata +++ b/.rh-nodejs12-nodejs.metadata @@ -1,2 +1,2 @@ -9fe6761bd237af8be0e4d26184c5a01e01d7967d SOURCES/node-ssl-shim-6fc0b05.tar.gz -d1a2ba595dc378234691c4c6ce70c8e0ffe1b779 SOURCES/node-v12.21.0-stripped.tar.gz +a49b02166a7bdba54fb45cba26a18fa48928ca0e SOURCES/node-ssl-shim-70e39fd.tar.gz +b8b3a8cee7a4fa4f99818c8a1eb86a9ba474b839 SOURCES/node-v12.22.2-stripped.tar.gz diff --git a/SOURCES/0001-Link-with-ssl-shim.patch b/SOURCES/0001-Link-with-ssl-shim.patch index bf0d6fc..a5d74e2 100644 --- a/SOURCES/0001-Link-with-ssl-shim.patch +++ b/SOURCES/0001-Link-with-ssl-shim.patch @@ -1,4 +1,4 @@ -From f2b5ee60b7e1f01a6678ee3172c6fa59c6ce8da1 Mon Sep 17 00:00:00 2001 +From 2b3df37eb2e1dfe324b935332b958b45a89ec9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Tue, 28 Apr 2020 11:15:24 +0200 Subject: [PATCH] Link with ssl-shim @@ -35,7 +35,7 @@ index 116c1c7149..0e40a2b441 100644 }], diff --git a/src/node_crypto.cc b/src/node_crypto.cc -index db2e122ab0..90df5f25e0 100644 +index 764dcb8720..e472892b68 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1135,7 +1135,7 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo& args) { @@ -48,7 +48,7 @@ index db2e122ab0..90df5f25e0 100644 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); Environment* env = sc->env(); diff --git a/src/node_crypto.h b/src/node_crypto.h -index 38fd806e62..0b9dab833d 100644 +index 573d59ddf4..7bce7706a9 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -41,6 +41,8 @@ @@ -61,5 +61,5 @@ index 38fd806e62..0b9dab833d 100644 namespace crypto { -- -2.28.0 +2.31.1 diff --git a/SOURCES/0002-Use-OpenSSL-1.0-API.patch b/SOURCES/0002-Use-OpenSSL-1.0-API.patch index d672569..cb2a128 100644 --- a/SOURCES/0002-Use-OpenSSL-1.0-API.patch +++ b/SOURCES/0002-Use-OpenSSL-1.0-API.patch @@ -1,6 +1,6 @@ -From ae4f772872661d6435c27e50937a0c3cbcede43c Mon Sep 17 00:00:00 2001 +From 6d27ddf97c68d2e80925dc25b790d598170b7a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= -Date: Mon, 23 Nov 2020 11:56:26 +0100 +Date: Thu, 8 Jul 2021 14:08:31 +0200 Subject: [PATCH] Use OpenSSL 1.0 API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -27,16 +27,25 @@ Content-Transfer-Encoding: 8bit - Sanitize inputs into PBKDF2 +- Setup ECDHE curve negotiation + + - SSL_OP_SINGLE_ECDH_USE is no-op and default in OpenSSL 1.1, + but should be specified in OpenSSL 1.0 + - SSL_CTX_set_ecdh_auto() is presumably the same case; + does not even exist in OpenSSL 1.1 + + Without this setup, ECDHE curve negotiation is broken: rhbz#1910749 + Signed-off-by: Jan Staněk --- - src/node_crypto.cc | 26 ++++++++++++++++++++++++-- + src/node_crypto.cc | 30 ++++++++++++++++++++++++++++-- src/node_crypto.h | 4 ++++ src/node_crypto_bio.cc | 4 ++++ src/node_crypto_common.cc | 8 ++++++++ - 4 files changed, 40 insertions(+), 2 deletions(-) + 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc -index 90df5f25e0..7be3f77e1a 100644 +index e472892b68..0cc97f99ea 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -123,7 +123,11 @@ template int SSLWrap::SetCACerts(SecureContext* sc); @@ -51,7 +60,18 @@ index 90df5f25e0..7be3f77e1a 100644 int len, int* copy); template int SSLWrap::NewSessionCallback(SSL* s, -@@ -1746,7 +1750,11 @@ void SSLWrap::ConfigureSecureContext(SecureContext* sc) { +@@ -1189,6 +1193,10 @@ void SecureContext::SetECDHCurve(const FunctionCallbackInfo& args) { + THROW_AND_RETURN_IF_NOT_STRING(env, args[0], "ECDH curve name"); + + node::Utf8Value curve(env->isolate(), args[0]); ++#if OPENSSL_IS_LEGACY ++ SSL_CTX_set_options(sc->ctx_.get(), SSL_OP_SINGLE_ECDH_USE); ++ SSL_CTX_set_ecdh_auto(sc->ctx_.get(), 1); ++#endif + + if (strcmp(*curve, "auto") == 0) + return; +@@ -1746,7 +1754,11 @@ void SSLWrap::ConfigureSecureContext(SecureContext* sc) { template SSL_SESSION* SSLWrap::GetSessionCallback(SSL* s, @@ -63,7 +83,7 @@ index 90df5f25e0..7be3f77e1a 100644 int len, int* copy) { Base* w = static_cast(SSL_get_app_data(s)); -@@ -5917,9 +5925,23 @@ struct PBKDF2Job : public CryptoJob { +@@ -5921,9 +5933,23 @@ struct PBKDF2Job : public CryptoJob { } inline void DoThreadPoolWork() override { @@ -90,7 +110,7 @@ index 90df5f25e0..7be3f77e1a 100644 success = Just(ok); Cleanse(); diff --git a/src/node_crypto.h b/src/node_crypto.h -index 0b9dab833d..7d6417b66f 100644 +index 7bce7706a9..780e1893f4 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -234,7 +234,11 @@ class SSLWrap { @@ -141,5 +161,5 @@ index 6c3bb0b1b6..d1d9edd6cd 100644 MaybeLocal GetCipherName(Environment* env, const SSL_CIPHER* cipher) { return GetCipherValue(env, cipher, SSL_CIPHER_get_name); -- -2.28.0 +2.31.1 diff --git a/SOURCES/0003-Backport-necessary-OpenSSL-features.patch b/SOURCES/0003-Backport-necessary-OpenSSL-features.patch index dcff61a..244871e 100644 --- a/SOURCES/0003-Backport-necessary-OpenSSL-features.patch +++ b/SOURCES/0003-Backport-necessary-OpenSSL-features.patch @@ -1,6 +1,6 @@ -From 7dc5dae056d1b77a748ebfb8a3e312b4306789b4 Mon Sep 17 00:00:00 2001 +From aef9bc657e0da83f5b540d8aeea100d0784aab4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= -Date: Mon, 23 Nov 2020 11:57:01 +0100 +Date: Thu, 8 Jul 2021 14:09:22 +0200 Subject: [PATCH] Backport necessary OpenSSL features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -43,7 +43,7 @@ Signed-off-by: Jan Staněk 2 files changed, 180 insertions(+), 8 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc -index 7be3f77e1a..c2b5aaa1a1 100644 +index 0cc97f99ea..65912d7db4 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -518,6 +518,11 @@ inline void SecureContext::Reset() { @@ -131,7 +131,7 @@ index 7be3f77e1a..c2b5aaa1a1 100644 // OpenSSL 1.1.0 changed the ticket key size, but the OpenSSL 1.0.x size was // exposed in the public API. To retain compatibility, install a callback -@@ -1244,6 +1262,65 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { +@@ -1248,6 +1266,65 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { return env->ThrowTypeError("Error setting temp DH parameter"); } @@ -197,7 +197,7 @@ index 7be3f77e1a..c2b5aaa1a1 100644 void SecureContext::SetMinProto(const FunctionCallbackInfo& args) { SecureContext* sc; -@@ -1254,7 +1331,12 @@ void SecureContext::SetMinProto(const FunctionCallbackInfo& args) { +@@ -1258,7 +1335,12 @@ void SecureContext::SetMinProto(const FunctionCallbackInfo& args) { int version = args[0].As()->Value(); @@ -210,7 +210,7 @@ index 7be3f77e1a..c2b5aaa1a1 100644 } -@@ -1267,7 +1349,12 @@ void SecureContext::SetMaxProto(const FunctionCallbackInfo& args) { +@@ -1271,7 +1353,12 @@ void SecureContext::SetMaxProto(const FunctionCallbackInfo& args) { int version = args[0].As()->Value(); @@ -223,7 +223,7 @@ index 7be3f77e1a..c2b5aaa1a1 100644 } -@@ -1278,7 +1365,11 @@ void SecureContext::GetMinProto(const FunctionCallbackInfo& args) { +@@ -1282,7 +1369,11 @@ void SecureContext::GetMinProto(const FunctionCallbackInfo& args) { CHECK_EQ(args.Length(), 0); long version = // NOLINT(runtime/int) @@ -235,7 +235,7 @@ index 7be3f77e1a..c2b5aaa1a1 100644 args.GetReturnValue().Set(static_cast(version)); } -@@ -1290,11 +1381,14 @@ void SecureContext::GetMaxProto(const FunctionCallbackInfo& args) { +@@ -1294,11 +1385,14 @@ void SecureContext::GetMaxProto(const FunctionCallbackInfo& args) { CHECK_EQ(args.Length(), 0); long version = // NOLINT(runtime/int) @@ -251,7 +251,7 @@ index 7be3f77e1a..c2b5aaa1a1 100644 void SecureContext::SetOptions(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); -@@ -6892,8 +6986,72 @@ void TimingSafeEqual(const FunctionCallbackInfo& args) { +@@ -6900,8 +6994,72 @@ void TimingSafeEqual(const FunctionCallbackInfo& args) { CRYPTO_memcmp(buf1.data(), buf2.data(), buf1.length()) == 0); } @@ -326,7 +326,7 @@ index 7be3f77e1a..c2b5aaa1a1 100644 // --openssl-config=... diff --git a/src/node_crypto.h b/src/node_crypto.h -index 7d6417b66f..746a2a3fc7 100644 +index 780e1893f4..2787e257ad 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -182,6 +182,20 @@ class SecureContext final : public BaseObject { @@ -351,5 +351,5 @@ index 7d6417b66f..746a2a3fc7 100644 // SSLWrap implicitly depends on the inheriting class' handle having an -- -2.28.0 +2.31.1 diff --git a/SOURCES/0004-Disable-unsupported-OpenSSL-features.patch b/SOURCES/0004-Disable-unsupported-OpenSSL-features.patch index 67a2a97..89ddb90 100644 --- a/SOURCES/0004-Disable-unsupported-OpenSSL-features.patch +++ b/SOURCES/0004-Disable-unsupported-OpenSSL-features.patch @@ -1,6 +1,6 @@ -From 77cbd12e600a599351ec3b0b0302c7fcd1f9ec0b Mon Sep 17 00:00:00 2001 +From 64d17e7087842f367a931fb5694ef9a2c6af6a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= -Date: Mon, 23 Nov 2020 11:57:32 +0100 +Date: Thu, 8 Jul 2021 14:10:02 +0200 Subject: [PATCH] Disable unsupported OpenSSL features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -41,10 +41,10 @@ Signed-off-by: Jan Staněk rename test/{parallel => known_issues}/test-tls-cli-min-version-1.3.js (100%) diff --git a/doc/api/cli.md b/doc/api/cli.md -index e6d49feef6..47976c670b 100644 +index 86635f267b..6a1cad9b74 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md -@@ -810,14 +810,6 @@ added: v12.0.0 +@@ -816,14 +816,6 @@ added: v12.0.0 Set [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.2'. Use to disable support for TLSv1.3. @@ -59,7 +59,7 @@ index e6d49feef6..47976c670b 100644 ### `--tls-min-v1.0` + +-Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with +-`./configure --openssl-fips`.) ++Enable FIPS-compliant crypto at startup. (Requires Node.js to be built ++against FIPS-compatible OpenSSL.) + + ### `--enable-source-maps` + + + Load an OpenSSL configuration file on startup. Among other uses, this can be +-used to enable FIPS-compliant crypto if Node.js is built with +-`./configure --openssl-fips`. ++used to enable FIPS-compliant crypto if Node.js is built ++against FIPS-enabled OpenSSL. + + ### `--pending-deprecation` +