cmac: Reset state before doing set_key()

This commit is contained in:
Martin Willi
2015-03-27 16:07:53 +01:00
parent 4075e9d7a4
commit bc1876bc9a
+3
View 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)
{