aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-23 23:26:42 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-27 23:07:42 +0900
commit77de40a74e687f54647eaf84708aa163a3b5488c (patch)
treeca5a2df37e28b4065d51cd743d98c6b6d9cbb578
parent0d0067f3d03ef1bedf0a1e9da66606a381c77d7c (diff)
downloadruby-77de40a74e687f54647eaf84708aa163a3b5488c.tar.gz
ext/openssl: fix some compiler warnings on ossl_ssl.c
-rw-r--r--ext/openssl/ossl_ssl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index c4ed305..a5f360b 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -333,7 +333,11 @@ ossl_call_session_get_cb(VALUE ary)
/* this method is currently only called for servers (in OpenSSL <= 0.9.8e) */
static SSL_SESSION *
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ossl_sslctx_session_get_cb(SSL *ssl, const unsigned char *buf, int len, int *copy)
+#else
ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy)
+#endif
{
VALUE ary, ssl_obj, ret_obj;
SSL_SESSION *sess;
@@ -642,12 +646,11 @@ ssl_alpn_select_cb(SSL *ssl, const unsigned char **out, unsigned char *outlen, c
#endif
#endif /* HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB || HAVE_SSL_CTX_SET_ALPN_SELECT_CB */
-/* This function may serve as the entry point to support further
- * callbacks. */
+/* This function may serve as the entry point to support further callbacks. */
static void
ssl_info_cb(const SSL *ssl, int where, int val)
{
- int state = SSL_state(ssl);
+ int state = SSL_get_state(ssl);
if ((where & SSL_CB_HANDSHAKE_START) &&
(state & SSL_ST_ACCEPT)) {
@@ -865,7 +868,7 @@ ossl_sslctx_setup(VALUE self)
}
static VALUE
-ossl_ssl_cipher_to_ary(SSL_CIPHER *cipher)
+ossl_ssl_cipher_to_ary(const SSL_CIPHER *cipher)
{
VALUE ary;
int bits, alg_bits;
@@ -891,7 +894,7 @@ ossl_sslctx_get_ciphers(VALUE self)
{
SSL_CTX *ctx;
STACK_OF(SSL_CIPHER) *ciphers;
- SSL_CIPHER *cipher;
+ const SSL_CIPHER *cipher;
VALUE ary;
int i, num;