]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Use SSL_cache_hit() when available
authorJouni Malinen <j@w1.fi>
Wed, 4 Feb 2015 00:04:35 +0000 (02:04 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 4 Feb 2015 00:04:35 +0000 (02:04 +0200)
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 <j@w1.fi>
src/crypto/tls_openssl.c

index 163d5d29d733bb64a0a5dcac1cb5c7d16d9851d6..d8c8c56b50958b54e9ab8592d910af72825a4c27 100644 (file)
@@ -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
 }