Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v16.3.0 proposal #38874

Merged
merged 74 commits into from
Jun 3, 2021
Merged
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
929e8df
test: improve coverage of stream.Readable
pd4d10 May 16, 2021
2268d1c
lib: refactor to reuse validators
pd4d10 May 16, 2021
a98d631
bootstrap: include vm and contextify binding into the snapshot
joyeecheung May 13, 2021
5553be3
doc: update code examples for `node:url` module
fisker May 12, 2021
a47fd67
src: replace `auto`s in node_contextify.cc
XadillaX May 12, 2021
6da4aa3
test: give js-native-api tests consistent names
gabrielschulhof May 14, 2021
496f7ea
node-api: fix shutdown crashes
mhdawson Apr 30, 2021
4131f94
stream: allow empty string as source of pipeline
Ayase-252 May 18, 2021
96fa387
doc: document null target pattern
guybedford May 18, 2021
f5dd85b
src: remove more extra semis from member fns
codebytere May 20, 2021
15aaf14
deps: update llhttp to 6.0.2
indutny May 13, 2021
ba96f14
src: remove unused `iostream` library
juanarbol May 15, 2021
61c95f0
src: write named pipe info in diagnostic report
legendecas May 11, 2021
e8192b5
deps: upgrade npm to 7.14.0
ruyadorno May 20, 2021
c576311
src: remove commented code in `node_file.cc`
juanarbol May 15, 2021
2054efa
events: refactor to use primordials in lib/events
marsonya Apr 16, 2021
4e33532
src: use HandleScope in StreamReq::Done()
RaisinTen May 17, 2021
7fb809b
typings: add JSDoc typings for events
VoltrexKeyva May 17, 2021
11ac9c6
test: improve coverage of lib/_http_outgoing.js
pd4d10 May 19, 2021
695e982
test: improve coverage of lib/fs.js
pd4d10 May 8, 2021
e9be209
build: replace non-POSIX test -a|o
concatime May 19, 2021
7773d58
url: exit early when : delimiter is seen in hostname
TimothyGu May 20, 2021
7a9d0fd
benchmark: fix http elapsed time
aduh95 May 20, 2021
717a8b6
child_process: retain reference to data with advanced serialization
addaleax May 18, 2021
3741595
src: set CONF_MFLAGS_DEFAULT_SECTION for OpenSSL 3
danbev May 18, 2021
18f3ba3
worker: leave TODO comments for using std::variant when possible
addaleax May 23, 2021
c7a5857
test: set locale for datetime-change-notify test
Lxxyx May 20, 2021
9ca5c0e
src: fix compiler warnings in node_buffer.cc
RaisinTen May 18, 2021
30c0020
typings: add JSDoc typings for https
VoltrexKeyva May 8, 2021
80c32b7
build: allow LTO with Clang 3.9.1+
jesec May 21, 2021
bc84001
cli: add -C alias for --conditions flag
guybedford May 21, 2021
3e6b3b2
src: use SPrintF in ProcessEmitWarning
RaisinTen May 21, 2021
a2da9e2
worker: use rwlock for sibling group
addaleax May 23, 2021
e2f28c8
doc: fixup code sample in http.md
todortotev May 22, 2021
9054d25
stream: add a non-destroying iterator to Readable
Linkgoron Apr 17, 2021
6d86f8a
test: os, replace custom flatten method with built-in Array.flat
waelsy123 May 22, 2021
4e58ec4
benchmark: output JSON-compatible numbers
targos May 23, 2021
1f5baaa
test: improve coverage for `question` in readline
Ayase-252 May 24, 2021
ab44106
tools: use PrintCaughtException in the snapshot builder
joyeecheung May 20, 2021
4e11971
doc: fix grammar in `fs.md`
yotamselementor May 26, 2021
0c063a1
doc,url: clarify domainTo* when built without ICU
RaisinTen May 23, 2021
36d4a43
src: remove redundant v8 namespaces in `env.cc`
juanarbol May 24, 2021
21ce3af
tools: update ESLint to 7.27.0
lpinca May 22, 2021
a1b0e64
src: support fs_event_wrap binding in the snapshot
joyeecheung May 19, 2021
5d9442a
lib: load internal/fs/watchers and internal/fs/read_file_context early
joyeecheung May 19, 2021
7d3a8cb
lib: remove unnecessary lazy loads
joyeecheung May 19, 2021
e91d14c
test: simplify test-path-resolve.js
himself65 May 13, 2021
24cca7c
build: add lto build to CI
gengjiawen May 6, 2021
3c492ba
test: fix writefile with fd
Linkgoron May 26, 2021
ee1056d
debugger: wait for V8 debugger to be enabled
targos May 26, 2021
c0bde0c
tools: update setup-node to setup-node@v2
JayFate May 27, 2021
f1e823b
doc: use "Long Term Support" in README
phershbe May 29, 2021
4844337
doc: use "Long Term Support" in technical values doc
Trott May 29, 2021
131a691
doc: use "Long Term Support" in collaborator guide
Trott May 29, 2021
6986154
build: work around bug in MSBuild v16.10.0
targos May 31, 2021
be8d934
tools: remove exception for Node.js 8 and earlier
Trott May 29, 2021
6b8c712
tools: bump cpplint to 1.5.5
Trott May 30, 2021
36ffd58
tools: refloat 7 Node.js patches to cpplint.py
Trott Oct 9, 2020
f1000e0
debugger: removed unused function argument
Trott May 30, 2021
108ffdb
doc: fixed typo in n-api.md
julianjany May 27, 2021
f25cd4f
src: fix typos
bl-ue May 29, 2021
08ad2f6
lib: fix typos
bl-ue May 31, 2021
120849f
src: cache necessary isolate & context in api/*
XadillaX Apr 23, 2021
74205b3
src: replace `auto`s in node_api.cc
XadillaX May 30, 2021
e119531
os: add os.devNull
lpinca May 6, 2021
48ebebd
test: remove unnecessary `--pending-deprecation` flag
aduh95 May 23, 2021
47ad448
deps: upgrade npm to 7.15.1
npm-robot May 31, 2021
eb7c932
debugger: revise async iterator usage to comply with lint rules
Trott May 29, 2021
4884991
lib: include url in bootstrap snapshot and remove unnecessary lazy-loads
joyeecheung May 19, 2021
0aa3cb5
test: improve coverage of fs internal utils
pd4d10 May 20, 2021
f162896
build: remove outdated dont-land-on-v6.x label
targos Jun 1, 2021
7ba3055
src: set PromiseHooks by Environment
bengl May 26, 2021
e65a25c
2021-06-02, Version 16.3.0 (Current)
danielleadams May 31, 2021
84c3990
Working on v16.3.1
danielleadams Jun 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
src: set CONF_MFLAGS_DEFAULT_SECTION for OpenSSL 3
This commit adds a call to OPENSSL_init_crypto to initialize
OPENSSL_INIT_LOAD_CONFIG to avoid the default behavior where errors
raised during the parsing of the OpenSSL configuration file are not
propagated and cannot be detected.

The motivation for this is that if FIPS is configured the OpenSSL
configuration file will have an .include pointing to the fipsmodule.cnf
file generated by the openssl fipsinstall command. If the path to this
file is incorrect no error will be reported. For Node.js this will mean
that EntropySource will be called by V8 as part of its initalization
process, and EntropySource will in turn call CheckEntropy. CheckEntropy
will call RAND_status which will now always return 0 leading to an
endless loop and the node process will appear to hang/freeze.

I'll continue investigating the cause of this and see if this is
expected behavior or not, but in the mean time it would be good to be
able to workaround this issue with this commit.

PR-URL: #38732
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Refs: #38633 (review)
danbev authored and danielleadams committed May 31, 2021
commit 3741595289902952b16a17defbce917366c6823f
2 changes: 2 additions & 0 deletions src/crypto/crypto_util.cc
Original file line number Diff line number Diff line change
@@ -109,11 +109,13 @@ void InitCryptoOnce() {
#ifndef OPENSSL_IS_BORINGSSL
OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new();

#if OPENSSL_VERSION_MAJOR < 3
// --openssl-config=...
if (!per_process::cli_options->openssl_config.empty()) {
const char* conf = per_process::cli_options->openssl_config.c_str();
OPENSSL_INIT_set_config_filename(settings, conf);
}
#endif

OPENSSL_init_ssl(0, settings);
OPENSSL_INIT_free(settings);
38 changes: 36 additions & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
@@ -1024,12 +1024,46 @@ InitializationResult InitializeOncePerProcess(int argc, char** argv) {
// In the case of FIPS builds we should make sure
// the random source is properly initialized first.
#if OPENSSL_VERSION_MAJOR >= 3
if (EVP_default_properties_is_fips_enabled(nullptr)) {
// Call OPENSSL_init_crypto to initialize OPENSSL_INIT_LOAD_CONFIG to
// avoid the default behavior where errors raised during the parsing of the
// OpenSSL configuration file are not propagated and cannot be detected.
//
// If FIPS is configured the OpenSSL configuration file will have an .include
// pointing to the fipsmodule.cnf file generated by the openssl fipsinstall
// command. If the path to this file is incorrect no error will be reported.
//
// For Node.js this will mean that EntropySource will be called by V8 as part
// of its initalization process, and EntropySource will in turn call
// CheckEntropy. CheckEntropy will call RAND_status which will now always
// return 0, leading to an endless loop and the node process will appear to
// hang/freeze.
std::string env_openssl_conf;
credentials::SafeGetenv("OPENSSL_CONF", &env_openssl_conf);

bool has_cli_conf = !per_process::cli_options->openssl_config.empty();
if (has_cli_conf || !env_openssl_conf.empty()) {
OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new();
OPENSSL_INIT_set_config_file_flags(settings, CONF_MFLAGS_DEFAULT_SECTION);
if (has_cli_conf) {
const char* conf = per_process::cli_options->openssl_config.c_str();
OPENSSL_INIT_set_config_filename(settings, conf);
}
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, settings);
OPENSSL_INIT_free(settings);

if (ERR_peek_error() != 0) {
result.exit_code = ERR_GET_REASON(ERR_peek_error());
result.early_return = true;
fprintf(stderr, "OpenSSL configuration error:\n");
ERR_print_errors_fp(stderr);
return result;
}
}
#else
if (FIPS_mode()) {
OPENSSL_init();
#endif
}
#endif
// V8 on Windows doesn't have a good source of entropy. Seed it from
// OpenSSL's pool.
V8::SetEntropySource(crypto::EntropySource);
3 changes: 2 additions & 1 deletion test/parallel/test-cli-node-options.js
Original file line number Diff line number Diff line change
@@ -61,7 +61,8 @@ if (common.isLinux) {
if (common.hasCrypto) {
expectNoWorker('--use-openssl-ca', 'B\n');
expectNoWorker('--use-bundled-ca', 'B\n');
expectNoWorker('--openssl-config=_ossl_cfg', 'B\n');
if (!common.hasOpenSSL3)
expectNoWorker('--openssl-config=_ossl_cfg', 'B\n');
}

// V8 options