make reinitialisation work for CMAC
authorDr. Stephen Henson <steve@openssl.org>
Wed, 11 Apr 2012 12:26:13 +0000 (12:26 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 11 Apr 2012 12:26:13 +0000 (12:26 +0000)
crypto/cmac/cmac.c

index b58602680bb00595845be76e2706df807fc1ff66..7ae776e3fcfc93cdabd6e51cf8432b876b761cdc 100644 (file)
@@ -179,6 +179,8 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
                        return 0;
                if (!EVP_EncryptInit_ex(&ctx->cctx, NULL, NULL, NULL, zero_iv))
                        return 0;
+               memset(ctx->tbl, 0, bl);
+               ctx->nlast_block = 0;
                return 1;
                }
        /* Initialiase context */