Skip to content

Commit 82da58e

Browse files
authored
Merge pull request #621 from junaruga/wip/fips-defined
Fix warnings about the OPENSSL_FIPS macro in OpenSSL 1.1.
2 parents c5b2bc1 + b4228cb commit 82da58e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/openssl/ossl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ ossl_fips_mode_get(VALUE self)
422422
VALUE enabled;
423423
enabled = EVP_default_properties_is_fips_enabled(NULL) ? Qtrue : Qfalse;
424424
return enabled;
425-
#elif OPENSSL_FIPS
425+
#elif defined(OPENSSL_FIPS)
426426
VALUE enabled;
427427
enabled = FIPS_mode() ? Qtrue : Qfalse;
428428
return enabled;
@@ -457,7 +457,7 @@ ossl_fips_mode_set(VALUE self, VALUE enabled)
457457
}
458458
}
459459
return enabled;
460-
#elif OPENSSL_FIPS
460+
#elif defined(OPENSSL_FIPS)
461461
if (RTEST(enabled)) {
462462
int mode = FIPS_mode();
463463
if(!mode && !FIPS_mode_set(1)) /* turning on twice leads to an error */
@@ -1215,7 +1215,7 @@ Init_openssl(void)
12151215
/* OpenSSL 3 is FIPS-capable even when it is installed without fips option */
12161216
#if OSSL_OPENSSL_PREREQ(3, 0, 0)
12171217
Qtrue
1218-
#elif OPENSSL_FIPS
1218+
#elif defined(OPENSSL_FIPS)
12191219
Qtrue
12201220
#else
12211221
Qfalse

0 commit comments

Comments
 (0)