mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Merge remote-tracking branch 'public/pr/2856' into development
* public/pr/2856: Fix issue #2718 (condition always false)
This commit is contained in:
@ -3812,7 +3812,7 @@ static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha
|
||||
const unsigned char *end )
|
||||
{
|
||||
int ret = 0;
|
||||
size_t n;
|
||||
uint16_t n;
|
||||
|
||||
if( ssl_conf_has_psk_or_cb( ssl->conf ) == 0 )
|
||||
{
|
||||
@ -3832,7 +3832,7 @@ static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha
|
||||
n = ( (*p)[0] << 8 ) | (*p)[1];
|
||||
*p += 2;
|
||||
|
||||
if( n < 1 || n > 65535 || n > (size_t) ( end - *p ) )
|
||||
if( n == 0 || n > end - *p )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client key exchange message" ) );
|
||||
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE );
|
||||
|
Reference in New Issue
Block a user