aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/openssl_missing.h
diff options
context:
space:
mode:
authorrhe <rhe@ruby-lang.org>2016-06-05 16:36:39 +0000
committerKazuki Yamaguchi <k@rhe.jp>2016-06-09 15:05:21 +0900
commit8c847251d5cba9713756f32ec014326b07603d56 (patch)
treebffe47c0ffe3329d01f8b02372b6a40fbe2bc939 /ext/openssl/openssl_missing.h
parent0b1e59f2c11b345ec344fe616c470a703fc079b6 (diff)
downloadruby-openssl-8c847251d5cba9713756f32ec014326b07603d56.tar.gz
openssl: use SSL_is_server()
* ext/openssl/extconf.rb: Check existence of SSL_is_server(). This function was introduced in OpenSSL 1.0.2. [ruby-core:75225] [Feature #12324] * ext/openssl/openssl_missing.h: Implement SSL_is_server() if missing. * ext/openssl/ossl_ssl.c (ssl_info_cb): Use SSL_is_server() to see if the SSL is server. The state machine in OpenSSL was rewritten and SSL_get_state() no longer returns SSL_ST_ACCEPT. (ossl_ssl_cipher_to_ary, ossl_sslctx_session_get_cb): Add some `const`s to suppress warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/openssl_missing.h')
-rw-r--r--ext/openssl/openssl_missing.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index ddd07b90..e418c505 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -61,6 +61,10 @@ int EC_curve_nist2nid(const char *);
# define X509_STORE_CTX_get0_store(x) ((x)->ctx)
#endif
+#if !defined(HAVE_SSL_IS_SERVER)
+# define SSL_is_server(s) ((s)->server)
+#endif
+
/* added in 1.1.0 */
#if !defined(HAVE_BN_GENCB_NEW)
# define BN_GENCB_new() ((BN_GENCB *)OPENSSL_malloc(sizeof(BN_GENCB)))