mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-27 11:04:21 +01:00
Move underflow test to make time constant
This commit is contained in:
parent
45a5f7406d
commit
1d114d2efa
@ -695,6 +695,12 @@ int rsa_rsaes_oaep_decrypt( rsa_context *ctx,
|
||||
if( md_info == NULL )
|
||||
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
|
||||
|
||||
hlen = mbedtls_md_get_size( md_info );
|
||||
|
||||
// checking for integer underflow
|
||||
if( 2 * hlen + 2 > ilen )
|
||||
return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA );
|
||||
|
||||
/*
|
||||
* RSA operation
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user