af-alg: Reset hmac/xcbc state before doing set_key()

This commit is contained in:
Martin Willi
2015-03-27 16:06:21 +01:00
parent eedd92b53b
commit 4075e9d7a4
2 changed files with 2 additions and 0 deletions
@@ -139,6 +139,7 @@ METHOD(prf_t, set_key, bool,
{
char buf[this->block_size];
this->ops->reset(this->ops);
if (this->xcbc)
{
/* The kernel currently does not support variable length XCBC keys,
@@ -156,6 +156,7 @@ METHOD(signer_t, get_block_size, size_t,
METHOD(signer_t, set_key, bool,
private_af_alg_signer_t *this, chunk_t key)
{
this->ops->reset(this->ops);
return this->ops->set_key(this->ops, key);
}