mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-31 10:20:45 +00:00
Add hash length check
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
9750f813a7
commit
3afdf36de7
@ -2036,8 +2036,12 @@ static int ssl_tls13_postprocess_new_session_ticket( mbedtls_ssl_context *ssl,
|
|||||||
|
|
||||||
psa_hash_alg = mbedtls_psa_translate_md( ciphersuite_info->mac );
|
psa_hash_alg = mbedtls_psa_translate_md( ciphersuite_info->mac );
|
||||||
hash_length = PSA_HASH_LENGTH( psa_hash_alg );
|
hash_length = PSA_HASH_LENGTH( psa_hash_alg );
|
||||||
if( hash_length == -1 )
|
if( hash_length == -1 ||
|
||||||
|
( size_t )hash_length > sizeof( session->resumption_key ) )
|
||||||
|
{
|
||||||
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_BUF( 3, "resumption_master_secret",
|
MBEDTLS_SSL_DEBUG_BUF( 3, "resumption_master_secret",
|
||||||
session->app_secrets.resumption_master_secret,
|
session->app_secrets.resumption_master_secret,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user