mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 06:25:45 +01:00
Validate consistency of certificate hash type and length in session
This commit is contained in:
parent
fd5dc8ae07
commit
2326d20361
@ -9498,6 +9498,13 @@ static int ssl_session_load( mbedtls_ssl_session *session,
|
||||
|
||||
if( session->peer_cert_digest_len != 0 )
|
||||
{
|
||||
const mbedtls_md_info_t *md_info =
|
||||
mbedtls_md_info_from_type( session->peer_cert_digest_type );
|
||||
if( md_info == NULL )
|
||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||
if( session->peer_cert_digest_len != mbedtls_md_get_size( md_info ) )
|
||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||
|
||||
if( session->peer_cert_digest_len > (size_t)( end - p ) )
|
||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user