mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-12-15 01:48:20 +08:00
feat(mbedtls): Add dynamic buffer and local resource managment to decrease SSL heap cost
This commit is contained in:
@@ -81,6 +81,40 @@ menu "mbedTLS"
|
||||
This defines maximum outgoing fragment length, overriding default
|
||||
maximum content length (MBEDTLS_SSL_MAX_CONTENT_LEN).
|
||||
|
||||
config MBEDTLS_DYNAMIC_BUFFER
|
||||
bool "Using dynamic TX/RX buffer"
|
||||
default n
|
||||
select MBEDTLS_ASYMMETRIC_CONTENT_LEN
|
||||
help
|
||||
Using dynamic TX/RX buffer. After enabling this option, mbedTLS will
|
||||
allocate TX buffer when need to send data and then free it if all data
|
||||
is sent, allocate RX buffer when need to receive data and then free it
|
||||
when all data is used or read by upper layer.
|
||||
|
||||
By default, when SSL is initialized, mbedTLS also allocate TX and
|
||||
RX buffer with the default value of "MBEDTLS_SSL_OUT_CONTENT_LEN" or
|
||||
"MBEDTLS_SSL_IN_CONTENT_LEN", so to save more heap, users can set
|
||||
the options to be an appropriate value.
|
||||
|
||||
config MBEDTLS_DYNAMIC_FREE_PEER_CERT
|
||||
bool "Free SSL peer certificate after its usage"
|
||||
default n
|
||||
depends on MBEDTLS_DYNAMIC_BUFFER
|
||||
help
|
||||
Free peer certificate after its usage in handshake process.
|
||||
|
||||
config MBEDTLS_DYNAMIC_FREE_CONFIG_DATA
|
||||
bool "Free certificate, key and DHM data after its usage"
|
||||
default n
|
||||
depends on MBEDTLS_DYNAMIC_BUFFER
|
||||
help
|
||||
Free certificate, private key and DHM data after its usage in handshake process.
|
||||
|
||||
The option will decrease heap cost when handshake, but also lead to problem:
|
||||
|
||||
Becasue all certificate, private key and DHM data are freed so users should register
|
||||
certificate and private key to ssl config object again.
|
||||
|
||||
config MBEDTLS_DEBUG
|
||||
bool "Enable mbedTLS debugging"
|
||||
default n
|
||||
|
||||
Reference in New Issue
Block a user