mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-02 23:11:12 +00:00
Fix overread when verifying SERVER_HELLO in DTLS
This commit is contained in:
parent
8390e0a97c
commit
6220ecbc48
|
@ -25,6 +25,8 @@ Bugfix
|
||||||
* Fix documentation and implementation missmatch for function arguments of
|
* Fix documentation and implementation missmatch for function arguments of
|
||||||
mbedtls_gcm_finish(). Found by cmiatpaar. #602
|
mbedtls_gcm_finish(). Found by cmiatpaar. #602
|
||||||
* Guarantee that P>Q at RSA key generation. Found by inestlerode. #558
|
* Guarantee that P>Q at RSA key generation. Found by inestlerode. #558
|
||||||
|
* Fix potential byte overread when verifying malformed SERVER_HELLO in
|
||||||
|
ssl_parse_hello_verify_request() for DTLS. Found by Guido Vranken.
|
||||||
|
|
||||||
= mbed TLS 2.1.5 branch released 2016-06-28
|
= mbed TLS 2.1.5 branch released 2016-06-28
|
||||||
|
|
||||||
|
|
|
@ -1226,6 +1226,15 @@ static int ssl_parse_hello_verify_request( mbedtls_ssl_context *ssl )
|
||||||
cookie_len = *p++;
|
cookie_len = *p++;
|
||||||
MBEDTLS_SSL_DEBUG_BUF( 3, "cookie", p, cookie_len );
|
MBEDTLS_SSL_DEBUG_BUF( 3, "cookie", p, cookie_len );
|
||||||
|
|
||||||
|
if( ( ssl->in_msg + ssl->in_msglen ) - p < cookie_len )
|
||||||
|
{
|
||||||
|
MBEDTLS_SSL_DEBUG_MSG( 1,
|
||||||
|
( "cookie length does not match incoming message size" ) );
|
||||||
|
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
|
||||||
|
MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
|
||||||
|
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO );
|
||||||
|
}
|
||||||
|
|
||||||
mbedtls_free( ssl->handshake->verify_cookie );
|
mbedtls_free( ssl->handshake->verify_cookie );
|
||||||
|
|
||||||
ssl->handshake->verify_cookie = mbedtls_calloc( 1, cookie_len );
|
ssl->handshake->verify_cookie = mbedtls_calloc( 1, cookie_len );
|
||||||
|
|
Loading…
Reference in a new issue