mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-07 09:02:08 +00:00
fix(mbedtls): fix mbedtls dynamic resource memory leaks and RSA cert drop earlier
RX process caches the session information in "ssl->in_ctr" not in "ssl->in_buf". So when freeing the SSL, can't free the "ssl->in_ctr", because the "ssl->in_buf" is empty. Make the RX process like TX process, and cache the session information in "ssl->in_buf", so that the cache buffer can be freed when freeing the SSL. Closes https://github.com/espressif/esp-idf/issues/6104
This commit is contained in:
@@ -33,9 +33,6 @@
|
||||
\
|
||||
if ((_ret = _fn) != 0) { \
|
||||
ESP_LOGV(TAG, "\"%s\" result is -0x%x", # _fn, -_ret); \
|
||||
if (_ret == MBEDTLS_ERR_SSL_CONN_EOF) {\
|
||||
return 0; \
|
||||
} \
|
||||
TRACE_CHECK(_fn, "fail"); \
|
||||
return _ret; \
|
||||
} \
|
||||
@@ -80,6 +77,8 @@ void esp_mbedtls_free_cacert(mbedtls_ssl_context *ssl);
|
||||
|
||||
#ifdef CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT
|
||||
void esp_mbedtls_free_peer_cert(mbedtls_ssl_context *ssl);
|
||||
|
||||
bool esp_mbedtls_ssl_is_rsa(mbedtls_ssl_context *ssl);
|
||||
#endif
|
||||
|
||||
#endif /* _DYNAMIC_IMPL_H_ */
|
||||
|
||||
Reference in New Issue
Block a user