Add test case for free ecc/dilithum callback for expected behavior to match existing free callback code paths

This commit is contained in:
night1rider
2026-03-12 14:18:31 -06:00
parent a05a3ed1c2
commit 352daa085b
2 changed files with 32 additions and 0 deletions
+1
View File
@@ -76,6 +76,7 @@ jobs:
'--enable-sessionexport',
'--enable-cryptocb --enable-aesgcm CPPFLAGS="-DWOLF_CRYPTO_CB_AES_SETKEY -DWOLF_CRYPTO_CB_FREE"',
'--disable-tls --enable-cryptocb --enable-aesgcm CPPFLAGS="-DWOLF_CRYPTO_CB_AES_SETKEY -DWOLF_CRYPTO_CB_FREE"',
'--enable-all --enable-dilithium --enable-cryptocb --enable-cryptocbutils --enable-pkcallbacks',
'--enable-cryptocb --enable-aesgcm CPPFLAGS="-DWOLF_CRYPTO_CB_AES_SETKEY"',
'--disable-examples CPPFLAGS=-DWOLFSSL_NO_MALLOC',
'CPPFLAGS=-DNO_WOLFSSL_CLIENT',
+31
View File
@@ -65407,6 +65407,37 @@ static int myCryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
ret = 0;
break;
}
#endif
default:
ret = WC_NO_ERR_TRACE(NOT_COMPILED_IN);
break;
}
}
else if (info->free.algo == WC_ALGO_TYPE_PK) {
switch (info->free.type) {
#ifdef HAVE_ECC
case WC_PK_TYPE_EC_KEYGEN:
{
ecc_key* ecc = (ecc_key*)info->free.obj;
ecc->devId = INVALID_DEVID;
wc_ecc_free(ecc);
ret = 0;
break;
}
#endif
#ifdef HAVE_DILITHIUM
case WC_PK_TYPE_PQC_SIG_KEYGEN:
{
if (info->free.subType ==
WC_PQC_SIG_TYPE_DILITHIUM) {
dilithium_key* dil =
(dilithium_key*)info->free.obj;
dil->devId = INVALID_DEVID;
wc_dilithium_free(dil);
ret = 0;
}
break;
}
#endif
default:
ret = WC_NO_ERR_TRACE(NOT_COMPILED_IN);