Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_dynamic_mbedtls_crash_v5.0' into 'release/v5.0'
Browse files Browse the repository at this point in the history
mbedtls: Fix enable dynamic mbedtls will occur heap corruption when server support TLS renegotiation(backport v5.0)

See merge request espressif/esp-idf!28324
  • Loading branch information
mahavirj committed Jan 11, 2024
2 parents 545b251 + dfe28ce commit 3af1b71
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/mbedtls/port/dynamic/esp_ssl_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,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;
Expand Down

0 comments on commit 3af1b71

Please sign in to comment.