Skip to content

Commit

Permalink
Handle the HSM supporting no mechanisms
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
Danielle Madeley committed Jun 28, 2017
1 parent c8c7520 commit de2ca3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkcs11/_pkcs11.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ class Slot(types.Slot):

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

if count == 0:
return set()

cdef CK_MECHANISM_TYPE [:] mechanisms = CK_ULONG_buffer(count)

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

0 comments on commit de2ca3b

Please sign in to comment.