Skip to content

Commit

Permalink
Merge pull request #621 from junaruga/wip/fips-defined
Browse files Browse the repository at this point in the history
Fix warnings about the OPENSSL_FIPS macro in OpenSSL 1.1.
  • Loading branch information
junaruga committed May 16, 2023
2 parents c5b2bc1 + b4228cb commit 82da58e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext/openssl/ossl.c
Expand Up @@ -422,7 +422,7 @@ ossl_fips_mode_get(VALUE self)
VALUE enabled;
enabled = EVP_default_properties_is_fips_enabled(NULL) ? Qtrue : Qfalse;
return enabled;
#elif OPENSSL_FIPS
#elif defined(OPENSSL_FIPS)
VALUE enabled;
enabled = FIPS_mode() ? Qtrue : Qfalse;
return enabled;
Expand Down Expand Up @@ -457,7 +457,7 @@ ossl_fips_mode_set(VALUE self, VALUE enabled)
}
}
return enabled;
#elif OPENSSL_FIPS
#elif defined(OPENSSL_FIPS)
if (RTEST(enabled)) {
int mode = FIPS_mode();
if(!mode && !FIPS_mode_set(1)) /* turning on twice leads to an error */
Expand Down Expand Up @@ -1215,7 +1215,7 @@ Init_openssl(void)
/* OpenSSL 3 is FIPS-capable even when it is installed without fips option */
#if OSSL_OPENSSL_PREREQ(3, 0, 0)
Qtrue
#elif OPENSSL_FIPS
#elif defined(OPENSSL_FIPS)
Qtrue
#else
Qfalse
Expand Down

0 comments on commit 82da58e

Please sign in to comment.