From 150bdee12673c01502f30690fd65cc12e2327ae7 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Mon, 18 Oct 2021 16:12:45 +0200 Subject: [PATCH] Use condition for not sensitive data Signed-off-by: Gabor Mezei --- library/constant_time.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/constant_time.c b/library/constant_time.c index ea21692b6..85e0e76ad 100644 --- a/library/constant_time.c +++ b/library/constant_time.c @@ -589,9 +589,8 @@ int mbedtls_cf_rsaes_pkcs1_v15_unpadding( int mode, 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. */