Diff

Differences From Artifact [93de8e257c]:

To Artifact [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);