/titanic_50/usr/src/lib/pkcs11/pkcs11_kernel/common/ |
H A D | kernelVerify.c | 42 kernel_object_t *key_p; in C_VerifyInit() local 66 HANDLE2OBJECT(hKey, key_p, rv); in C_VerifyInit() 73 if (key_p->is_lib_obj && !(key_p->bool_attr_mask & VERIFY_BOOL_ON)) { in C_VerifyInit() 87 if (!key_p->is_lib_obj) { in C_VerifyInit() 89 verify_init.vi_key.ck_obj_id = key_p->k_handle; in C_VerifyInit() 91 if (key_p->class == CKO_SECRET_KEY) { in C_VerifyInit() 94 get_symmetric_key_value(key_p); in C_VerifyInit() 100 OBJ_SEC(key_p)->sk_value_len << 3; in C_VerifyInit() 102 } else if (key_p->key_type == CKK_RSA) { in C_VerifyInit() 103 if (get_rsa_public_key(key_p, &verify_init.vi_key) != in C_VerifyInit() [all …]
|
H A D | kernelSign.c | 41 kernel_object_t *key_p; in C_SignInit() local 66 HANDLE2OBJECT(hKey, key_p, rv); in C_SignInit() 73 if (key_p->is_lib_obj && !(key_p->bool_attr_mask & SIGN_BOOL_ON)) { in C_SignInit() 90 if (!key_p->is_lib_obj) { in C_SignInit() 92 sign_init.si_key.ck_obj_id = key_p->k_handle; in C_SignInit() 94 if (key_p->class == CKO_SECRET_KEY) { in C_SignInit() 97 get_symmetric_key_value(key_p); in C_SignInit() 103 OBJ_SEC(key_p)->sk_value_len << 3; in C_SignInit() 105 } else if (key_p->key_type == CKK_RSA) { in C_SignInit() 106 rv = get_rsa_private_key(key_p, &sign_init.si_key); in C_SignInit() [all …]
|
H A D | kernelDecrypt.c | 40 kernel_decrypt_init(kernel_session_t *session_p, kernel_object_t *key_p, in kernel_decrypt_init() argument 50 if (key_p->is_lib_obj && !(key_p->bool_attr_mask & DECRYPT_BOOL_ON)) { in kernel_decrypt_init() 70 if (!key_p->is_lib_obj) { in kernel_decrypt_init() 72 decrypt_init.di_key.ck_obj_id = key_p->k_handle; in kernel_decrypt_init() 74 if (key_p->class == CKO_SECRET_KEY) { in kernel_decrypt_init() 77 get_symmetric_key_value(key_p); in kernel_decrypt_init() 84 OBJ_SEC(key_p)->sk_value_len << 3; in kernel_decrypt_init() 86 } else if (key_p->key_type == CKK_RSA) { in kernel_decrypt_init() 87 if (get_rsa_private_key(key_p, &decrypt_init.di_key) != in kernel_decrypt_init() 123 if (key_p->is_lib_obj) { in kernel_decrypt_init() [all …]
|
H A D | kernelEncrypt.c | 43 kernel_object_t *key_p; in C_EncryptInit() local 67 HANDLE2OBJECT(hKey, key_p, rv); in C_EncryptInit() 74 if (key_p->is_lib_obj && !(key_p->bool_attr_mask & ENCRYPT_BOOL_ON)) { in C_EncryptInit() 90 if (!key_p->is_lib_obj) { in C_EncryptInit() 92 encrypt_init.ei_key.ck_obj_id = key_p->k_handle; in C_EncryptInit() 94 if (key_p->class == CKO_SECRET_KEY) { in C_EncryptInit() 97 get_symmetric_key_value(key_p); in C_EncryptInit() 103 OBJ_SEC(key_p)->sk_value_len << 3; in C_EncryptInit() 105 } else if (key_p->key_type == CKK_RSA) { in C_EncryptInit() 106 if (get_rsa_public_key(key_p, &encrypt_init.ei_key) != in C_EncryptInit() [all …]
|
H A D | kernelSoftCommon.c | 110 soft_object_t *key_p; in do_soft_hmac_init() local 128 key_p = &keyobj; in do_soft_hmac_init() 129 bzero(key_p, sizeof (soft_object_t)); in do_soft_hmac_init() 130 key_p->class = CKO_SECRET_KEY; in do_soft_hmac_init() 131 key_p->key_type = CKK_GENERIC_SECRET; in do_soft_hmac_init() 134 OBJ_SEC(key_p) = &skeyobj; in do_soft_hmac_init() 135 OBJ_SEC_VALUE(key_p) = kval; in do_soft_hmac_init() 136 OBJ_SEC_VALUE_LEN(key_p) = klen; in do_soft_hmac_init() 139 key_p, opflag & OP_SIGN); in do_soft_hmac_init()
|
H A D | kernelDigest.c | 403 kernel_object_t *key_p; in C_DigestKey() local 423 HANDLE2OBJECT(hKey, key_p, rv); in C_DigestKey() 434 if (key_p->is_lib_obj && (key_p->class != CKO_SECRET_KEY)) { in C_DigestKey() 452 OBJ_REFRELE(key_p); in C_DigestKey() 463 if (key_p->is_lib_obj) { in C_DigestKey() 471 if (!key_p->is_lib_obj) { in C_DigestKey() 477 digest_key.dk_key.ck_obj_id = key_p->k_handle; in C_DigestKey() 490 ulPartLen = OBJ_SEC_VALUE_LEN(key_p); in C_DigestKey() 496 pPart = (CK_BYTE_PTR) OBJ_SEC_VALUE(key_p); in C_DigestKey() 536 OBJ_REFRELE(key_p); in C_DigestKey() [all …]
|
/titanic_50/usr/src/lib/pkcs11/pkcs11_softtoken/common/ |
H A D | softDESCrypt.c | 45 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, in soft_des_crypt_init_common() argument 58 if (key_p->key_type == CKK_DES) in soft_des_crypt_init_common() 69 soft_des_ctx->key_type = key_p->key_type; in soft_des_crypt_init_common() 91 if (!(key_p->bool_attr_mask & SENSITIVE_BOOL_ON)) { in soft_des_crypt_init_common() 92 if (OBJ_KEY_SCHED(key_p) == NULL) { in soft_des_crypt_init_common() 94 (void) pthread_mutex_lock(&key_p->object_mutex); in soft_des_crypt_init_common() 95 if (OBJ_KEY_SCHED(key_p) == NULL) { in soft_des_crypt_init_common() 96 if (key_p->key_type == CKK_DES) in soft_des_crypt_init_common() 102 &key_p->object_mutex); in soft_des_crypt_init_common() 107 if (key_p->key_type == CKK_DES) in soft_des_crypt_init_common() [all …]
|
H A D | softBlowfishCrypt.c | 39 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, boolean_t encrypt) { in soft_blowfish_crypt_init_common() argument 78 if (!(key_p->bool_attr_mask & SENSITIVE_BOOL_ON)) { in soft_blowfish_crypt_init_common() 79 if (OBJ_KEY_SCHED(key_p) == NULL) { in soft_blowfish_crypt_init_common() 82 (void) pthread_mutex_lock(&key_p->object_mutex); in soft_blowfish_crypt_init_common() 83 if (OBJ_KEY_SCHED(key_p) == NULL) { in soft_blowfish_crypt_init_common() 87 &key_p->object_mutex); in soft_blowfish_crypt_init_common() 92 blowfish_init_keysched(OBJ_SEC_VALUE(key_p), in soft_blowfish_crypt_init_common() 93 (OBJ_SEC_VALUE_LEN(key_p) * 8), ks); in soft_blowfish_crypt_init_common() 95 OBJ_KEY_SCHED_LEN(key_p) = size; in soft_blowfish_crypt_init_common() 96 OBJ_KEY_SCHED(key_p) = ks; in soft_blowfish_crypt_init_common() [all …]
|
H A D | softDecryptUtil.c | 83 soft_object_t *key_p) in soft_decrypt_init() argument 92 if (key_p->key_type != CKK_DES) { in soft_decrypt_init() 100 if ((key_p->key_type != CKK_DES2) && in soft_decrypt_init() 101 (key_p->key_type != CKK_DES3)) { in soft_decrypt_init() 108 key_p, B_FALSE)); in soft_decrypt_init() 113 if (key_p->key_type != CKK_DES) { in soft_decrypt_init() 124 if ((key_p->key_type != CKK_DES2) && in soft_decrypt_init() 125 (key_p->key_type != CKK_DES3)) { in soft_decrypt_init() 136 key_p, B_FALSE); in soft_decrypt_init() 151 soft_des_ctx->ivec, key_p->key_type); in soft_decrypt_init() [all …]
|
H A D | softEncryptUtil.c | 58 pMechanism, soft_object_t *key_p) in soft_encrypt_init_internal() argument 74 rv = soft_encrypt_init(session_p, pMechanism, key_p); in soft_encrypt_init_internal() 107 soft_object_t *key_p) in soft_encrypt_init() argument 116 if (key_p->key_type != CKK_DES) { in soft_encrypt_init() 123 if ((key_p->key_type != CKK_DES2) && in soft_encrypt_init() 124 (key_p->key_type != CKK_DES3)) { in soft_encrypt_init() 130 key_p, B_TRUE)); in soft_encrypt_init() 135 if (key_p->key_type != CKK_DES) { in soft_encrypt_init() 147 if ((key_p->key_type != CKK_DES2) && in soft_encrypt_init() 148 (key_p->key_type != CKK_DES3)) { in soft_encrypt_init() [all …]
|
H A D | softAESCrypt.c | 43 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, in soft_aes_crypt_init_common() argument 83 if (!(key_p->bool_attr_mask & SENSITIVE_BOOL_ON)) { in soft_aes_crypt_init_common() 84 if (OBJ_KEY_SCHED(key_p) == NULL) { in soft_aes_crypt_init_common() 87 (void) pthread_mutex_lock(&key_p->object_mutex); in soft_aes_crypt_init_common() 88 if (OBJ_KEY_SCHED(key_p) == NULL) { in soft_aes_crypt_init_common() 92 &key_p->object_mutex); in soft_aes_crypt_init_common() 98 aes_init_keysched(OBJ_SEC_VALUE(key_p), (uint_t) in soft_aes_crypt_init_common() 99 (OBJ_SEC_VALUE_LEN(key_p) * 8), ks); in soft_aes_crypt_init_common() 101 aes_init_keysched(OBJ_SEC_VALUE(key_p), in soft_aes_crypt_init_common() 102 (OBJ_SEC_VALUE_LEN(key_p) * 8), ks); in soft_aes_crypt_init_common() [all …]
|
H A D | softVerify.c | 41 soft_object_t *key_p; in C_VerifyInit() local 58 HANDLE2OBJECT(hKey, key_p, rv); in C_VerifyInit() 64 if (!(key_p->bool_attr_mask & VERIFY_BOOL_ON)) { in C_VerifyInit() 87 rv = soft_verify_init(session_p, pMechanism, key_p); in C_VerifyInit() 96 OBJ_REFRELE(key_p); in C_VerifyInit() 269 soft_object_t *key_p; in C_VerifyRecoverInit() local 286 HANDLE2OBJECT(hKey, key_p, rv); in C_VerifyRecoverInit() 292 if (!(key_p->bool_attr_mask & VERIFY_RECOVER_BOOL_ON)) { in C_VerifyRecoverInit() 315 rv = soft_verify_recover_init(session_p, pMechanism, key_p); in C_VerifyRecoverInit() 324 OBJ_REFRELE(key_p); in C_VerifyRecoverInit()
|
H A D | softSign.c | 41 soft_object_t *key_p; in C_SignInit() local 58 HANDLE2OBJECT(hKey, key_p, rv); in C_SignInit() 64 if (!(key_p->bool_attr_mask & SIGN_BOOL_ON)) { in C_SignInit() 87 rv = soft_sign_init(session_p, pMechanism, key_p); in C_SignInit() 96 OBJ_REFRELE(key_p); in C_SignInit() 298 soft_object_t *key_p; in C_SignRecoverInit() local 315 HANDLE2OBJECT(hKey, key_p, rv); in C_SignRecoverInit() 321 if (!(key_p->bool_attr_mask & SIGN_RECOVER_BOOL_ON)) { in C_SignRecoverInit() 344 rv = soft_sign_recover_init(session_p, pMechanism, key_p); in C_SignRecoverInit() 353 OBJ_REFRELE(key_p); in C_SignRecoverInit()
|
H A D | softARCFourCrypt.c | 45 soft_object_t *key_p, boolean_t encrypt) in soft_arcfour_crypt_init() argument 55 keyvallen = (int)OBJ_SEC_VALUE_LEN(key_p); in soft_arcfour_crypt_init() 57 keyvallen = OBJ_SEC_VALUE_LEN(key_p); in soft_arcfour_crypt_init() 64 keyval = OBJ_SEC_VALUE(key_p); in soft_arcfour_crypt_init()
|
H A D | softVerifyUtil.c | 57 soft_object_t *key_p) in soft_verify_init() argument 76 pMechanism, key_p, B_FALSE)); in soft_verify_init() 87 key_p, B_FALSE)); in soft_verify_init() 93 key_p, B_FALSE)); in soft_verify_init() 99 key_p, B_FALSE)); in soft_verify_init() 105 key_p, B_FALSE)); in soft_verify_init() 421 soft_object_t *key_p) in soft_verify_recover_init() argument 430 key_p, B_FALSE)); in soft_verify_recover_init()
|
H A D | softEC.c | 88 check_key(soft_object_t *key_p, boolean_t sign) in check_key() argument 94 if ((key_p->class != CKO_PRIVATE_KEY) || in check_key() 95 (key_p->key_type != CKK_EC)) in check_key() 98 p = OBJ_PRI_EC_VALUE(key_p); in check_key() 107 if ((key_p->class != CKO_PUBLIC_KEY) || in check_key() 108 (key_p->key_type != CKK_EC)) in check_key() 111 p = OBJ_PUB_EC_POINT(key_p); in check_key() 331 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, in soft_ecc_sign_verify_init_common() argument 343 if ((rv = check_key(key_p, sign)) != CKR_OK) in soft_ecc_sign_verify_init_common() 364 (void) pthread_mutex_lock(&key_p->object_mutex); in soft_ecc_sign_verify_init_common() [all …]
|
H A D | softSignUtil.c | 56 soft_object_t *key_p) in soft_sign_init() argument 75 pMechanism, key_p, B_TRUE)); in soft_sign_init() 86 key_p, B_TRUE)); in soft_sign_init() 92 key_p, B_TRUE)); in soft_sign_init() 98 key_p, B_TRUE)); in soft_sign_init() 104 key_p, B_TRUE)); in soft_sign_init() 398 soft_object_t *key_p) in soft_sign_recover_init() argument 407 key_p, B_TRUE)); in soft_sign_recover_init()
|
H A D | softDigest.c | 287 soft_object_t *key_p; in C_DigestKey() local 302 HANDLE2OBJECT(hKey, key_p, rv); in C_DigestKey() 318 OBJ_REFRELE(key_p); in C_DigestKey() 332 rv = soft_digest_key(session_p, key_p); in C_DigestKey() 340 OBJ_REFRELE(key_p); in C_DigestKey() 345 OBJ_REFRELE(key_p); in C_DigestKey()
|
H A D | softDecrypt.c | 41 soft_object_t *key_p; in C_DecryptInit() local 58 HANDLE2OBJECT(hKey, key_p, rv); in C_DecryptInit() 63 if (!(key_p->bool_attr_mask & DECRYPT_BOOL_ON)) { in C_DecryptInit() 87 rv = soft_decrypt_init(session_p, pMechanism, key_p); in C_DecryptInit() 96 OBJ_REFRELE(key_p); in C_DecryptInit()
|
H A D | softEncrypt.c | 41 soft_object_t *key_p; in C_EncryptInit() local 58 HANDLE2OBJECT(hKey, key_p, rv); in C_EncryptInit() 63 if (!(key_p->bool_attr_mask & ENCRYPT_BOOL_ON)) { in C_EncryptInit() 87 rv = soft_encrypt_init(session_p, pMechanism, key_p); in C_EncryptInit() 96 OBJ_REFRELE(key_p); in C_EncryptInit()
|
H A D | softDSA.c | 47 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, in soft_dsa_sign_verify_init_common() argument 57 if ((key_p->class != CKO_PRIVATE_KEY) || in soft_dsa_sign_verify_init_common() 58 (key_p->key_type != CKK_DSA)) in soft_dsa_sign_verify_init_common() 61 if ((key_p->class != CKO_PUBLIC_KEY) || in soft_dsa_sign_verify_init_common() 62 (key_p->key_type != CKK_DSA)) in soft_dsa_sign_verify_init_common() 85 (void) pthread_mutex_lock(&key_p->object_mutex); in soft_dsa_sign_verify_init_common() 86 rv = soft_copy_object(key_p, &tmp_key, SOFT_COPY_OBJ_ORIG_SH, in soft_dsa_sign_verify_init_common() 91 (void) pthread_mutex_unlock(&key_p->object_mutex); in soft_dsa_sign_verify_init_common() 97 (void) pthread_mutex_unlock(&key_p->object_mutex); in soft_dsa_sign_verify_init_common()
|
H A D | softDigestUtil.c | 469 soft_digest_key(soft_session_t *session_p, soft_object_t *key_p) in soft_digest_key() argument 475 if (key_p->class != CKO_SECRET_KEY) in soft_digest_key() 478 if ((OBJ_SEC_VALUE(key_p) == NULL) || in soft_digest_key() 479 (OBJ_SEC_VALUE_LEN(key_p) == 0)) in soft_digest_key() 482 rv = soft_digest_update(session_p, OBJ_SEC_VALUE(key_p), in soft_digest_key() 483 OBJ_SEC_VALUE_LEN(key_p)); in soft_digest_key()
|
H A D | softRSA.c | 190 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, in soft_rsa_crypt_init_common() argument 209 (void) pthread_mutex_lock(&key_p->object_mutex); in soft_rsa_crypt_init_common() 210 rv = soft_copy_object(key_p, &tmp_key, SOFT_COPY_OBJ_ORIG_SH, in soft_rsa_crypt_init_common() 215 (void) pthread_mutex_unlock(&key_p->object_mutex); in soft_rsa_crypt_init_common() 221 (void) pthread_mutex_unlock(&key_p->object_mutex); in soft_rsa_crypt_init_common() 416 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, in soft_rsa_sign_verify_init_common() argument 425 if ((key_p->class != CKO_PRIVATE_KEY) || in soft_rsa_sign_verify_init_common() 426 (key_p->key_type != CKK_RSA)) in soft_rsa_sign_verify_init_common() 429 if ((key_p->class != CKO_PUBLIC_KEY) || in soft_rsa_sign_verify_init_common() 430 (key_p->key_type != CKK_RSA)) in soft_rsa_sign_verify_init_common() [all …]
|
H A D | softKeystore.h | 123 CK_RV soft_keystore_crypt(soft_object_t *key_p, uchar_t *ivec, 127 CK_RV soft_keystore_hmac(soft_object_t *key_p, boolean_t sign,
|
H A D | softMAC.c | 69 CK_MECHANISM_PTR pMechanism, soft_object_t *key_p, boolean_t sign_op) in soft_hmac_sign_verify_init_common() argument 75 if ((key_p->class != CKO_SECRET_KEY) || in soft_hmac_sign_verify_init_common() 76 (key_p->key_type != CKK_GENERIC_SECRET)) { in soft_hmac_sign_verify_init_common() 163 rv = mac_init_ctx(session_p, key_p, hmac_ctx, pMechanism->mechanism); in soft_hmac_sign_verify_init_common()
|