summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-25 08:46:39 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-25 08:46:39 +0000
commitfc9d7c15cf82c2bbb848c133e96d49e7c7064a84 (patch)
treeaa06334465edd610550cc47c0ac0d4581bd7a655
parent29123a3799fd706b819c7e33b8125e2a6d262431 (diff)
openssl: remove check of OPENSSL_FIPS macro in extconf.rb
* ext/openssl/extconf.rb: Remove check of OPENSSL_FIPS macro. This is unneeded because we can check the macro directly in source code, just as we already do for OPENSSL_NO_* macros. * ext/openssl/ossl.c: Replace occurrences of HAVE_OPENSSL_FIPS with OPENSSL_FIPS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--ext/openssl/extconf.rb1
-rw-r--r--ext/openssl/ossl.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1020dc620db..a83bb3889a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed May 25 17:42:58 2016 Kazuki Yamaguchi <k@rhe.jp>
+
+ * ext/openssl/extconf.rb: Remove check of OPENSSL_FIPS macro. This is
+ unneeded because we can check the macro directly in source code,
+ just as we already do for OPENSSL_NO_* macros.
+
+ * ext/openssl/ossl.c: Replace occurrences of HAVE_OPENSSL_FIPS with
+ OPENSSL_FIPS.
+
Wed May 25 17:13:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (rb_scan_args): merge code for n_trail.
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 9b3bdef0856..39543f30b53 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -154,7 +154,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 ad9c430de9c..c06a579ce3c 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -495,7 +495,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 */
@@ -1162,7 +1162,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);