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.
This commit is contained in:
Janos Follath 2016-02-12 13:30:09 +00:00 committed by Simon Butcher
parent 8a49a019b0
commit c69fa50d4c

View File

@ -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 );