Use condition for not sensitive data

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2021-10-18 16:12:45 +02:00
parent eab90bcc36
commit 7013f62ee5
No known key found for this signature in database
GPG Key ID: 106F5A41ECC305BD

View File

@ -588,9 +588,8 @@ int mbedtls_cf_rsaes_pkcs1_v15_unpadding( size_t ilen,
size_t plaintext_size = 0;
unsigned output_too_large;
plaintext_max_size = mbedtls_cf_size_if( output_max_len > ilen - 11,
ilen - 11,
output_max_len );
plaintext_max_size = ( output_max_len > ilen - 11 ) ? ilen - 11
: output_max_len;
/* Check and get padding length in constant time and constant
* memory trace. The first byte must be 0. */