diff --git a/library/rsa.c b/library/rsa.c index 43dd2c019..33e673aa9 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -855,8 +855,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 );