mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-27 06:34:18 +01:00
Add buffer size check before cert_type_len read
This commit is contained in:
parent
7da5088289
commit
314f16136f
@ -2672,6 +2672,13 @@ static int ssl_parse_certificate_request( mbedtls_ssl_context *ssl )
|
||||
buf = ssl->in_msg;
|
||||
|
||||
/* certificate_types */
|
||||
if( ssl->in_hslen <= mbedtls_ssl_hs_hdr_len( ssl ) )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad certificate request message" ) );
|
||||
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
|
||||
MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
|
||||
return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST );
|
||||
}
|
||||
cert_type_len = buf[mbedtls_ssl_hs_hdr_len( ssl )];
|
||||
n = cert_type_len;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user