Skip to content

Commit 8d651ce

Browse files
authored
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: #48392 Refs: #48379 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 1da9099 commit 8d651ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crypto/crypto_util.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo<v8::Value>& args) {
253253
Mutex::ScopedLock lock(per_process::cli_options_mutex);
254254
Mutex::ScopedLock fips_lock(fips_mutex);
255255

256-
#ifdef OPENSSL_FIPS
257256
#if OPENSSL_VERSION_MAJOR >= 3
258257
OSSL_PROVIDER* fips_provider = nullptr;
259258
if (OSSL_PROVIDER_available(nullptr, "fips")) {
@@ -262,11 +261,12 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo<v8::Value>& args) {
262261
const auto enabled = fips_provider == nullptr ? 0 :
263262
OSSL_PROVIDER_self_test(fips_provider) ? 1 : 0;
264263
#else
264+
#ifdef OPENSSL_FIPS
265265
const auto enabled = FIPS_selftest() ? 1 : 0;
266-
#endif
267266
#else // OPENSSL_FIPS
268267
const auto enabled = 0;
269268
#endif // OPENSSL_FIPS
269+
#endif
270270

271271
args.GetReturnValue().Set(enabled);
272272
}

0 commit comments

Comments
 (0)