@@ -1439,10 +1439,13 @@ * RETURN VALUE * CACKEY_PCSC_S_OK On success * CACKEY_PCSC_E_GENERIC On error * CACKEY_PCSC_E_TOKENABSENT If the sending failed because the token is * absent + * CACKEY_PCSC_E_RETRY If something that looks retry'able went + * wrong -- try the whole transaction over + * again * * NOTES * This function will connect to the PC/SC Connection Manager via * cackey_pcsc_connect() if needed. * @@ -2986,11 +2989,15 @@ cackey_mark_slot_reset(slot); return(CACKEY_PCSC_E_TOKENABSENT); } - return(-1); + CACKEY_DEBUG_PRINTF("Something went wrong during signing, resetting the slot and hoping for the best."); + + cackey_mark_slot_reset(slot); + + return(CACKEY_PCSC_E_GENERIC); } tmpbuf += bytes_to_send; tmpbuflen -= bytes_to_send;