diff --git a/.gitignore b/.gitignore index 3f9ed36..d8fc543 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/icu4c-67_1-src.tgz -SOURCES/node-v12.20.1-stripped.tar.gz +SOURCES/node-v12.22.5-stripped.tar.gz diff --git a/.nodejs.metadata b/.nodejs.metadata index 45b7698..c0867c1 100644 --- a/.nodejs.metadata +++ b/.nodejs.metadata @@ -1,2 +1,2 @@ 6822a4a94324d1ba591b3e8ef084e4491af253c1 SOURCES/icu4c-67_1-src.tgz -f9a9058bbd8557bc0ea564d22f4f0d1d6b7ed896 SOURCES/node-v12.20.1-stripped.tar.gz +bb98afb22215e659a77853964f7575da6b1535e3 SOURCES/node-v12.22.5-stripped.tar.gz diff --git a/SOURCES/0003-src-use-getauxval-in-node_main.cc.patch b/SOURCES/0003-src-use-getauxval-in-node_main.cc.patch new file mode 100644 index 0000000..2ecf682 --- /dev/null +++ b/SOURCES/0003-src-use-getauxval-in-node_main.cc.patch @@ -0,0 +1,70 @@ +From 63b2d16ea3985b62be372ea1da7987dc32ddcc3b Mon Sep 17 00:00:00 2001 +From: Daniel Bevenius +Date: Tue, 2 Jun 2020 05:33:25 +0200 +Subject: [PATCH 3/3] src: use getauxval in node_main.cc + +This commit suggests using getauxval in node_main.cc. + +The motivation for this is that getauxval was introduced in glibc 2.16 +and looking at BUILDING.md, in the 'Platform list' section, it looks +like we now support glibc >= 2.17 and perhaps this change would be +alright now. + +PR-URL: https://github.com/nodejs/node/pull/33693 +Refs: https://github.com/nodejs/node/pull/12548 +Reviewed-By: Ben Noordhuis +Reviewed-By: David Carlier +Reviewed-By: Anna Henningsen +Reviewed-By: Colin Ihrig +Reviewed-By: James M Snell +--- + src/node_main.cc | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/src/node_main.cc b/src/node_main.cc +index e92c0df94297e2ece43dbdf71166e555713ef6f2..70be5b83fafcde596e65086b08305aa89702fd52 100644 +--- a/src/node_main.cc ++++ b/src/node_main.cc +@@ -72,17 +72,11 @@ int wmain(int argc, wchar_t* wargv[]) { + return node::Start(argc, argv); + } + #else + // UNIX + #ifdef __linux__ +-#include +-#ifdef __LP64__ +-#define Elf_auxv_t Elf64_auxv_t +-#else +-#define Elf_auxv_t Elf32_auxv_t +-#endif // __LP64__ +-extern char** environ; ++#include + #endif // __linux__ + #if defined(__POSIX__) && defined(NODE_SHARED_MODE) + #include + #include + #endif +@@ -107,19 +101,11 @@ int main(int argc, char* argv[]) { + sigaction(SIGPIPE, &act, nullptr); + } + #endif + + #if defined(__linux__) +- char** envp = environ; +- while (*envp++ != nullptr) {} +- Elf_auxv_t* auxv = reinterpret_cast(envp); +- for (; auxv->a_type != AT_NULL; auxv++) { +- if (auxv->a_type == AT_SECURE) { +- node::per_process::linux_at_secure = auxv->a_un.a_val; +- break; +- } +- } ++ node::per_process::linux_at_secure = getauxval(AT_SECURE); + #endif + // Disable stdio buffering, it interacts poorly with printf() + // calls elsewhere in the program (e.g., any logging from V8.) + setvbuf(stdout, nullptr, _IONBF, 0); + setvbuf(stderr, nullptr, _IONBF, 0); +-- +2.30.1 + diff --git a/SOURCES/0004-CVE-2020-7774-nodejs-y18n-prototype-pollution-vulnerability.patch b/SOURCES/0004-CVE-2020-7774-nodejs-y18n-prototype-pollution-vulnerability.patch deleted file mode 100644 index 88a9d75..0000000 --- a/SOURCES/0004-CVE-2020-7774-nodejs-y18n-prototype-pollution-vulnerability.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/deps/npm/node_modules/y18n/index.js b/deps/npm/node_modules/y18n/index.js -index d720681628..727362aac0 100644 ---- a/deps/npm/node_modules/y18n/index.js -+++ b/deps/npm/node_modules/y18n/index.js -@@ -11,7 +11,7 @@ function Y18N (opts) { - this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true - - // internal stuff. -- this.cache = {} -+ this.cache = Object.create(null) - this.writeQueue = [] - } - diff --git a/SOURCES/0004-always-available-fips-options.patch b/SOURCES/0004-always-available-fips-options.patch new file mode 100644 index 0000000..fb90f8f --- /dev/null +++ b/SOURCES/0004-always-available-fips-options.patch @@ -0,0 +1,622 @@ +From 7bc4111b770ada25cdd6e1b938ca7a914617ea53 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 25 Aug 2020 14:04:54 +0200 +Subject: [PATCH] crypto: make FIPS related options always awailable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There is no reason to hide FIPS functionality behind build flags. +OpenSSL always provide the information about FIPS availability via +`FIPS_mode()` function. + +This makes the user experience more consistent, because the OpenSSL +library is always queried and the `crypto.getFips()` always returns +OpenSSL settings. + +Fixes #34903 + +PR-URL: https://github.com/nodejs/node/pull/36341 +Reviewed-By: Anna Henningsen +Reviewed-By: Michael Dawson +Reviewed-By: Daniel Bevenius +Signed-off-by: Jan Staněk +--- + doc/api/cli.md | 8 +-- + lib/crypto.js | 22 ++---- + node.gypi | 3 - + src/node.cc | 6 +- + src/node_config.cc | 2 - + src/node_crypto.cc | 45 +++++++----- + src/node_options.cc | 2 - + src/node_options.h | 2 - + test/parallel/test-cli-node-print-help.js | 7 +- + test/parallel/test-crypto-fips.js | 71 +++++++++---------- + ...rocess-env-allowed-flags-are-documented.js | 11 +-- + 11 files changed, 74 insertions(+), 105 deletions(-) + +diff --git a/doc/api/cli.md b/doc/api/cli.md +index 86635f267b..6f14fa6810 100644 +--- a/doc/api/cli.md ++++ b/doc/api/cli.md +@@ -183,8 +183,8 @@ code from strings throw an exception instead. This does not affect the Node.js + added: v6.0.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` +