]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Fix TLS 1.3 session handling
authorJuliusz Sosinowicz <juliusz@wolfssl.com>
Mon, 25 Apr 2022 14:18:49 +0000 (16:18 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 1 May 2022 14:26:52 +0000 (17:26 +0300)
Uses the changes to wolfSSL found in
https://github.com/wolfSSL/wolfssl/pull/5078

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
src/crypto/tls_wolfssl.c

index 4a291fce106a92d272c4f169864389a0444e02bc..c4dd872433af51a33b51350568e9f55673a8ca89 100644 (file)
@@ -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;
 }