fix(mbedtls): fix compiling error when open MBEDTLS_SSL_PROTO_DTLS and disable MBEDTLS_SSL_PROTO_DTLS when open MBEDTLS_DYNAMIC_BUFFER

This commit is contained in:
Li Jingyi 2021-12-20 17:35:49 +08:00
parent a79dc75f0a
commit c91afab332
2 changed files with 2 additions and 14 deletions

View File

@ -101,6 +101,8 @@ menu "mbedTLS"
bool "Using dynamic TX/RX buffer"
default n
select MBEDTLS_ASYMMETRIC_CONTENT_LEN
# Dynamic buffer feature is not supported with DTLS
depends on !MBEDTLS_SSL_PROTO_DTLS
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

View File

@ -177,20 +177,6 @@ static int ssl_handshake_init( mbedtls_ssl_context *ssl )
ssl_transform_init( ssl->transform_negotiate );
ssl_handshake_params_init( ssl->handshake );
#if defined(MBEDTLS_SSL_PROTO_DTLS)
if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM )
{
ssl->handshake->alt_transform_out = ssl->transform_out;
if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT )
ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_PREPARING;
else
ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_WAITING;
ssl_set_timer( ssl, 0 );
}
#endif
return( 0 );
}