Length check added

This commit is contained in:
Janos Follath 2016-02-08 13:59:25 +00:00 committed by Simon Butcher
parent 493abdf692
commit a95834340a

View file

@ -855,6 +855,9 @@ 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 );
if( bad )
return( MBEDTLS_ERR_RSA_INVALID_PADDING );