From c69fa50d4c6d6fd955d38ed588c7a5ab997121aa Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Fri, 12 Feb 2016 13:30:09 +0000 Subject: [PATCH] Removing 'if' branch from the fix. This new error shouldn't be distinguishable from other padding errors. Updating 'bad' instead of adding a new 'if' branch. --- library/rsa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/rsa.c b/library/rsa.c index 2baf53257..4c85c29d4 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -856,8 +856,7 @@ int mbedtls_rsa_rsaes_pkcs1_v15_decrypt( mbedtls_rsa_context *ctx, bad |= *p++; /* Must be zero */ } - if( pad_count < 8 ) - return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA ); + bad |= ( pad_count < 8 ); if( bad ) return( MBEDTLS_ERR_RSA_INVALID_PADDING );