From: Jouni Malinen Date: Wed, 4 Feb 2015 00:04:35 +0000 (+0200) Subject: OpenSSL: Use SSL_cache_hit() when available X-Git-Tag: hostap_2_4~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db3168d414afec44e319e29233844800ebdc04b8;p=thirdparty%2Fhostap.git OpenSSL: Use SSL_cache_hit() when available This is going to be required for OpenSSL 1.1.0 which makes the SSL structure opaque. Older versions starting from OpenSSL 1.0.1 include this function, so start using it now based on OPENSSL_VERSION_NUMBER. Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c index 163d5d29d..d8c8c56b5 100644 --- a/src/crypto/tls_openssl.c +++ b/src/crypto/tls_openssl.c @@ -2902,7 +2902,11 @@ struct wpabuf * tls_connection_decrypt(void *tls_ctx, int tls_connection_resumed(void *ssl_ctx, struct tls_connection *conn) { +#if OPENSSL_VERSION_NUMBER >= 0x10001000L + return conn ? SSL_cache_hit(conn->ssl) : 0; +#else return conn ? conn->ssl->hit : 0; +#endif }