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:
Ron Eldor 2019-09-10 15:21:37 +03:00
parent 92348d1c49
commit 296eca6e76

View File

@ -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 );
cleanup:
mbedtls_platform_zeroize( ipad, key_length );
mbedtls_platform_zeroize( ipad, sizeof(ipad) );
return( status );
}