Skip to content

Commit c9153e3

Browse files
committed
Added the guard to only evict if the keyId is valid
1 parent 27aae75 commit c9153e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/wh_test_crypto.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ static int whTest_CryptoEcc(whClientContext* ctx, int devId, WC_RNG* rng)
630630
}
631631
}
632632
/* Evict server key regardless of test success */
633-
(void)wh_Client_KeyEvict(ctx, keyIdPrivate);
633+
if (!WH_KEYID_ISERASED(keyIdPrivate)) {
634+
(void)wh_Client_KeyEvict(ctx, keyIdPrivate);
635+
}
634636
}
635637

636638
if (ret == 0) {

0 commit comments

Comments
 (0)