add call to mbedtls_psa_free()for MbedTLS >= 3, defaulting to TLS 1.3, retroactively documented in 3.6.1

This commit is contained in:
Sergio R. Caprile
2025-09-23 11:31:10 -03:00
parent fe6d357858
commit daeca8128b
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -14295,6 +14295,10 @@ void mg_tls_free(struct mg_connection *c) {
mbedtls_ssl_config_free(&tls->conf);
#ifdef MBEDTLS_SSL_SESSION_TICKETS
mbedtls_ssl_ticket_free(&tls->ticket);
#endif
#if defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_NUMBER >= 0x03000000 && \
defined(MBEDTLS_PSA_CRYPTO_C)
mbedtls_psa_crypto_free(); // https://github.com/Mbed-TLS/mbedtls/issues/9223#issuecomment-2144898336
#endif
mg_free(tls);
c->tls = NULL;
+4
View File
@@ -58,6 +58,10 @@ void mg_tls_free(struct mg_connection *c) {
mbedtls_ssl_config_free(&tls->conf);
#ifdef MBEDTLS_SSL_SESSION_TICKETS
mbedtls_ssl_ticket_free(&tls->ticket);
#endif
#if defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_NUMBER >= 0x03000000 && \
defined(MBEDTLS_PSA_CRYPTO_C)
mbedtls_psa_crypto_free(); // https://github.com/Mbed-TLS/mbedtls/issues/9223#issuecomment-2144898336
#endif
mg_free(tls);
c->tls = NULL;