mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
Fix a buffer overflow in hmac_setup_internal
At the end of `psa_hmac_setup_internal()`, the ipad is cleared. However, the size that was given to clear was `key_len` which is larger than the size of `ipad`.
This commit is contained in:
@@ -2735,7 +2735,7 @@ static psa_status_t psa_hmac_setup_internal( psa_hmac_internal_data *hmac,
|
|||||||
status = psa_hash_update( &hmac->hash_ctx, ipad, block_size );
|
status = psa_hash_update( &hmac->hash_ctx, ipad, block_size );
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
mbedtls_platform_zeroize( ipad, key_length );
|
mbedtls_platform_zeroize( ipad, sizeof(ipad) );
|
||||||
|
|
||||||
return( status );
|
return( status );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user