Skip to content

Commit de2ca3b

Browse files
author
Danielle Madeley
committed
Handle the HSM supporting no mechanisms
Fixes pyauth#2
1 parent c8c7520 commit de2ca3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkcs11/_pkcs11.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ class Slot(types.Slot):
188188

189189
assertRV(C_GetMechanismList(self.slot_id, NULL, &count))
190190

191+
if count == 0:
192+
return set()
193+
191194
cdef CK_MECHANISM_TYPE [:] mechanisms = CK_ULONG_buffer(count)
192195

193196
assertRV(C_GetMechanismList(self.slot_id, &mechanisms[0], &count))

0 commit comments

Comments
 (0)