From d1b6ddca751c855987287dbc89a6edf1648d4d63 Mon Sep 17 00:00:00 2001 From: Kareem Date: Thu, 23 Apr 2026 16:05:01 -0700 Subject: [PATCH 1/2] Properly handle fallback cipher type case in wc_Pkcs11_CryptoDevCb. Thanks to Zou Dikai for the report. --- wolfcrypt/src/wc_pkcs11.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wolfcrypt/src/wc_pkcs11.c b/wolfcrypt/src/wc_pkcs11.c index 569bc5cb340..9ae5abe7cdc 100644 --- a/wolfcrypt/src/wc_pkcs11.c +++ b/wolfcrypt/src/wc_pkcs11.c @@ -6525,6 +6525,9 @@ int wc_Pkcs11_CryptoDevCb(int devId, wc_CryptoInfo* info, void* ctx) } break; #endif + default: + ret = NOT_COMPILED_IN; + break; } #else ret = NOT_COMPILED_IN; From 3f1c6bdac89339975d5972dbfdd69db5c7c8abdb Mon Sep 17 00:00:00 2001 From: Kareem Date: Wed, 6 May 2026 15:13:48 -0700 Subject: [PATCH 2/2] Code review feedback. --- wolfcrypt/src/wc_pkcs11.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wolfcrypt/src/wc_pkcs11.c b/wolfcrypt/src/wc_pkcs11.c index 9ae5abe7cdc..1d5e1c40b0f 100644 --- a/wolfcrypt/src/wc_pkcs11.c +++ b/wolfcrypt/src/wc_pkcs11.c @@ -6304,6 +6304,7 @@ static int Pkcs11GetCert(Pkcs11Session* session, wc_CryptoInfo* info) { * @param [in] info Cryptographic operation data. * @param [in] ctx Context data for device - the token object. * @return WC_HW_E when a PKCS#11 library call fails. + * @return NOT_COMPILED_IN when an unsupported operation is requested. * @return 0 on success. */ int wc_Pkcs11_CryptoDevCb(int devId, wc_CryptoInfo* info, void* ctx)