From: Juliusz Sosinowicz Date: Mon, 25 Apr 2022 14:18:49 +0000 (+0200) Subject: wolfSSL: Fix TLS 1.3 session handling X-Git-Tag: hostap_2_11~1972 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a40e48fbe1a0158c605061b3600094af05af5b7d;p=thirdparty%2Fhostap.git wolfSSL: Fix TLS 1.3 session handling Uses the changes to wolfSSL found in https://github.com/wolfSSL/wolfssl/pull/5078 Signed-off-by: Juliusz Sosinowicz --- diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c index 4a291fce1..c4dd87243 100644 --- a/src/crypto/tls_wolfssl.c +++ b/src/crypto/tls_wolfssl.c @@ -410,10 +410,13 @@ int tls_connection_shutdown(void *tls_ctx, struct tls_connection *conn) wolfSSL_set_quiet_shutdown(conn->ssl, 1); wolfSSL_shutdown(conn->ssl); - session = wolfSSL_get_session(conn->ssl); - if (wolfSSL_clear(conn->ssl) != 1) + session = wolfSSL_get1_session(conn->ssl); + if (wolfSSL_clear(conn->ssl) != 1) { + wolfSSL_SESSION_free(session); return -1; + } wolfSSL_set_session(conn->ssl, session); + wolfSSL_SESSION_free(session); return 0; }