Merge branch 'bugfix/fix_dynamic_mbedtls_crash_v5.1' into 'release/v5.1'

mbedtls: Fix enable dynamic mbedtls will occur heap corruption when server support TLS renegotiation(backport v5.1)

See merge request espressif/esp-idf!28325
This commit is contained in:
Jiang Jiang Jian 2024-01-26 22:25:24 +08:00
commit a5e3e0b90e

View File

@ -185,6 +185,11 @@ static int manage_resource(mbedtls_ssl_context *ssl, bool add)
case MBEDTLS_SSL_FLUSH_BUFFERS:
break;
case MBEDTLS_SSL_HANDSHAKE_WRAPUP:
#if defined(MBEDTLS_SSL_RENEGOTIATION)
if (add && ssl->MBEDTLS_PRIVATE(renego_status)) {
CHECK_OK(esp_mbedtls_add_rx_buffer(ssl));
}
#endif
break;
default:
break;