tpm2: Reset the internal CMAC state when starting a CMAC

Initialize the internal CMAC state to 0s when starting a CMAC.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-05-09 21:42:59 -04:00 committed by Stefan Berger
parent a829ddbdeb
commit 137b9da5c8

View File

@ -87,6 +87,7 @@ CryptCmacStart(
//
if(macAlg != TPM_ALG_CMAC)
return 0;
MemorySet(cState, 0, sizeof(*cState));
// set up the encryption algorithm and parameters
cState->symAlg = def->algorithm;
cState->keySizeBits = def->keyBits.sym;