From: Martin Willi Date: Fri, 27 Mar 2015 15:07:53 +0000 (+0100) Subject: cmac: Reset state before doing set_key() X-Git-Tag: 5.3.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc1876bc9a39513d1bb4dce437b9b01ac263a05c;p=thirdparty%2Fstrongswan.git cmac: Reset state before doing set_key() --- diff --git a/src/libstrongswan/plugins/cmac/cmac.c b/src/libstrongswan/plugins/cmac/cmac.c index c8cb7fbf27..4f222ff4e1 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) {