mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-12 07:25:36 +00:00
Included test for integer underflow.
This commit is contained in:
parent
33857f4c3d
commit
d886c4a419
|
@ -710,8 +710,12 @@ int rsa_rsaes_oaep_decrypt( rsa_context *ctx,
|
||||||
*/
|
*/
|
||||||
hlen = md_get_size( md_info );
|
hlen = md_get_size( md_info );
|
||||||
|
|
||||||
md_init( &md_ctx );
|
// checking for integer underflow
|
||||||
md_init_ctx( &md_ctx, md_info );
|
if( 2 * hlen + 2 > ilen )
|
||||||
|
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
|
||||||
|
|
||||||
|
mbedtls_md_init( &md_ctx );
|
||||||
|
mbedtls_md_setup( &md_ctx, md_info, 0 );
|
||||||
|
|
||||||
/* Generate lHash */
|
/* Generate lHash */
|
||||||
md( md_info, label, label_len, lhash );
|
md( md_info, label, label_len, lhash );
|
||||||
|
|
Loading…
Reference in a new issue