Length check added

This commit is contained in:
Janos Follath 2016-02-08 13:59:25 +00:00 committed by Simon Butcher
parent a91d85e331
commit 4ed7376a5d

View file

@ -844,6 +844,9 @@ int rsa_rsaes_pkcs1_v15_decrypt( rsa_context *ctx,
bad |= *p++; /* Must be zero */ bad |= *p++; /* Must be zero */
} }
if( pad_count < 8 )
return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA );
if( bad ) if( bad )
return( POLARSSL_ERR_RSA_INVALID_PADDING ); return( POLARSSL_ERR_RSA_INVALID_PADDING );