feat(mbedtls): skip memset ssl buffers with dynamic buffer enabled.

As with dynamic buffer feature enabled, the buffers are handled dynamically,
there is no need to memset these on connection reset. This can help to save
some heap memory allocation.
This commit is contained in:
Ashish Sharma
2025-07-28 14:07:05 +08:00
parent e1a7a4813e
commit 05556725a2
+6
View File
@@ -1468,6 +1468,12 @@ void mbedtls_ssl_session_reset_msg_layer(mbedtls_ssl_context *ssl,
#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH)
size_t in_buf_len = ssl->in_buf_len;
size_t out_buf_len = ssl->out_buf_len;
/* ESP Change: For dynamic buffer feature, the buffer allocation shall be
* handled on-demand basis and hence skip the memset in this API on the buffer pointers
*/
#elif defined(CONFIG_MBEDTLS_DYNAMIC_BUFFER)
size_t in_buf_len = 0;
size_t out_buf_len = 0;
#else
size_t in_buf_len = MBEDTLS_SSL_IN_BUFFER_LEN;
size_t out_buf_len = MBEDTLS_SSL_OUT_BUFFER_LEN;