]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
cmac: Reset state before doing set_key()
authorMartin Willi <martin@revosec.ch>
Fri, 27 Mar 2015 15:07:53 +0000 (16:07 +0100)
committerMartin Willi <martin@revosec.ch>
Fri, 27 Mar 2015 15:07:53 +0000 (16:07 +0100)
src/libstrongswan/plugins/cmac/cmac.c

index c8cb7fbf275f195ed38a2ea0786f5acb1a644023..4f222ff4e1f46b2fbeffa406475b4328c4119fa2 100644 (file)
@@ -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)
        {