fix in C_GetSlotInfo that previously cleared the slotDescription and didnt clear the CKF_TOKEN_PRESENT flag

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@934 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
sth 2003-02-28 12:47:32 +00:00
parent e13720e391
commit 0036545ffa
2 changed files with 6 additions and 5 deletions

View File

@ -201,10 +201,8 @@ CK_RV C_GetSlotInfo(CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo)
rv = slot_get_slot(slotID, &slot);
if (rv == CKR_OK)
rv = card_detect(slot->reader);
if (rv == CKR_TOKEN_NOT_PRESENT) {
if (rv == CKR_TOKEN_NOT_PRESENT)
rv = CKR_OK;
goto out;
}
if (rv == CKR_OK)
memcpy(pInfo, &slot->slot_info, sizeof(CK_SLOT_INFO));

View File

@ -271,6 +271,7 @@ CK_RV slot_token_removed(int id)
int rv, token_was_present;
struct sc_pkcs11_slot *slot;
struct sc_pkcs11_object *object;
CK_SLOT_INFO saved_slot_info;
rv = slot_get_slot(id, &slot);
if (rv != CKR_OK)
@ -294,9 +295,11 @@ CK_RV slot_token_removed(int id)
slot->card->num_slots--;
}
/* Zap everything else */
/* Zap everything else except for the slot_info
* (it contains the reader name, for instance) */
saved_slot_info = slot->slot_info;
memset(slot, 0, sizeof(*slot));
init_slot_info(&slot->slot_info);
slot->slot_info = saved_slot_info;
slot->login_user = -1;
if (token_was_present)