Diff

Differences From Artifact [609a23ada9]:

To Artifact [029de9965c]:


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