]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Fix build with OpenSSL 1.0.2 and 1.1.0 and LibreSSL
authorJouni Malinen <j@w1.fi>
Sat, 13 Jul 2019 19:19:30 +0000 (22:19 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 13 Jul 2019 19:49:08 +0000 (22:49 +0300)
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 <j@w1.fi>
src/crypto/tls_openssl.c

index 42bdbec08b609b3340d82fafb148965a140a03e6..9013339782d81b9b534322a6b3646e62355f7b7f 100644 (file)
@@ -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
 }