diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-05-04 23:09:43 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-05-14 20:00:56 +0900 |
commit | 0078754bbd623b6c4eacbb844433f3f3f6977e25 (patch) | |
tree | a94324a512fc79803c324957278fa64e274b464a | |
parent | 11abfc1d57b6e9165e3f5cf8f193e46aebf070e6 (diff) | |
download | ruby-0078754bbd623b6c4eacbb844433f3f3f6977e25.tar.gz |
ext/openssl: no need to check OPENSSL_FIPS in extconf.rb
Since openssl/opensslconf.h is always included, we can check
OPENSSL_FIPS macro directly.
-rw-r--r-- | ext/openssl/extconf.rb | 1 | ||||
-rw-r--r-- | ext/openssl/ossl.c | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index 058619b92e..f458bc779e 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -155,7 +155,6 @@ have_struct_member("CRYPTO_THREADID", "ptr", "openssl/crypto.h") have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h") have_struct_member("EVP_CIPHER_CTX", "engine", "openssl/evp.h") have_struct_member("X509_ATTRIBUTE", "single", "openssl/x509.h") -have_macro("OPENSSL_FIPS", ['openssl/opensslconf.h']) && $defs.push("-DHAVE_OPENSSL_FIPS") have_macro("EVP_CTRL_GCM_GET_TAG", ['openssl/evp.h']) && $defs.push("-DHAVE_AUTHENTICATED_ENCRYPTION") Logging::message "=== Checking done. ===\n" diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index 91e741367f..0dacb2701e 100644 --- a/ext/openssl/ossl.c +++ b/ext/openssl/ossl.c @@ -447,7 +447,7 @@ static VALUE ossl_fips_mode_set(VALUE self, VALUE enabled) { -#ifdef HAVE_OPENSSL_FIPS +#ifdef OPENSSL_FIPS if (RTEST(enabled)) { int mode = FIPS_mode(); if(!mode && !FIPS_mode_set(1)) /* turning on twice leads to an error */ @@ -1114,7 +1114,7 @@ Init_openssl(void) /* * Boolean indicating whether OpenSSL is FIPS-enabled or not */ -#ifdef HAVE_OPENSSL_FIPS +#ifdef OPENSSL_FIPS rb_define_const(mOSSL, "OPENSSL_FIPS", Qtrue); #else rb_define_const(mOSSL, "OPENSSL_FIPS", Qfalse); |