[PATCH] crypto: Fix C_GetSlotList slot_count type mismatch

8 views
Skip to first unread message

Bastian Germann

unread,
May 29, 2026, 8:24:06 PM (6 days ago) May 29
to swup...@googlegroups.com, Bastian Germann
Use CK_ULONG instead of size_t for the slot_count argument passed to
C_GetSlotList, which expects CK_ULONG * (unsigned long *).

Fixes: [-Wincompatible-pointer-types] build error on 32-bit targets where
size_t is unsigned int, not unsigned long.

Signed-off-by: Bastian Germann <ba...@debian.org>
---
crypto/swupdate_decrypt_pkcs11_p11kit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/swupdate_decrypt_pkcs11_p11kit.c b/crypto/swupdate_decrypt_pkcs11_p11kit.c
index 429c397a..6bcb5d79 100644
--- a/crypto/swupdate_decrypt_pkcs11_p11kit.c
+++ b/crypto/swupdate_decrypt_pkcs11_p11kit.c
@@ -23,7 +23,7 @@ static CK_SLOT_ID find_slot(CK_FUNCTION_LIST_PTR module, P11KitUri *uri)
if (slot_id != (CK_SLOT_ID)-1)
return slot_id;

- size_t slot_count;
+ CK_ULONG slot_count;
rv = module->C_GetSlotList(1, NULL_PTR, &slot_count);
if (rv != CKR_OK)
return (CK_SLOT_ID)-1;
Reply all
Reply to author
Forward
0 new messages