Check-in [d37223bd9d]
Overview
Comment:Fixed missing card reset
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d37223bd9df3beef26401cd2f74ccf7574c269b4
User & Date: rkeene on 2010-05-20 20:08:44
Other Links: manifest | tags
Context
2010-05-20
20:09
CACKey 0.5.1 check-in: a06c5d0dda user: rkeene tags: trunk, 0.5.1
20:08
Fixed missing card reset check-in: d37223bd9d user: rkeene tags: trunk
19:56
CACKey 0.5.0

Updated cackey to support independent releases check-in: 55c89f91a4 user: rkeene tags: trunk, 0.5.0

Changes

Modified cackey.c from [93de8e257c] to [4ec2269ed9].

  2190   2190   
  2191   2191   		return(CACKEY_PCSC_S_TOKENABSENT);
  2192   2192   	}
  2193   2193   
  2194   2194   	atr_len = sizeof(atr);
  2195   2195   	status_ret = SCardStatus(slot->pcsc_card, NULL, &reader_len, &state, &protocol, atr, &atr_len);
  2196   2196   	if (status_ret != SCARD_S_SUCCESS) {
         2197  +		slot->slot_reset = 1;
         2198  +		slot->token_flags = CKF_LOGIN_REQUIRED;
         2199  +
  2197   2200   		if (status_ret == SCARD_W_RESET_CARD) {
  2198   2201   			CACKEY_DEBUG_PRINTF("Reset required, please hold...");
         2202  +
         2203  +
  2199   2204   
  2200   2205   			scard_reconn_ret = SCardReconnect(slot->pcsc_card, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, SCARD_RESET_CARD, &protocol);
  2201   2206   			if (scard_reconn_ret == SCARD_S_SUCCESS) {
  2202   2207   				/* Re-establish transaction, if it was present */
  2203   2208   				if (slot->transaction_depth > 0) {
  2204   2209   					slot->transaction_depth--;
  2205   2210   					cackey_begin_transaction(slot);