Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings about the OPENSSL_FIPS macro in OpenSSL 1.1. #621

Merged
merged 1 commit into from
May 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/openssl/ossl.c
Original file line number Diff line number Diff line change
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