Skip to content

Commit b2bc839

Browse files
richardlauruyadorno
authored andcommittedSep 12, 2023
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 <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 9cf8fe6 commit b2bc839

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
@@ -254,7 +254,6 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo<v8::Value>& args) {
254254
Mutex::ScopedLock lock(per_process::cli_options_mutex);
255255
Mutex::ScopedLock fips_lock(fips_mutex);
256256

257-
#ifdef OPENSSL_FIPS
258257
#if OPENSSL_VERSION_MAJOR >= 3
259258
OSSL_PROVIDER* fips_provider = nullptr;
260259
if (OSSL_PROVIDER_available(nullptr, "fips")) {
@@ -263,11 +262,12 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo<v8::Value>& args) {
263262
const auto enabled = fips_provider == nullptr ? 0 :
264263
OSSL_PROVIDER_self_test(fips_provider) ? 1 : 0;
265264
#else
265+
#ifdef OPENSSL_FIPS
266266
const auto enabled = FIPS_selftest() ? 1 : 0;
267-
#endif
268267
#else // OPENSSL_FIPS
269268
const auto enabled = 0;
270269
#endif // OPENSSL_FIPS
270+
#endif
271271

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

0 commit comments

Comments
 (0)
Please sign in to comment.