psa_hmac_setup_internal: add some missing cleanup on failure
Clean ipad if hashing the key failed.
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index a0f2780..f157f45 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1429,11 +1429,11 @@
{
status = psa_hash_update( &hmac->hash_ctx, key, key_length );
if( status != PSA_SUCCESS )
- return( status );
+ goto cleanup;
status = psa_hash_finish( &hmac->hash_ctx,
ipad, sizeof( ipad ), &key_length );
if( status != PSA_SUCCESS )
- return( status );
+ goto cleanup;
}
/* A 0-length key is not commonly used in HMAC when used as a MAC,
* but it is permitted. It is common when HMAC is used in HKDF, for