aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-18 02:42:50 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-21 00:46:34 +0900
commit9344f792ebcd0d39506add6cbed726cf977b49cb (patch)
tree570abd4c4893bd2d516b13eb63675069fbab3bd5
parent4a8fd28dfeb5c938f7137c2a10ddd978e6aecfbb (diff)
downloadruby-9344f792ebcd0d39506add6cbed726cf977b49cb.tar.gz
wip-097-support
-rw-r--r--ext/openssl/extconf.rb6
-rw-r--r--ext/openssl/openssl_missing.h4
-rw-r--r--test/openssl/utils.rb2
3 files changed, 8 insertions, 4 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 76cf20541a..5482523146 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -180,10 +180,10 @@ have_func("OCSP_SINGLERESP_get0_id")
have_struct_member("EVP_PKEY", "type", "openssl/evp.h") # removed
# depending on OpenSSL configuration
-have_func("TLSv1_1_method")
-have_func("TLSv1_2_method")
-have_func("SSLv2_method")
+have_func("SSLv2_method") # removed in 1.1.0
have_func("SSLv3_method")
+have_func("TLSv1_1_method") # added in 1.0.1
+have_func("TLSv1_2_method") # added in 1.0.1
have_macro("OPENSSL_FIPS", ['openssl/opensslconf.h']) && $defs.push("-DHAVE_OPENSSL_FIPS")
# LibreSSL support
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index ce85c8fd09..692053fc0e 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -200,6 +200,7 @@ int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
/*** added in 0.9.8 ***/
+#if defined(HAVE_BN_GENCB)
#if !defined(HAVE_BN_IS_PRIME_EX)
int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
#endif
@@ -211,6 +212,7 @@ int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, int do_tr
#if !defined(HAVE_BN_GENERATE_PRIME_EX)
int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb);
#endif
+#endif
#if !defined(HAVE_EVP_CIPHER_CTX_NEW)
EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);
@@ -300,6 +302,7 @@ int EC_curve_nist2nid(const char *str);
#endif
/*** added in 1.1.0 ***/
+#if defined(HAVE_BN_GENCB)
#if !defined(HAVE_BN_GENCB_NEW)
# define BN_GENCB_new() ((BN_GENCB *)OPENSSL_malloc(sizeof(BN_GENCB)))
#endif
@@ -311,6 +314,7 @@ int EC_curve_nist2nid(const char *str);
#if !defined(HAVE_BN_GENCB_GET_ARG)
# define BN_GENCB_get_arg(cb) (cb)->arg
#endif
+#endif
#if !defined(HAVE_HMAC_CTX_NEW)
HMAC_CTX *HMAC_CTX_new(void);
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 1afee5f88a..d85e0ba15a 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -342,5 +342,5 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
end
end
-end if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION) and
+end if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION) and 1==1 ||
/\AOpenSSL +0\./ !~ OpenSSL::OPENSSL_LIBRARY_VERSION