Skip to content

Commit b20630e

Browse files
author
Sowards
committed
pkcs11/_pkcs11.pyx: return Slot in wait_for_slot_event
1 parent 6c7f3e9 commit b20630e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkcs11/_pkcs11.pyx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,16 @@ cdef class lib:
15601560
with nogil:
15611561
assertRV(_funclist.C_WaitForSlotEvent(flag, &slot_id, NULL))
15621562

1563-
return slot_id
1563+
cdef CK_SLOT_INFO info
1564+
1565+
with nogil:
1566+
assertRV(_funclist.C_GetSlotInfo(slot_id, &info))
1567+
1568+
slotDescription = info.slotDescription[:sizeof(info.slotDescription)]
1569+
manufacturerID = info.manufacturerID[:sizeof(info.manufacturerID)]
1570+
1571+
return Slot(self, slot_id, slotDescription, manufacturerID,
1572+
info.hardwareVersion, info.firmwareVersion, info.flags)
15641573

15651574
def reinitialize(self):
15661575
if _funclist != NULL:

0 commit comments

Comments
 (0)