Skip to content
Closed
Changes from 1 commit
Commits
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
squash! [v16.x backport] src,deps,build,test: add OpenSSL config appname
Add macro guard for 1.1.1 code.
  • Loading branch information
danbev committed Jun 23, 2022
commit 6b2e30ea649d288e805a1fc628e6c1189f3d7b83
11 changes: 11 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,7 @@ InitializationResult InitializeOncePerProcess(
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, settings);
OPENSSL_INIT_free(settings);

#if OPENSSL_VERSION_MAJOR < 3
if (ERR_peek_error() != 0) {
int ossl_error_code = ERR_GET_REASON(ERR_peek_error());
if (ossl_error_code == EVP_R_FIPS_MODE_NOT_SUPPORTED) {
Expand All @@ -1122,9 +1123,19 @@ InitializationResult InitializeOncePerProcess(
&result);
}
}
#else
if (ERR_peek_error() != 0) {
return handle_openssl_error(ERR_GET_REASON(ERR_peek_error()),
"OpenSSL configuration error:\n",
&result);
}
#endif

#if OPENSSL_VERSION_MAJOR < 3
if (FIPS_mode()) {
OPENSSL_init();
}
#endif

// V8 on Windows doesn't have a good source of entropy. Seed it from
// OpenSSL's pool.
Expand Down