Diff

Differences From Artifact [fd4f0feee5]:

To Artifact [0922233e4d]:


  1442   1442    *         the response data to be discarded.
  1443   1443    *
  1444   1444    * RETURN VALUE
  1445   1445    *     CACKEY_PCSC_S_OK           On success
  1446   1446    *     CACKEY_PCSC_E_GENERIC      On error
  1447   1447    *     CACKEY_PCSC_E_TOKENABSENT  If the sending failed because the token is
  1448   1448    *                                absent
         1449  + *     CACKEY_PCSC_E_RETRY        If something that looks retry'able went
         1450  + *                                wrong -- try the whole transaction over
         1451  + *                                again
  1449   1452    *
  1450   1453    * NOTES
  1451   1454    *     This function will connect to the PC/SC Connection Manager via
  1452   1455    *     cackey_pcsc_connect() if needed.
  1453   1456    *
  1454   1457    *     It will connect to the card in the reader attached to the slot
  1455   1458    *     specified.  It will reconnect to the card if the connection
................................................................................
  2989   2992   				CACKEY_DEBUG_PRINTF("Token absent.  Returning TOKENABSENT");
  2990   2993   
  2991   2994   				cackey_mark_slot_reset(slot);
  2992   2995   
  2993   2996   				return(CACKEY_PCSC_E_TOKENABSENT);
  2994   2997   			}
  2995   2998   
  2996         -			return(-1);
         2999  +			CACKEY_DEBUG_PRINTF("Something went wrong during signing, resetting the slot and hoping for the best.");
         3000  +
         3001  +			cackey_mark_slot_reset(slot);
         3002  +
         3003  +			return(CACKEY_PCSC_E_GENERIC);
  2997   3004   		}
  2998   3005   
  2999   3006   		tmpbuf += bytes_to_send;
  3000   3007   		tmpbuflen -= bytes_to_send;
  3001   3008   
  3002   3009   		outbuf += tmpoutbuflen;
  3003   3010   		outbuflen -= tmpoutbuflen;