summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/hmac/hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/hmac/hmac.c')
-rw-r--r--src/libstrongswan/plugins/hmac/hmac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/hmac/hmac.c b/src/libstrongswan/plugins/hmac/hmac.c
index 44cb46b4d..96a14aed9 100644
--- a/src/libstrongswan/plugins/hmac/hmac.c
+++ b/src/libstrongswan/plugins/hmac/hmac.c
@@ -103,7 +103,8 @@ METHOD(mac_t, set_key, bool,
if (key.len > this->b)
{
/* if key is too long, it will be hashed */
- if (!this->h->get_hash(this->h, key, buffer))
+ if (!this->h->reset(this->h) ||
+ !this->h->get_hash(this->h, key, buffer))
{
return FALSE;
}