Lines Matching refs:attr

306 	CK_ATTRIBUTE  * attr = NULL;  in template_add_attributes()  local
314 attr = (CK_ATTRIBUTE *)malloc(sizeof (CK_ATTRIBUTE) + in template_add_attributes()
316 if (! attr) { in template_add_attributes()
319 attr->type = pTemplate[i].type; in template_add_attributes()
320 attr->ulValueLen = pTemplate[i].ulValueLen; in template_add_attributes()
322 if (attr->ulValueLen != 0) { in template_add_attributes()
323 attr->pValue = (CK_BYTE *)attr + sizeof (CK_ATTRIBUTE); in template_add_attributes()
324 (void) memcpy(attr->pValue, pTemplate[i].pValue, in template_add_attributes()
325 attr->ulValueLen); in template_add_attributes()
327 attr->pValue = NULL; in template_add_attributes()
329 rc = template_update_attribute(tmpl, attr); in template_add_attributes()
331 free(attr); in template_add_attributes()
423 CK_ATTRIBUTE ** attr) in template_attribute_find() argument
428 if (! tmpl || ! attr) in template_attribute_find()
436 *attr = a; in template_attribute_find()
443 *attr = NULL; in template_attribute_find()
456 CK_ATTRIBUTE * attr = NULL; in template_attribute_find_multiple() local
461 tmpl, parselist[i].type, &attr); in template_attribute_find_multiple()
464 (void) memcpy(parselist[i].ptr, attr->pValue, in template_attribute_find_multiple()
544 CK_ATTRIBUTE * attr; in template_check_required_base_attributes() local
547 found = template_attribute_find(tmpl, CKA_CLASS, &attr); in template_check_required_base_attributes()
603 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)node->data; in template_copy() local
607 len = sizeof (CK_ATTRIBUTE) + attr->ulValueLen; in template_copy()
613 (void) memcpy(new_attr, attr, len); in template_copy()
648 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)node->data; in template_flatten() local
651 (void) memcpy(ptr, attr, sizeof (CK_ATTRIBUTE) + in template_flatten()
652 attr->ulValueLen); in template_flatten()
653 ptr += sizeof (CK_ATTRIBUTE) + attr->ulValueLen; in template_flatten()
659 attr_32->type = attr->type; in template_flatten()
661 if ((attr->type == CKA_CLASS || in template_flatten()
662 attr->type == CKA_KEY_TYPE || in template_flatten()
663 attr->type == CKA_MODULUS_BITS || in template_flatten()
664 attr->type == CKA_VALUE_BITS || in template_flatten()
665 attr->type == CKA_CERTIFICATE_TYPE || in template_flatten()
666 attr->type == CKA_VALUE_LEN) && in template_flatten()
667 attr->ulValueLen != 0) { in template_flatten()
675 pVal = (CK_ULONG *)attr->pValue; in template_flatten()
682 attr_32->ulValueLen = attr->ulValueLen; in template_flatten()
686 if (attr->ulValueLen != 0) { in template_flatten()
687 (void) memcpy(ptr, attr->pValue, in template_flatten()
688 attr->ulValueLen); in template_flatten()
689 ptr += attr->ulValueLen; in template_flatten()
833 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)tmpl->attribute_list->data; in template_free() local
835 if (attr) in template_free()
836 free(attr); in template_free()
859 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)node->data; in template_get_class() local
861 if (attr->type == CKA_CLASS) { in template_get_class()
862 *class = *(CK_OBJECT_CLASS *)attr->pValue; in template_get_class()
866 if (attr->type == CKA_CERTIFICATE_TYPE) in template_get_class()
867 *subclass = *(CK_CERTIFICATE_TYPE *)attr->pValue; in template_get_class()
869 if (attr->type == CKA_KEY_TYPE) in template_get_class()
870 *subclass = *(CK_KEY_TYPE *)attr->pValue; in template_get_class()
896 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)node->data; in template_get_size() local
898 size += sizeof (CK_ATTRIBUTE) + attr->ulValueLen; in template_get_size()
916 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)node->data; in template_get_compressed_size() local
919 if ((attr->type == CKA_CLASS || in template_get_compressed_size()
920 attr->type == CKA_KEY_TYPE || in template_get_compressed_size()
921 attr->type == CKA_MODULUS_BITS || in template_get_compressed_size()
922 attr->type == CKA_VALUE_BITS || in template_get_compressed_size()
923 attr->type == CKA_CERTIFICATE_TYPE || in template_get_compressed_size()
924 attr->type == CKA_VALUE_LEN) && in template_get_compressed_size()
925 attr->ulValueLen != 0) { in template_get_compressed_size()
928 size += attr->ulValueLen; in template_get_compressed_size()
951 CK_ATTRIBUTE * attr = NULL; in template_check_exportability() local
962 val = template_attribute_find(tmpl, CKA_SENSITIVE, &attr); in template_check_exportability()
964 val = *(CK_BBOOL *)attr->pValue; in template_check_exportability()
997 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)node->data; in template_merge() local
999 rc = template_update_attribute(dest, attr); in template_merge()
1078 CK_ATTRIBUTE * attr = NULL; in template_update_attribute() local
1086 attr = (CK_ATTRIBUTE *)node->data; in template_update_attribute()
1088 if (new_attr->type == attr->type) { in template_update_attribute()
1089 free(attr); in template_update_attribute()
1106 CK_ATTRIBUTE * attr, in template_validate_attribute() argument
1112 return (data_object_validate_attribute(tmpl, attr, mode)); in template_validate_attribute()
1115 return (cert_x509_validate_attribute(tmpl, attr, mode)); in template_validate_attribute()
1118 attr, mode)); in template_validate_attribute()
1124 attr, mode)); in template_validate_attribute()
1133 attr, mode)); in template_validate_attribute()
1141 attr, mode)); in template_validate_attribute()
1150 attr, mode)); in template_validate_attribute()
1153 attr, mode)); in template_validate_attribute()
1178 CK_ATTRIBUTE *attr = (CK_ATTRIBUTE *)node->data; in template_validate_attributes() local
1180 rc = template_validate_attribute(tmpl, attr, class, in template_validate_attributes()
1193 CK_ATTRIBUTE * attr, in template_validate_base_attribute() argument
1196 if (! tmpl || ! attr) { in template_validate_base_attribute()
1199 switch (attr->type) { in template_validate_base_attribute()