hostapd: Fix compile with OpenSSL 1.1.0 + no deprecated APIs
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 700-fix-openssl11.patch
1 From 672540d4ddbd24782b5c65b35d636bdfe8a90d0f Mon Sep 17 00:00:00 2001
2 From: Rosen Penev <rosenp@gmail.com>
3 Date: Fri, 15 Jun 2018 18:35:30 -0700
4 Subject: [PATCH] Fix compile with OpenSSL 1.1.0 and deprecated APIs
5
6 SSL_session_reused is the same as SSL_cache_hit. The engine load stuff is
7 now handled by OPENSSL_init.
8
9 Signed-off-by: Rosen Penev <rosenp@gmail.com>
10 ---
11 src/crypto/tls_openssl.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14 diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
15 index b4bfc9b73..79ac909d0 100644
16 --- a/src/crypto/tls_openssl.c
17 +++ b/src/crypto/tls_openssl.c
18 @@ -1024,8 +1024,10 @@ void * tls_init(const struct tls_config *conf)
19
20 #ifndef OPENSSL_NO_ENGINE
21 wpa_printf(MSG_DEBUG, "ENGINE: Loading dynamic engine");
22 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
23 ERR_load_ENGINE_strings();
24 ENGINE_load_dynamic();
25 +#endif /* OPENSSL_VERSION_NUMBER */
26
27 if (conf &&
28 (conf->opensc_engine_path || conf->pkcs11_engine_path ||
29 @@ -3874,7 +3876,7 @@ struct wpabuf * tls_connection_decrypt(void *tls_ctx,
30
31 int tls_connection_resumed(void *ssl_ctx, struct tls_connection *conn)
32 {
33 - return conn ? SSL_cache_hit(conn->ssl) : 0;
34 + return conn ? SSL_session_reused(conn->ssl) : 0;
35 }
36
37
38 --
39 2.17.1
40