Change the buffer boundary check and alert type
Signed-off-by: XiaokangQian <xiaokang.qian@arm.com>
This commit is contained in:
parent
8db25fffb4
commit
7b2d4efee8
@ -486,7 +486,7 @@
|
||||
#define MBEDTLS_SSL_HS_SERVER_HELLO 2
|
||||
#define MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST 3
|
||||
#define MBEDTLS_SSL_HS_NEW_SESSION_TICKET 4
|
||||
#define MBEDTLS_SSL_HS_ENCRYPTED_EXTENSION 8 // NEW IN TLS 1.3
|
||||
#define MBEDTLS_SSL_HS_ENCRYPTED_EXTENSIONS 8 // NEW IN TLS 1.3
|
||||
#define MBEDTLS_SSL_HS_CERTIFICATE 11
|
||||
#define MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE 12
|
||||
#define MBEDTLS_SSL_HS_CERTIFICATE_REQUEST 13
|
||||
|
@ -1510,11 +1510,11 @@ static int ssl_tls13_parse_encrypted_extensions( mbedtls_ssl_context *ssl,
|
||||
}
|
||||
|
||||
/* Check that we consumed all the message. */
|
||||
if( p != extensions_end )
|
||||
if( p != end )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "EncryptedExtension lengths misaligned" ) );
|
||||
MBEDTLS_SSL_PEND_FATAL_ALERT( MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER, \
|
||||
MBEDTLS_ERR_SSL_ILLEGAL_PARAMETER );
|
||||
MBEDTLS_SSL_PEND_FATAL_ALERT( MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR, \
|
||||
MBEDTLS_ERR_SSL_DECODE_ERROR );
|
||||
return( MBEDTLS_ERR_SSL_DECODE_ERROR );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user