/illumos-gate/usr/src/lib/pkcs11/pkcs11_tpm/common/ |
H A D | tpmtok_int.h | 275 CK_BYTE *context; 333 CK_BYTE name[8]; // for token objects 374 CK_BYTE user_pin_sha[SHA1_DIGEST_LENGTH]; 375 CK_BYTE so_pin_sha[SHA1_DIGEST_LENGTH]; 376 CK_BYTE next_token_object_name[8]; 440 CK_BYTE token_debug_tag[MAXPATHLEN]; 445 CK_RV (*t_rng)(TSS_HCONTEXT, CK_BYTE *, CK_ULONG); 448 CK_RV (*t_rsa_decrypt)(TSS_HCONTEXT, CK_BYTE *, 449 CK_ULONG, CK_BYTE *, CK_ULONG *, OBJECT *); 453 CK_BYTE *, CK_ULONG, CK_BYTE *, [all …]
|
H A D | mech_rsa.c | 32 CK_BYTE *in_data, 34 CK_BYTE *out_data, 54 CK_BYTE * in_data, in ckm_rsa_encrypt() 56 CK_BYTE * out_data, in ckm_rsa_encrypt() 84 CK_BYTE * in_data, in ckm_rsa_decrypt() 86 CK_BYTE * out_data, in ckm_rsa_decrypt() 116 CK_BYTE * in_data, in ckm_rsa_sign() 118 CK_BYTE * out_data, in ckm_rsa_sign() 146 CK_BYTE * in_data, in ckm_rsa_verify() 148 CK_BYTE * out_data, in ckm_rsa_verify() [all …]
|
H A D | asn1.c | 297 CK_BYTE ** ber_int, in ber_encode_INTEGER() 299 CK_BYTE * data, in ber_encode_INTEGER() 302 CK_BYTE *buf = NULL; in ber_encode_INTEGER() 330 buf = (CK_BYTE *)malloc(len); in ber_encode_INTEGER() 385 ber_decode_INTEGER(CK_BYTE * ber_int, in ber_decode_INTEGER() 386 CK_BYTE ** data, in ber_decode_INTEGER() 447 CK_BYTE ** str, in ber_encode_OCTET_STRING() 449 CK_BYTE * data, in ber_encode_OCTET_STRING() 452 CK_BYTE *buf = NULL; in ber_encode_OCTET_STRING() 477 buf = (CK_BYTE *)malloc(len); in ber_encode_OCTET_STRING() [all …]
|
H A D | globals.c | 97 CK_BYTE ber_rsaEncryption[] = { 100 CK_BYTE ber_md5WithRSAEncryption[] = { 103 CK_BYTE ber_sha1WithRSAEncryption[] = { 107 CK_BYTE ber_AlgMd5[] = { 111 CK_BYTE ber_AlgSha1[] = { 115 CK_BYTE ber_AlgIdRSAEncryption[] = { 180 CK_BYTE default_so_pin_md5[MD5_DIGEST_LENGTH] = { 185 CK_BYTE default_so_pin_sha[SHA1_DIGEST_LENGTH] = { 192 CK_BYTE default_user_pin_sha[SHA1_DIGEST_LENGTH] = { 198 CK_BYTE user_pin_md5[MD5_DIGEST_LENGTH]; [all …]
|
H A D | loadsave.c | 307 restore_private_token_object(TSS_HCONTEXT, CK_BYTE *, CK_ULONG, OBJECT *); 430 CK_BYTE fname[MAXPATHLEN]; in load_token_data() 546 CK_BYTE fname[MAXPATHLEN]; in save_token_data() 622 CK_BYTE line[100]; in save_token_object() 624 CK_BYTE fname[MAXPATHLEN]; in save_token_object() 685 CK_BYTE *cleartxt = NULL; in save_public_token_object() 686 CK_BYTE fname[MAXPATHLEN]; in save_public_token_object() 742 CK_BYTE *obj_data = NULL; in save_private_token_object() 743 CK_BYTE *cleartxt = NULL; in save_private_token_object() 744 CK_BYTE *ciphertxt = NULL; in save_private_token_object() [all …]
|
H A D | sess_mgr.c | 766 CK_BYTE *data, in session_mgr_get_op_state() 799 (void) (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 806 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 814 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 840 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 847 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 855 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 881 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 887 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() 895 (void) memcpy((CK_BYTE *)op_data + offset, in session_mgr_get_op_state() [all …]
|
H A D | key.c | 357 derive_attr->pValue = (CK_BYTE *)derive_attr + in key_object_set_default_attributes() 363 local_attr->pValue = (CK_BYTE *)local_attr + sizeof (CK_ATTRIBUTE); in key_object_set_default_attributes() 453 class_attr->pValue = (CK_BYTE *)class_attr + in publ_key_set_default_attributes() 463 encrypt_attr->pValue = (CK_BYTE *)encrypt_attr + in publ_key_set_default_attributes() 469 verify_attr->pValue = (CK_BYTE *)verify_attr + in publ_key_set_default_attributes() 475 verify_recover_attr->pValue = (CK_BYTE *)verify_recover_attr + in publ_key_set_default_attributes() 481 wrap_attr->pValue = (CK_BYTE *)wrap_attr + in publ_key_set_default_attributes() 583 class_attr->pValue = (CK_BYTE *)class_attr + sizeof (CK_ATTRIBUTE); in priv_key_set_default_attributes() 592 sensitive_attr->pValue = (CK_BYTE *)sensitive_attr + in priv_key_set_default_attributes() 598 decrypt_attr->pValue = (CK_BYTE *)decrypt_attr + in priv_key_set_default_attributes() [all …]
|
H A D | mech_md5.c | 300 CK_BYTE *in_data, in md5_hash() 302 CK_BYTE *out_data, in md5_hash() 324 CK_BYTE * in_data, in md5_hmac_sign() 326 CK_BYTE * out_data, in md5_hmac_sign() 331 CK_BYTE hash[MD5_DIGEST_LENGTH]; in md5_hmac_sign() 334 CK_BYTE k_ipad[MD5_BLOCK_SIZE]; in md5_hmac_sign() 335 CK_BYTE k_opad[MD5_BLOCK_SIZE]; in md5_hmac_sign() 406 CK_BYTE *key = attr->pValue; in md5_hmac_sign() 487 CK_BYTE * in_data, in md5_hmac_verify() 489 CK_BYTE * signature, in md5_hmac_verify() [all …]
|
H A D | mech_sha.c | 33 CK_BYTE *in_data, in sha1_hash() 35 CK_BYTE *out_data, in sha1_hash() 59 CK_BYTE * in_data, in sha1_hmac_sign() 61 CK_BYTE * out_data, in sha1_hmac_sign() 65 CK_BYTE hash[SHA1_DIGEST_LENGTH]; in sha1_hmac_sign() 68 CK_BYTE k_ipad[SHA1_BLOCK_SIZE]; in sha1_hmac_sign() 69 CK_BYTE k_opad[SHA1_BLOCK_SIZE]; in sha1_hmac_sign() 137 CK_BYTE *key = attr->pValue; in sha1_hmac_sign() 217 CK_BYTE *in_data, in sha1_hmac_verify() 219 CK_BYTE *signature, in sha1_hmac_verify() [all …]
|
H A D | utility.c | 450 compute_next_token_obj_name(CK_BYTE *current, CK_BYTE *next) { in compute_next_token_obj_name() 500 CK_BYTE *data, in build_attribute() 513 attr->pValue = (CK_BYTE *)attr + sizeof (CK_ATTRIBUTE); in build_attribute() 525 add_pkcs_padding(CK_BYTE * ptr, in add_pkcs_padding() 531 CK_BYTE pad_value; in add_pkcs_padding() 534 pad_value = (CK_BYTE)pad_len; in add_pkcs_padding() 547 CK_BYTE *ptr, in strip_pkcs_padding() 551 CK_BYTE pad_value; in strip_pkcs_padding() 564 CK_BYTE *ptr = NULL; in remove_leading_zeros() 583 parity_is_odd(CK_BYTE b) { in parity_is_odd() [all …]
|
H A D | sign_mgr.c | 39 CK_BYTE * ptr = NULL; in sign_mgr_init() 127 ctx->context = (CK_BYTE *)malloc( in sign_mgr_init() 204 ptr = (CK_BYTE *)malloc(mech->ulParameterLen); in sign_mgr_init() 253 CK_BYTE * in_data, in sign_mgr_sign() 255 CK_BYTE * out_data, in sign_mgr_sign() 306 CK_BYTE * in_data, in sign_mgr_sign_update() 335 CK_BYTE * signature, in sign_mgr_sign_final() 361 CK_BYTE * in_data, in sign_mgr_sign_recover() 363 CK_BYTE * out_data, in sign_mgr_sign_recover()
|
H A D | template.c | 323 attr->pValue = (CK_BYTE *)attr + sizeof (CK_ATTRIBUTE); in template_add_attributes() 615 new_attr->pValue = (CK_BYTE *)new_attr + sizeof (CK_ATTRIBUTE); in template_copy() 631 CK_BYTE * dest) in template_flatten() 634 CK_BYTE * ptr = NULL; in template_flatten() 702 CK_BYTE * buf, in template_unflatten() 707 CK_BYTE *ptr = NULL; in template_unflatten() 771 CK_BYTE *pb2; in template_unflatten() 775 pb2 = (CK_BYTE *)aptr; in template_unflatten() 785 CK_BYTE *pb2; in template_unflatten() 786 pb2 = (CK_BYTE *)a2; in template_unflatten() [all …]
|
H A D | tpm_specific.c | 60 CK_RV token_rng(TSS_HCONTEXT, CK_BYTE *, CK_ULONG); 68 CK_BYTE *, 70 CK_BYTE *, 77 CK_BYTE *, 79 CK_BYTE *, 86 CK_BYTE *, 88 CK_BYTE *, 93 token_specific_rsa_verify(TSS_HCONTEXT, CK_BYTE *, 94 CK_ULONG, CK_BYTE *, CK_ULONG, OBJECT *); 106 CK_BYTE *, [all …]
|
H A D | verify_mgr.c | 127 ctx->context = (CK_BYTE *)malloc( in verify_mgr_init() 233 CK_BYTE * in_data, in verify_mgr_verify() 235 CK_BYTE * signature, in verify_mgr_verify() 284 CK_BYTE * in_data, in verify_mgr_verify_update() 312 CK_BYTE * signature, in verify_mgr_verify_final() 338 CK_BYTE * signature, in verify_mgr_verify_recover() 340 CK_BYTE * out_data, in verify_mgr_verify_recover()
|
H A D | key_mgr.c | 33 CK_BYTE *keydata, in key_mgr_get_private_key_type() 37 CK_BYTE *alg = NULL; in key_mgr_get_private_key_type() 38 CK_BYTE *priv_key = NULL; in key_mgr_get_private_key_type() 237 CK_BYTE * wrapped_key, in key_mgr_wrap_key() 243 CK_BYTE * data = NULL; in key_mgr_wrap_key() 353 CK_BYTE * wrapped_key, in key_mgr_unwrap_key() 360 CK_BYTE * data = NULL; in key_mgr_unwrap_key() 434 data = (CK_BYTE *)malloc(data_len); in key_mgr_unwrap_key()
|
H A D | decr_mgr.c | 41 CK_BYTE *ptr = NULL; in decr_mgr_init() 116 ptr = (CK_BYTE *)malloc(mech->ulParameterLen); in decr_mgr_init() 163 CK_BYTE *in_data, in decr_mgr_decrypt() 165 CK_BYTE *out_data, in decr_mgr_decrypt()
|
H A D | encr_mgr.c | 39 CK_BYTE * ptr = NULL; in encr_mgr_init() 115 ptr = (CK_BYTE *)malloc(mech->ulParameterLen); in encr_mgr_init() 162 CK_BYTE *in_data, in encr_mgr_encrypt() 164 CK_BYTE *out_data, in encr_mgr_encrypt()
|
H A D | object.c | 378 sizeof (CK_BYTE), &sensitive); in object_create() 394 sizeof (CK_BYTE), &extractable); in object_create() 516 CK_BYTE ** data, in object_flatten() 519 CK_BYTE * buf = NULL; in object_flatten() 534 buf = (CK_BYTE *)malloc(total_len); in object_flatten() 539 (void) memset((CK_BYTE *)buf, 0x0, total_len); in object_flatten() 549 (void) memcpy(buf + offset, &obj->name, sizeof (CK_BYTE) * 8); in object_flatten() 756 object_restore(CK_BYTE *data, OBJECT **new_obj, CK_BBOOL replace) { in object_restore()
|
/illumos-gate/usr/src/common/crypto/rsa/ |
H A D | rsa_impl.h | 46 #define CK_BYTE uchar_t macro 74 extern const CK_BYTE MD5_DER_PREFIX[MD5_DER_PREFIX_Len]; 75 extern const CK_BYTE SHA1_DER_PREFIX[SHA1_DER_PREFIX_Len]; 76 extern const CK_BYTE SHA1_DER_PREFIX_OID[SHA1_DER_PREFIX_OID_Len]; 77 extern const CK_BYTE SHA256_DER_PREFIX[SHA2_DER_PREFIX_Len]; 78 extern const CK_BYTE SHA384_DER_PREFIX[SHA2_DER_PREFIX_Len]; 79 extern const CK_BYTE SHA512_DER_PREFIX[SHA2_DER_PREFIX_Len]; 80 extern const CK_BYTE DEFAULT_PUB_EXPO[DEFAULT_PUB_EXPO_Len];
|
/illumos-gate/usr/src/lib/libkmf/libkmf/common/ |
H A D | pk11keys.c | 162 CK_BYTE * pckBuffer, in PKCS_AddTemplate() 229 MAX_PUBLIC_KEY_TEMPLATES, CKA_CLASS, (CK_BYTE *)&ckObjClass, in PKCS_CreatePublicKey() 232 MAX_PUBLIC_KEY_TEMPLATES, CKA_TOKEN, (CK_BYTE *)&ckToken, in PKCS_CreatePublicKey() 235 MAX_PUBLIC_KEY_TEMPLATES, CKA_PRIVATE, (CK_BYTE *)&ckPrivate, in PKCS_CreatePublicKey() 246 MAX_PUBLIC_KEY_TEMPLATES, CKA_KEY_TYPE, (CK_BYTE *)&ckKeyType, in PKCS_CreatePublicKey() 249 MAX_PUBLIC_KEY_TEMPLATES, CKA_DERIVE, (CK_BYTE *)&ckDerive, in PKCS_CreatePublicKey() 257 MAX_PUBLIC_KEY_TEMPLATES, CKA_ENCRYPT, (CK_BYTE *)&ckEncrypt, in PKCS_CreatePublicKey() 260 MAX_PUBLIC_KEY_TEMPLATES, CKA_VERIFY, (CK_BYTE *)&ckVerify, in PKCS_CreatePublicKey() 264 (CK_BYTE *)&ckVerifyRecover, sizeof (ckVerifyRecover)) || in PKCS_CreatePublicKey() 266 MAX_PUBLIC_KEY_TEMPLATES, CKA_WRAP, (CK_BYTE *)&ckWrap, in PKCS_CreatePublicKey() [all …]
|
/illumos-gate/usr/src/lib/pkcs11/pkcs11_softtoken/common/ |
H A D | softKeysUtil.c | 617 CK_BYTE *A = NULL; in soft_pkcs12_pbe() 618 CK_BYTE *Ai = NULL; in soft_pkcs12_pbe() 619 CK_BYTE *B = NULL; in soft_pkcs12_pbe() 620 CK_BYTE *D = NULL; in soft_pkcs12_pbe() 621 CK_BYTE *I = NULL, *S, *P; in soft_pkcs12_pbe() 622 CK_BYTE *keybuf = NULL; in soft_pkcs12_pbe() 641 D = (CK_BYTE *)malloc(Dlen); in soft_pkcs12_pbe() 647 B = (CK_BYTE *)malloc(Blen); in soft_pkcs12_pbe() 670 I = (CK_BYTE *)malloc(Ilen); in soft_pkcs12_pbe() 722 A = (CK_BYTE *)malloc(Alen); in soft_pkcs12_pbe() [all …]
|
H A D | softVerifyUtil.c | 160 CK_BYTE hmac[SHA512_DIGEST_LENGTH]; /* use the maximum size */ in soft_verify() 185 CK_BYTE signature[DES_BLOCK_LEN]; /* use the maximum size */ in soft_verify() 211 CK_BYTE signature[AES_BLOCK_LEN]; in soft_verify() 383 CK_BYTE hmac[SHA512_DIGEST_LENGTH]; in soft_verify_final() 408 CK_BYTE signature[DES_BLOCK_LEN]; /* use the maximum size */ in soft_verify_final() 434 CK_BYTE signature[AES_BLOCK_LEN]; in soft_verify_final()
|
H A D | softSessionUtil.c | 543 (void) memcpy((CK_BYTE *)pOperationState + in soft_get_operationstate() 551 (void) memcpy((CK_BYTE *)pOperationState + in soft_get_operationstate() 560 (void) memcpy((CK_BYTE *)pOperationState + in soft_get_operationstate() 693 (void) memcpy((CK_BYTE *)session_p->digest.context, in soft_set_operationstate() 694 (CK_BYTE *)pOperationState + offset, in soft_set_operationstate() 699 (void) memcpy((CK_BYTE *)session_p->digest.context, in soft_set_operationstate() 700 (CK_BYTE *)pOperationState + offset, in soft_set_operationstate()
|
H A D | softDESCrypt.c | 187 CK_BYTE *in_buf = NULL; in soft_des_encrypt_common() 188 CK_BYTE *out_buf = NULL; in soft_des_encrypt_common() 410 CK_BYTE tmpblock[DES_BLOCK_LEN]; in soft_des_encrypt_common() 498 CK_BYTE *in_buf = NULL; in soft_des_decrypt_common() 499 CK_BYTE *out_buf = NULL; in soft_des_decrypt_common() 911 CK_BYTE *pEncrypted = NULL; in soft_des_sign_verify_common() 914 CK_BYTE last_block[DES_BLOCK_LEN]; in soft_des_sign_verify_common() 999 pEncrypted = malloc(sizeof (CK_BYTE) * ulEncryptedLen); in soft_des_sign_verify_common() 1067 CK_BYTE *pEncrypted = NULL; in soft_des_mac_sign_verify_update() 1086 pEncrypted = malloc(sizeof (CK_BYTE) * ulEncryptedLen); in soft_des_mac_sign_verify_update()
|
/illumos-gate/usr/src/lib/pkcs11/include/ |
H A D | pkcs11t.h | 37 typedef unsigned char CK_BYTE; typedef 40 typedef CK_BYTE CK_CHAR; 43 typedef CK_BYTE CK_UTF8CHAR; 46 typedef CK_BYTE CK_BBOOL; 63 typedef CK_BYTE CK_PTR CK_BYTE_PTR; 80 CK_BYTE major; /* integer portion of version number */ 81 CK_BYTE minor; /* 1/100ths portion of version number */ 1433 CK_BYTE iv[8]; /* IV for CBC mode */ 1496 CK_BYTE iv[8]; 1504 CK_BYTE iv[16]; [all …]
|