Restored check on salt length to the original

Following code review by Manuel Pégourié-Gonnard

Signed-off-by: Cédric Meuter <cedric.meuter@worldline.com>
This commit is contained in:
Cédric Meuter 2020-12-28 14:34:29 +01:00
parent d2dc1f1a83
commit 2ee085002b

View File

@ -1856,7 +1856,7 @@ static int rsa_rsassa_pss_sign( mbedtls_rsa_context *ctx,
else
slen = olen - hlen - 2;
}
else if ( ( (size_t) saltlen ) > olen - hlen - 2 )
else if ( (saltlen < 0) || ((size_t) saltlen > olen - hlen - 2) )
{
return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA );
}