From 9344f792ebcd0d39506add6cbed726cf977b49cb Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Mon, 18 Apr 2016 02:42:50 +0900 Subject: wip-097-support --- ext/openssl/extconf.rb | 6 +++--- ext/openssl/openssl_missing.h | 4 ++++ test/openssl/utils.rb | 2 +- 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 -- cgit v1.2.3