implemented sloppy initialization for C_GetSlotInfo
Makes things work for Java and closes #523
This commit is contained in:
parent
c5cf4f69a2
commit
3307dd6f45
@ -485,6 +485,15 @@ CK_RV C_GetSlotInfo(CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo)
|
||||
|
||||
sc_log(context, "C_GetSlotInfo(0x%lx)", slotID);
|
||||
|
||||
if (1 <= list_size(&virtual_slots)) {
|
||||
/* Most likely virtual_slots only contains the hotplug slot and has not
|
||||
* been initialized because the caller has *not* called C_GetSlotList
|
||||
* before C_GetSlotInfo, as required by PKCS#11. Initialize
|
||||
* virtual_slots to make things work and hope the caller knows what
|
||||
* it's doing... */
|
||||
card_detect_all();
|
||||
}
|
||||
|
||||
rv = slot_get_slot(slotID, &slot);
|
||||
sc_log(context, "C_GetSlotInfo() get slot rv %i", rv);
|
||||
if (rv == CKR_OK) {
|
||||
|
Loading…
Reference in New Issue
Block a user