From 4894873b92eb169a59134fbd4a5a2e3a246d9b62 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 10 Jul 2019 13:55:17 +0100 Subject: [PATCH] Remove redundant minimum length check Availability of sufficient incoming data should be checked when it is needed, which is in mbedtls_ssl_fetch_input(), and this function has the necessary bounds checks in place. --- library/ssl_tls.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 9431212dec..e5881da74b 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5042,17 +5042,6 @@ static int ssl_parse_record_header( mbedtls_ssl_context *ssl ) } #endif /* MBEDTLS_SSL_PROTO_DTLS */ - - /* Check length against bounds of the current transform and version */ - if( ssl->transform_in != NULL ) - { - if( ssl->in_msglen < ssl->transform_in->minlen ) - { - MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad message length" ) ); - return( MBEDTLS_ERR_SSL_INVALID_RECORD ); - } - } - return( 0 ); }