Check-in [84aaf35a0e]
Overview
Comment:Updated to call SCardDisconnect if we detect a previously connected slot -- this fixes a regression in the previous commit where a smartcard would not function after being inserted, removed, and reinserted
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:84aaf35a0e80fcd1aeab5197c3c576b1957a5505
User & Date: rkeene on 2010-07-23 21:58:27
Other Links: manifest | tags
Context
2010-07-23
22:03
CACKey 0.5.17 check-in: 45a6d087db user: rkeene tags: trunk, 0.5.17
21:58
Updated to call SCardDisconnect if we detect a previously connected slot -- this fixes a regression in the previous commit where a smartcard would not function after being inserted, removed, and reinserted check-in: 84aaf35a0e user: rkeene tags: trunk
21:46
Consolidated slot resetting into a single function.

Updated slot resetting to invalidate slot PC/SC handle. check-in: 1edf82bc16 user: rkeene tags: trunk

Changes

Modified cackey.c from [6b202c653c] to [831193de85].

   839    839    */
   840    840   static void cackey_mark_slot_reset(struct cackey_slot *slot) {
   841    841   	if (slot == NULL) {
   842    842   		return;
   843    843   	}
   844    844   
   845    845   	CACKEY_DEBUG_PRINTF("Called.");
          846  +
          847  +	if (slot->pcsc_card_connected) {
          848  +		SCardDisconnect(slot->pcsc_card, SCARD_LEAVE_CARD);
          849  +	}
   846    850   
   847    851   	slot->slot_reset = 1;
   848    852   	slot->pcsc_card_connected = 0;
   849    853   	slot->token_flags = CKF_LOGIN_REQUIRED;
   850    854   
   851    855   	CACKEY_DEBUG_PRINTF("Returning.");
   852    856