]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
af-alg: Reset hmac/xcbc state before doing set_key()
authorMartin Willi <martin@revosec.ch>
Fri, 27 Mar 2015 15:06:21 +0000 (16:06 +0100)
committerMartin Willi <martin@revosec.ch>
Fri, 27 Mar 2015 15:06:21 +0000 (16:06 +0100)
src/libstrongswan/plugins/af_alg/af_alg_prf.c
src/libstrongswan/plugins/af_alg/af_alg_signer.c

index 720738a8409d683dc06d9297df9b9be3e2ecee6c..2b7d51376a1caefdb1855b108dc6c9bad5fc0917 100644 (file)
@@ -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,
index 6ee380633372bb86630ca67fc112b0fe1131f6a3..9ad01103adf5b8968376c9419777d45560d81dd5 100644 (file)
@@ -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);
 }