Diff

Differences From Artifact [24493cef2c]:

To Artifact [93de8e257c]:


  5095   5095   		return(CKR_OPERATION_NOT_INITIALIZED);
  5096   5096   	}
  5097   5097   
  5098   5098   	switch (cackey_sessions[hSession].sign_mechanism) {
  5099   5099   		case CKM_RSA_PKCS:
  5100   5100   			/* Ask card to sign */
  5101   5101   			CACKEY_DEBUG_PRINTF("Asking to sign from identity %p in session %lu", cackey_sessions[hSession].sign_identity, (unsigned long) hSession);
  5102         -			sigbuflen = cackey_signdecrypt(&cackey_slots[cackey_sessions[hSession].slotID], cackey_sessions[hSession].sign_identity, cackey_sessions[hSession].sign_buf, cackey_sessions[hSession].sign_buflen, sigbuf, sizeof(sigbuf), 1, 0);
         5102  +			sigbuflen = cackey_signdecrypt(&cackey_slots[cackey_sessions[hSession].slotID], cackey_sessions[hSession].sign_identity, cackey_sessions[hSession].sign_buf, cackey_sessions[hSession].sign_bufused, sigbuf, sizeof(sigbuf), 1, 0);
  5103   5103   
  5104   5104   			if (sigbuflen < 0) {
  5105   5105   				/* Signing failed. */
  5106   5106   				retval = CKR_GENERAL_ERROR;
  5107   5107   			} else if (((unsigned long) sigbuflen) > *pulSignatureLen && pSignature) {
  5108   5108   				/* Signed data too large */
  5109   5109   				CACKEY_DEBUG_PRINTF("retval = CKR_BUFFER_TOO_SMALL;  sigbuflen = %lu, pulSignatureLen = %lu", (unsigned long) sigbuflen, (unsigned long) *pulSignatureLen);