From: Jouni Malinen Date: Sat, 13 Jul 2019 19:19:30 +0000 (+0300) Subject: OpenSSL: Fix build with OpenSSL 1.0.2 and 1.1.0 and LibreSSL X-Git-Tag: hostap_2_9~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=20f1cfc5b295a08896f948e8abc70d6a2b69e59d;p=thirdparty%2Fhostap.git OpenSSL: Fix build with OpenSSL 1.0.2 and 1.1.0 and LibreSSL The tls_connection_get_cipher_suite() implementation used SSL_CIPHER_get_protocol_id which was added in OpenSSL 1.1.1. Need to use compatibility code with older versions. Fixes: 94714ec341cc ("OpenSSL: Add tls_connection_get_cipher_suite()") Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c index 42bdbec08..901333978 100644 --- a/src/crypto/tls_openssl.c +++ b/src/crypto/tls_openssl.c @@ -5533,5 +5533,9 @@ u16 tls_connection_get_cipher_suite(struct tls_connection *conn) cipher = SSL_get_current_cipher(conn->ssl); if (!cipher) return 0; +#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER) return SSL_CIPHER_get_protocol_id(cipher); +#else + return SSL_CIPHER_get_id(cipher) & 0xFFFF; +#endif }