Skip to content

Commit

Permalink
Merge pull request wolfSSL#7014 from SparkiDev/ssl_free_tlsx_fixup
Browse files Browse the repository at this point in the history
SSL_free, TLSX_Remove calls: fix #if protection
  • Loading branch information
JacobBarthelmeh authored Nov 30, 2023
2 parents 8097ed7 + 7ebad05 commit a1e74d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -8458,9 +8458,9 @@ void FreeHandshakeResources(WOLFSSL* ssl)
}
#endif /* HAVE_PK_CALLBACKS */

#if defined(HAVE_TLS_EXTENSIONS) && !defined(HAVE_SNI) && !defined(NO_TLS) && \
!defined(HAVE_ALPN) && !defined(WOLFSSL_POST_HANDSHAKE_AUTH) && \
!defined(WOLFSSL_DTLS_CID)
#if defined(HAVE_TLS_EXTENSIONS) && !defined(NO_TLS)
#if !defined(HAVE_SNI) && !defined(HAVE_ALPN) && !defined(WOLFSSL_DTLS_CID) && \
!defined(WOLFSSL_POST_HANDSHAKE_AUTH)
/* Some extensions need to be kept for post-handshake querying. */
TLSX_FreeAll(ssl->extensions, ssl->heap);
ssl->extensions = NULL;
Expand All @@ -8474,7 +8474,9 @@ void FreeHandshakeResources(WOLFSSL* ssl)
TLSX_Remove(&ssl->extensions, TLSX_SUPPORTED_VERSIONS, ssl->heap);
TLSX_Remove(&ssl->extensions, TLSX_KEY_SHARE, ssl->heap);
#endif
#endif
#endif /* !HAVE_SNI && && !HAVE_ALPN && !WOLFSSL_DTLS_CID &&
* !WOLFSSL_POST_HANDSHAKE_AUTH */
#endif /* HAVE_TLS_EXTENSIONS && !NO_TLS */

#ifdef WOLFSSL_STATIC_MEMORY
/* when done with handshake decrement current handshake count */
Expand Down

0 comments on commit a1e74d9

Please sign in to comment.