aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-05-04 22:39:39 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-05-05 18:43:53 +0900
commit81b7b8f80e3b423e08bc20e051da050551ff3dee (patch)
treeeae29667686e6eef629590ce48afec97ace2785d
parent68a64b113d48d302eccca5b6f7a54cb55171ca9f (diff)
downloadruby-81b7b8f80e3b423e08bc20e051da050551ff3dee.tar.gz
ext/openssl: use SSL_CTX_get_ciphers()
-rw-r--r--ext/openssl/extconf.rb1
-rw-r--r--ext/openssl/openssl_missing.h4
-rw-r--r--ext/openssl/ossl_ssl.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index c332e50184..4f43a6686e 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -130,6 +130,7 @@ have_func("OCSP_SINGLERESP_get0_id")
have_func("X509_up_ref")
have_func("X509_CRL_up_ref")
have_func("X509_STORE_up_ref")
+have_func("SSL_CTX_get_ciphers")
have_func("SSL_SESSION_up_ref")
have_func("EVP_PKEY_up_ref")
OpenSSL.check_func_or_macro("SSL_CTX_set_min_proto_version", "openssl/ssl.h")
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 30df663e8d..03732f6a80 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -155,6 +155,10 @@ void X509_REQ_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, X509_REQ
CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509_STORE);
#endif
+#if !defined(HAVE_SSL_CTX_GET_CIPHERS)
+# define SSL_CTX_get_ciphers(ctx) ((ctx)->cipher_list)
+#endif
+
#if !defined(HAVE_SSL_SESSION_UP_REF)
# define SSL_SESSION_up_ref(x) \
CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_SSL_SESSION);
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 198b1239b6..df7f7e9cca 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -902,7 +902,7 @@ ossl_sslctx_get_ciphers(VALUE self)
rb_warning("SSL_CTX is not initialized.");
return Qnil;
}
- ciphers = ctx->cipher_list;
+ ciphers = SSL_CTX_get_ciphers(ctx);
if (!ciphers)
return rb_ary_new();