From fd2ea0c41d55f3d0b34edb1d25c673bc004f6913 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Sun, 18 Dec 2016 01:02:28 +0900 Subject: ssl: check for SSL_CTX_clear_options() SSL_CTX_clear_options() first appeared in OpenSSL 0.9.8m. Add alternative macro definition for ancient versions of OpenSSL. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/78693 --- ext/openssl/extconf.rb | 1 + ext/openssl/openssl_missing.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'ext/openssl') diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index 60132b35..73a458ba 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -81,6 +81,7 @@ engines.each { |name| # added in 0.9.8X have_func("EVP_CIPHER_CTX_new") have_func("EVP_CIPHER_CTX_free") +OpenSSL.check_func_or_macro("SSL_CTX_clear_options", "openssl/ssl.h") # added in 1.0.0 have_func("ASN1_TIME_adj") diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h index df27b1a8..c7a367c3 100644 --- a/ext/openssl/openssl_missing.h +++ b/ext/openssl/openssl_missing.h @@ -21,6 +21,10 @@ EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx); #endif +#if !defined(HAVE_SSL_CTX_CLEAR_OPTIONS) +# define SSL_CTX_clear_options(ctx, op) ((ctx)->options &= ~(op)) +#endif + /* added in 1.0.0 */ #if !defined(HAVE_EVP_PKEY_BASE_ID) # define EVP_PKEY_base_id(pkey) EVP_PKEY_type((pkey)->type) -- cgit v1.2.3