Check-in [468216a439]
Overview
Comment:Moved PC/SC calls within big global lock
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:468216a43911fd0d14528d841ac1688cbfe23c30
User & Date: rkeene on 2010-05-18 15:35:59
Other Links: manifest | tags
Context
2010-05-19
22:14
Updated to set SIGN_RECOVER attribute in all objects check-in: af6a31403e user: rkeene tags: trunk
2010-05-18
15:35
Moved PC/SC calls within big global lock check-in: 468216a439 user: rkeene tags: trunk
15:31
Updated to check for token presence using PC/SC rather than probing the CCC

Updated to cache token label check-in: 491b6e0b00 user: rkeene tags: trunk

Changes

Modified cackey.c from [f66c56f731] to [47f51881b0].

  3161   3161   		CACKEY_DEBUG_PRINTF("Error. Invalid slot requested (%lu), slot not currently active", slotID);
  3162   3162   
  3163   3163   		cackey_mutex_unlock(cackey_biglock);
  3164   3164   
  3165   3165   		return(CKR_SLOT_ID_INVALID);
  3166   3166   	}
  3167   3167   
         3168  +	pInfo->flags = CKF_REMOVABLE_DEVICE | CKF_HW_SLOT;
         3169  +
         3170  +	if (cackey_token_present(&cackey_slots[slotID]) == CACKEY_PCSC_S_TOKENPRESENT) {
         3171  +		pInfo->flags |= CKF_TOKEN_PRESENT;
         3172  +	}
         3173  +
         3174  +	bytes_to_copy = strlen(cackey_slots[slotID].pcsc_reader);
         3175  +	if (sizeof(pInfo->manufacturerID) < bytes_to_copy) {
         3176  +		bytes_to_copy = sizeof(pInfo->manufacturerID);
         3177  +	}
         3178  +	memcpy(pInfo->manufacturerID, cackey_slots[slotID].pcsc_reader, bytes_to_copy);
         3179  +
  3168   3180   	mutex_retval = cackey_mutex_unlock(cackey_biglock);
  3169   3181   	if (mutex_retval != 0) {
  3170   3182   		CACKEY_DEBUG_PRINTF("Error.  Unlocking failed.");
  3171   3183   
  3172   3184   		return(CKR_GENERAL_ERROR);
  3173   3185   	}
  3174   3186   
  3175   3187   	memset(pInfo->slotDescription, ' ', sizeof(pInfo->slotDescription));
  3176   3188   	memcpy(pInfo->slotDescription, slotDescription, sizeof(slotDescription) - 1);
  3177   3189   
  3178   3190   	memset(pInfo->manufacturerID, ' ', sizeof(pInfo->manufacturerID));
  3179   3191   
  3180         -	bytes_to_copy = strlen(cackey_slots[slotID].pcsc_reader);
  3181         -	if (sizeof(pInfo->manufacturerID) < bytes_to_copy) {
  3182         -		bytes_to_copy = sizeof(pInfo->manufacturerID);
  3183         -	}
  3184         -	memcpy(pInfo->manufacturerID, cackey_slots[slotID].pcsc_reader, bytes_to_copy);
  3185         -
  3186         -	pInfo->flags = CKF_REMOVABLE_DEVICE | CKF_HW_SLOT;
  3187         -
  3188         -	if (cackey_token_present(&cackey_slots[slotID]) == CACKEY_PCSC_S_TOKENPRESENT) {
  3189         -		pInfo->flags |= CKF_TOKEN_PRESENT;
  3190         -	}
  3191         -
  3192   3192   	pInfo->hardwareVersion.major = (cackey_getversion() >> 16) & 0xff;
  3193   3193   	pInfo->hardwareVersion.minor = (cackey_getversion() >> 8) & 0xff;
  3194   3194   
  3195   3195   	pInfo->firmwareVersion.major = 0x00;
  3196   3196   	pInfo->firmwareVersion.minor = 0x00;
  3197   3197   
  3198   3198   	CACKEY_DEBUG_PRINTF("Returning CKR_OK (%i)", CKR_OK);