aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2015-03-27 16:07:53 +0100
committerMartin Willi <martin@revosec.ch>2015-03-27 16:07:53 +0100
commitbc1876bc9a39513d1bb4dce437b9b01ac263a05c (patch)
treebedea2906c43bebb953111fa7ebde52c78e7c1d2
parent4075e9d7a4bf814f710237238a2bd8367a24ffa0 (diff)
downloadstrongswan-bc1876bc9a39513d1bb4dce437b9b01ac263a05c.tar.bz2
strongswan-bc1876bc9a39513d1bb4dce437b9b01ac263a05c.tar.xz
cmac: Reset state before doing set_key()
-rw-r--r--src/libstrongswan/plugins/cmac/cmac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/cmac/cmac.c b/src/libstrongswan/plugins/cmac/cmac.c
index c8cb7fbf2..4f222ff4e 100644
--- a/src/libstrongswan/plugins/cmac/cmac.c
+++ b/src/libstrongswan/plugins/cmac/cmac.c
@@ -247,6 +247,9 @@ METHOD(mac_t, set_key, bool,
{
chunk_t resized, iv, l;
+ memset(this->t, 0, this->b);
+ this->remaining_bytes = 0;
+
/* we support variable keys as defined in RFC 4615 */
if (key.len == this->b)
{