From a9f9335ee9a9758001bf7e51641642134b997033 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Mon, 4 Apr 2022 17:32:30 +0200 Subject: [PATCH] ssl_tls13_generate_and_write_ecdh_key_exchange(): remove redundant check This check can be removed as if the buffer is too small for the key, then export will fail. Signed-off-by: Przemek Stekiel --- library/ssl_tls13_client.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c index 3bb308c3a..a9b9b03c1 100644 --- a/library/ssl_tls13_client.c +++ b/library/ssl_tls13_client.c @@ -262,12 +262,6 @@ static int ssl_tls13_generate_and_write_ecdh_key_exchange( } - if( own_pubkey_len > (size_t)( end - buf ) ) - { - MBEDTLS_SSL_DEBUG_MSG( 1, ( "No space in the buffer for ECDH public key." ) ); - return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); - } - *out_len = own_pubkey_len; return( 0 );