hostapd: backport build fix when OWE is activated
[openwrt/staging/lynxis.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 --- a/src/crypto/tls_openssl.c
15 +++ b/src/crypto/tls_openssl.c
16 @@ -1024,8 +1024,10 @@ void * tls_init(const struct tls_config
17
18 #ifndef OPENSSL_NO_ENGINE
19 wpa_printf(MSG_DEBUG, "ENGINE: Loading dynamic engine");
20 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
21 ERR_load_ENGINE_strings();
22 ENGINE_load_dynamic();
23 +#endif /* OPENSSL_VERSION_NUMBER */
24
25 if (conf &&
26 (conf->opensc_engine_path || conf->pkcs11_engine_path ||
27 @@ -3874,7 +3876,7 @@ struct wpabuf * tls_connection_decrypt(v
28
29 int tls_connection_resumed(void *ssl_ctx, struct tls_connection *conn)
30 {
31 - return conn ? SSL_cache_hit(conn->ssl) : 0;
32 + return conn ? SSL_session_reused(conn->ssl) : 0;
33 }
34
35