Skip to content

Commit 643d4a5

Browse files
add init of cmac in test case
1 parent 50e408e commit 643d4a5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/wh_test_crypto.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3717,6 +3717,11 @@ static int whTestCrypto_Cmac(whClientContext* ctx, int devId, WC_RNG* rng)
37173717
ret);
37183718
break;
37193719
}
3720+
ret = wc_InitCmac_ex(cmac, NULL, 0, WC_CMAC_AES, NULL, NULL, devId);
3721+
if (ret != 0) {
3722+
WH_ERROR_PRINT("Failed wc_InitCmac_ex (gen) tc=%d %d\n", i, ret);
3723+
break;
3724+
}
37203725
ret = wh_Client_CmacSetKeyId(cmac, keyId);
37213726
if (ret != 0) {
37223727
WH_ERROR_PRINT("Failed to wh_Client_CmacSetKeyId (gen) tc=%d %d\n",
@@ -3765,6 +3770,7 @@ static int whTestCrypto_Cmac(whClientContext* ctx, int devId, WC_RNG* rng)
37653770
WH_ERROR_PRINT("Failed wc_AesCmacVerify_ex tc=%d %d\n", i, ret);
37663771
break;
37673772
}
3773+
wc_CmacFree(cmac);
37683774
ret = wh_Client_KeyEvict(ctx, keyId);
37693775
if (ret != 0) {
37703776
WH_ERROR_PRINT("Failed to wh_Client_KeyEvict (ver) tc=%d %d\n", i,

0 commit comments

Comments
 (0)