Check-in [bd977f41d5]
Overview
Comment:Renamed our C_Login() function with a mutex arg to be a less annoying name
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:bd977f41d57545e27dda54c15a11c1a1c3590dd8
User & Date: rkeene on 2016-02-12 03:47:32
Other Links: manifest | tags
Context
2016-02-12
03:47
ChromeOS: Disable DOD certs getting built-in to CACKey since they will never get used anyway check-in: 8c99b5e102 user: rkeene tags: trunk
03:47
Renamed our C_Login() function with a mutex arg to be a less annoying name check-in: bd977f41d5 user: rkeene tags: trunk
2016-02-11
18:33
ChromeOS: Updated to pass messages to the PCSC-NACL plugin if they do not belong to us check-in: b7dc336d0f user: rkeene tags: trunk
Changes

Modified cackey.c from [0be1a03436] to [b22c79f8b7].

  5723   5723   	}
  5724   5724   
  5725   5725   	CACKEY_DEBUG_PRINTF("Returning CKR_FUNCTION_NOT_SUPPORTED (%i)", CKR_FUNCTION_NOT_SUPPORTED);
  5726   5726   
  5727   5727   	return(CKR_FUNCTION_NOT_SUPPORTED);
  5728   5728   }
  5729   5729   
  5730         -CK_DEFINE_FUNCTION(CK_RV, _C_LoginMutexArg)(CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen, int lock_mutex) {
         5730  +CK_DEFINE_FUNCTION(CK_RV, C_LoginMutexArg)(CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen, int lock_mutex) {
  5731   5731   	CK_SLOT_ID slotID;
  5732   5732   	cackey_ret get_pin_ret;
  5733   5733   	char pinbuf[64];
  5734   5734   	int mutex_retval;
  5735   5735   	int tries_remaining;
  5736   5736   	int login_ret;
  5737   5737   
................................................................................
  5865   5865   
  5866   5866   	CACKEY_DEBUG_PRINTF("Returning CKR_OK (%i)", CKR_OK);
  5867   5867   
  5868   5868   	return(CKR_OK);
  5869   5869   }
  5870   5870   
  5871   5871   CK_DEFINE_FUNCTION(CK_RV, C_Login)(CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen) {
  5872         -	return(_C_LoginMutexArg(hSession, userType, pPin, ulPinLen, 1));
         5872  +	return(C_LoginMutexArg(hSession, userType, pPin, ulPinLen, 1));
  5873   5873   }
  5874   5874   
  5875   5875   CK_DEFINE_FUNCTION(CK_RV, C_Logout)(CK_SESSION_HANDLE hSession) {
  5876   5876   	CK_SLOT_ID slotID;
  5877   5877   	int mutex_retval;
  5878   5878   
  5879   5879   	CACKEY_DEBUG_PRINTF("Called.");
................................................................................
  6849   6849   
  6850   6850   	switch (cackey_sessions[hSession].decrypt_mechanism) {
  6851   6851   		case CKM_RSA_PKCS:
  6852   6852   			/* Ask card to decrypt */
  6853   6853   			buflen = cackey_signdecrypt(&cackey_slots[slotID], cackey_sessions[hSession].decrypt_identity, pEncryptedPart, ulEncryptedPartLen, buf, sizeof(buf), 0, 1);
  6854   6854   
  6855   6855   			if (buflen == CACKEY_PCSC_E_NEEDLOGIN && cackey_pin_command != NULL) {
  6856         -				if (_C_LoginMutexArg(hSession, CKU_USER, NULL, 0, 0) == CKR_OK) {
         6856  +				if (C_LoginMutexArg(hSession, CKU_USER, NULL, 0, 0) == CKR_OK) {
  6857   6857   					buflen = cackey_signdecrypt(&cackey_slots[slotID], cackey_sessions[hSession].decrypt_identity, pEncryptedPart, ulEncryptedPartLen, buf, sizeof(buf), 0, 1);
  6858   6858   				}
  6859   6859   			}
  6860   6860   
  6861   6861   			if (buflen < 0) {
  6862   6862   				/* Decryption failed. */
  6863   6863   				if (buflen == CACKEY_PCSC_E_NEEDLOGIN) {
................................................................................
  7398   7398   	switch (cackey_sessions[hSession].sign_mechanism) {
  7399   7399   		case CKM_RSA_PKCS:
  7400   7400   			/* Ask card to sign */
  7401   7401   			CACKEY_DEBUG_PRINTF("Asking to sign from identity %p in session %lu", (void *) cackey_sessions[hSession].sign_identity, (unsigned long) hSession);
  7402   7402   			sigbuflen = cackey_signdecrypt(&cackey_slots[slotID], cackey_sessions[hSession].sign_identity, cackey_sessions[hSession].sign_buf, cackey_sessions[hSession].sign_bufused, sigbuf, sizeof(sigbuf), 1, 0);
  7403   7403   
  7404   7404   			if (sigbuflen == CACKEY_PCSC_E_NEEDLOGIN && cackey_pin_command != NULL) {
  7405         -				if (_C_LoginMutexArg(hSession, CKU_USER, NULL, 0, 0) == CKR_OK) {
         7405  +				if (C_LoginMutexArg(hSession, CKU_USER, NULL, 0, 0) == CKR_OK) {
  7406   7406   					sigbuflen = cackey_signdecrypt(&cackey_slots[slotID], cackey_sessions[hSession].sign_identity, cackey_sessions[hSession].sign_buf, cackey_sessions[hSession].sign_bufused, sigbuf, sizeof(sigbuf), 1, 0);
  7407   7407   				}
  7408   7408   			}
  7409   7409   
  7410   7410   			if (sigbuflen < 0) {
  7411   7411   				/* Signing failed. */
  7412   7412   				if (sigbuflen == CACKEY_PCSC_E_NEEDLOGIN) {