mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
crypto: remove OPENSSL_FIPS guard for OpenSSL 3
The OPENSSL_FIPS guard is only needed for versions of OpenSSL earlier than 3.0. Removing the guard for OpenSSL 3 fixes `parallel/test-crypto-fips` when run with a FIPS enabled OpenSSL 3 configuration. PR-URL: https://github.com/nodejs/node/pull/48392 Refs: https://github.com/nodejs/node/issues/48379 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
1 parent
9cf8fe6b93
commit
b2bc839d4c
1 file changed
+2
-2
@@ -254,7 +254,6 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
Mutex::ScopedLock lock(per_process::cli_options_mutex);
|
||||
Mutex::ScopedLock fips_lock(fips_mutex);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#if OPENSSL_VERSION_MAJOR >= 3
|
||||
OSSL_PROVIDER* fips_provider = nullptr;
|
||||
if (OSSL_PROVIDER_available(nullptr, "fips")) {
|
||||
@@ -263,11 +262,12 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
const auto enabled = fips_provider == nullptr ? 0 :
|
||||
OSSL_PROVIDER_self_test(fips_provider) ? 1 : 0;
|
||||
#else
|
||||
#ifdef OPENSSL_FIPS
|
||||
const auto enabled = FIPS_selftest() ? 1 : 0;
|
||||
#endif
|
||||
#else // OPENSSL_FIPS
|
||||
const auto enabled = 0;
|
||||
#endif // OPENSSL_FIPS
|
||||
#endif
|
||||
|
||||
args.GetReturnValue().Set(enabled);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user