Index: cackey.c ================================================================== --- cackey.c +++ cackey.c @@ -3858,12 +3858,11 @@ return(CKR_BUFFER_TOO_SMALL); } pMechanismList[0] = CKM_RSA_PKCS; - pMechanismList[1] = CKM_SHA1_RSA_PKCS; - *pulCount = 2; + *pulCount = 1; CACKEY_DEBUG_PRINTF("Returning CKR_OK (%i)", CKR_OK); return(CKR_OK); } @@ -3911,27 +3910,16 @@ CACKEY_DEBUG_PRINTF("Error. Unlocking failed."); return(CKR_GENERAL_ERROR); } - /* XXX: This is untested, and further I'm not really sure if this is correct. */ switch (type) { case CKM_RSA_PKCS: pInfo->ulMinKeySize = 512; pInfo->ulMaxKeySize = 8192; pInfo->flags = CKF_HW | CKF_ENCRYPT | CKF_DECRYPT | CKF_SIGN | CKF_VERIFY; break; - case CKM_RSA_X_509: - pInfo->ulMinKeySize = 512; - pInfo->ulMaxKeySize = 8192; - pInfo->flags = CKF_HW | CKF_ENCRYPT | CKF_DECRYPT | CKF_SIGN | CKF_VERIFY; - break; - case CKM_SHA1_RSA_PKCS: - pInfo->ulMinKeySize = 512; - pInfo->ulMaxKeySize = 8192; - pInfo->flags = CKF_HW | CKF_SIGN | CKF_VERIFY; - break; } CACKEY_DEBUG_PRINTF("Returning CKR_OK (%i)", CKR_OK); return(CKR_OK); @@ -5518,12 +5506,12 @@ CACKEY_DEBUG_PRINTF("Error. pMechanism is NULL."); return(CKR_ARGUMENTS_BAD); } - if (pMechanism->mechanism != CKM_RSA_PKCS && pMechanism->mechanism != CKM_SHA1_RSA_PKCS) { - CACKEY_DEBUG_PRINTF("Error. pMechanism->mechanism not specified as CKM_RSA_PKCS or CKM_SHA1_RSA_PKCS"); + if (pMechanism->mechanism != CKM_RSA_PKCS) { + CACKEY_DEBUG_PRINTF("Error. pMechanism->mechanism not specified as CKM_RSA_PKCS"); return(CKR_MECHANISM_PARAM_INVALID); } if (hSession == 0 || hSession >= (sizeof(cackey_sessions) / sizeof(cackey_sessions[0]))) { @@ -5747,18 +5735,10 @@ memcpy(cackey_sessions[hSession].sign_buf + cackey_sessions[hSession].sign_bufused, pPart, ulPartLen); cackey_sessions[hSession].sign_bufused += ulPartLen; break; - case CKM_SHA1_RSA_PKCS: - /* XXX: Accumulate into a SHA1 hash */ - cackey_mutex_unlock(cackey_biglock); - - CACKEY_DEBUG_PRINTF("Returning CKR_FUNCTION_NOT_SUPPORTED (%i)", CKR_FUNCTION_NOT_SUPPORTED); - - return(CKR_FUNCTION_NOT_SUPPORTED); - break; } mutex_retval = cackey_mutex_unlock(cackey_biglock); if (mutex_retval != 0) { CACKEY_DEBUG_PRINTF("Error. Unlocking failed."); @@ -5873,18 +5853,10 @@ retval = CKR_OK; } break; - case CKM_SHA1_RSA_PKCS: - /* XXX: Accumulate into a SHA1 hash */ - cackey_mutex_unlock(cackey_biglock); - - CACKEY_DEBUG_PRINTF("Returning CKR_FUNCTION_NOT_SUPPORTED (%i)", CKR_FUNCTION_NOT_SUPPORTED); - - return(CKR_FUNCTION_NOT_SUPPORTED); - break; } if (terminate_sign) { if (cackey_sessions[hSession].sign_buf) { free(cackey_sessions[hSession].sign_buf);