From f38a39b3270feda74314574b2e5d518434e796dc Mon Sep 17 00:00:00 2001 From: Tom_zc <353712216@qq.com> Date: Sat, 11 Mar 2023 23:20:51 +0800 Subject: [PATCH] nodejs v16 support openssl 3.0.8 --- 0004-Support-openssl3.patch | 168 ++++++++++++++++++++++++++++++++++++ nodejs.spec | 6 +- 2 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 0004-Support-openssl3.patch diff --git a/0004-Support-openssl3.patch b/0004-Support-openssl3.patch new file mode 100644 index 0000000..12dd0f9 --- /dev/null +++ b/0004-Support-openssl3.patch @@ -0,0 +1,168 @@ +From 219e4f9e635a3cba0650f9f985b645c67f83d332 Mon Sep 17 00:00:00 2001 +From: Daniel Bevenius +Date: Sat, 16 Oct 2021 08:50:16 +0200 +Subject: [PATCH] src: add --openssl-legacy-provider option +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This commit adds an option to Node.js named --openssl-legacy-provider +and if specified will load OpenSSL 3.0 Legacy provider when dynamically +linking Node.js v16.x with OpenSSL 3.0. + +Building: +$ ./configure --shared-openssl \ + --shared-openssl-libpath=/path/openssl_quic-3.0/lib64 \ + --shared-openssl-includes=/path/openssl_quic-3.0/include \ + --shared-openssl-libname=crypto,ssl +$ make -j8 + +Verify options is available: +$ ./node --help +... +--openssl-legacy-provider enable OpenSSL 3.0 legacy provider + +Usage: +$ export LD_LIBRARY_PATH=/path/openssl_quic-3.0/lib64 +$ export OPENSSL_MODULES=/path/openssl_quic-3.0/lib64/ossl-modules/ +$ export OPENSSL_CONF=/path/openssl_quic-3.0/ssl/openssl.cnf +$ ./node --openssl-legacy-provider -p 'crypto.createHash("md4")' +Hash { + _options: undefined, + [Symbol(kHandle)]: Hash {}, + [Symbol(kState)]: { [Symbol(kFinalized)]: false } +} + +Fixes: https://github.com/nodejs/node/issues/40948 + +Refs: https://github.com/nodejs/node/issues/40455 +PR-URL: https://github.com/nodejs/node/pull/40478 +Reviewed-By: Richard Lau +Reviewed-By: Tobias Nießen +--- + doc/api/cli.md | 11 +++++++++++ + src/crypto/crypto_util.cc | 10 ++++++++++ + src/node_options.cc | 3 +++ + src/node_options.h | 7 +++++++ + .../test-process-env-allowed-flags-are-documented.js | 5 +++++ + 5 files changed, 36 insertions(+) + +diff --git a/doc/api/cli.md b/doc/api/cli.md +index 475894d7c0e4..380a220b7cf8 100644 +--- a/doc/api/cli.md ++++ b/doc/api/cli.md +@@ -732,6 +732,15 @@ Load an OpenSSL configuration file on startup. Among other uses, this can be + used to enable FIPS-compliant crypto if Node.js is built + against FIPS-enabled OpenSSL. + ++### `--openssl-legacy-provider` ++ ++ ++ ++Enable OpenSSL 3.0 legacy provider when dynamically linking to OpenSSL 3.x. ++For more information please see [OSSL\_PROVIDER-legacy][OSSL_PROVIDER-legacy]. ++ + ### `--pending-deprecation` + +