From 70f1019cbfbe7a65e2195dc7512ce108868fe1fd Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Tue, 26 Apr 2016 16:29:10 +0900 Subject: ext/openssl: use SSL_CTX_get_ciphers() --- ext/openssl/extconf.rb | 1 + ext/openssl/openssl_missing.h | 4 ++++ ext/openssl/ossl_ssl.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index d3d6da633c..b2a09675e4 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -127,6 +127,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_like("SSL_CTX_set_min_proto_version", "openssl/ssl.h") have_func("SSL_SESSION_up_ref") have_func("EVP_PKEY_up_ref") diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h index 94032167d1..e68649f207 100644 --- a/ext/openssl/openssl_missing.h +++ b/ext/openssl/openssl_missing.h @@ -156,6 +156,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 8c6cc35442..2af2fc0824 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -900,7 +900,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(); -- cgit v1.2.3