diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-04-27 13:11:41 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-04-27 23:07:42 +0900 |
commit | d5936ea2f7c4192d4f6ae9e1dda14b0276504811 (patch) | |
tree | 646b6749d9f1702d5ddb4419fa7b4e7dc6642c33 | |
parent | 89de98d961a38ba8e8698f5fab983ce7dfce0701 (diff) | |
download | ruby-d5936ea2f7c4192d4f6ae9e1dda14b0276504811.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 9dbb4d4b03..c225ef35bd 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -70,7 +70,6 @@ have_func("SSLv2_method") have_func("SSLv3_method") have_func("TLSv1_1_method") have_func("TLSv1_2_method") -have_macro("OPENSSL_FIPS", ['openssl/opensslconf.h']) && $defs.push("-DHAVE_OPENSSL_FIPS") have_func("RAND_egd") # ENGINE_load_xx is deprecated in OpenSSL 1.1.0 and become a macro engines = %w{builtin_engines openbsd_dev_crypto dynamic 4758cca aep atalla chil diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index 59173de6ec..c1582155fa 100644 --- a/ext/openssl/ossl.c +++ b/ext/openssl/ossl.c @@ -442,7 +442,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 */ @@ -1111,7 +1111,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); |