aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-07-13 19:19:30 (GMT)
committerJouni Malinen <j@w1.fi>2019-07-13 19:49:08 (GMT)
commit20f1cfc5b295a08896f948e8abc70d6a2b69e59d (patch)
tree728c60021caeddd154ba307720d59804b63065c9
parent36ec5881657157752dced741256441c230e42fe6 (diff)
downloadhostap-20f1cfc5b295a08896f948e8abc70d6a2b69e59d.zip
hostap-20f1cfc5b295a08896f948e8abc70d6a2b69e59d.tar.gz
hostap-20f1cfc5b295a08896f948e8abc70d6a2b69e59d.tar.bz2
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 <j@w1.fi>
-rw-r--r--src/crypto/tls_openssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index 42bdbec..9013339 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
}