Lines Matching refs:attr
51 CK_ATTRIBUTE attr; in get_master_attributes_by_object() local
56 attr.type = CKA_CLASS; in get_master_attributes_by_object()
57 attr.pValue = &class; in get_master_attributes_by_object()
58 attr.ulValueLen = sizeof (class); in get_master_attributes_by_object()
60 session->hSession, slot_object->hObject, &attr, 1); in get_master_attributes_by_object()
65 attr.pValue = &subtype; in get_master_attributes_by_object()
66 attr.ulValueLen = sizeof (subtype); in get_master_attributes_by_object()
69 attr.type = CKA_CERTIFICATE_TYPE; in get_master_attributes_by_object()
72 attr.type = CKA_HW_FEATURE_TYPE; in get_master_attributes_by_object()
78 attr.type = CKA_KEY_TYPE; in get_master_attributes_by_object()
87 session->hSession, slot_object->hObject, &attr, 1); in get_master_attributes_by_object()
407 generic_attr_t *attr; in get_master_attributes_by_type() local
409 attr = new_attributes + i; in get_master_attributes_by_type()
411 switch (attr->attribute.ulValueLen) { in get_master_attributes_by_type()
413 attr->attribute.pValue = &attr->generic_ulong; in get_master_attributes_by_type()
416 attr->attribute.pValue = &attr->generic_bbool; in get_master_attributes_by_type()
419 attr->attribute.pValue = attr->generic_data; in get_master_attributes_by_type()
519 generic_attr_t *attr; in dealloc_attributes() local
522 attr = attributes + i; in dealloc_attributes()
530 explicit_bzero(attr->attribute.pValue, in dealloc_attributes()
531 attr->attribute.ulValueLen); in dealloc_attributes()
533 if (attr->isMalloced) in dealloc_attributes()
534 free(attr->attribute.pValue); in dealloc_attributes()
551 generic_attr_t *attr = NULL; in attribute_set_value() local
559 find_attribute(new_attr->type, attributes, num_attributes, &attr); in attribute_set_value()
560 if (attr == NULL) { in attribute_set_value()
565 if (attr->attribute.ulValueLen >= new_attr->ulValueLen) { in attribute_set_value()
569 explicit_bzero((char *)attr->attribute.pValue + in attribute_set_value()
571 attr->attribute.ulValueLen - new_attr->ulValueLen); in attribute_set_value()
573 } else if (new_attr->ulValueLen <= sizeof (attr->generic_data)) { in attribute_set_value()
576 explicit_bzero(attr->attribute.pValue, in attribute_set_value()
577 attr->attribute.ulValueLen); in attribute_set_value()
578 if (attr->isMalloced) { in attribute_set_value()
589 free(attr->attribute.pValue); in attribute_set_value()
590 attr->isMalloced = B_FALSE; in attribute_set_value()
593 attr->attribute.pValue = attr->generic_data; in attribute_set_value()
602 bzero(attr->attribute.pValue, attr->attribute.ulValueLen); in attribute_set_value()
603 attr->attribute.pValue = newStorage; in attribute_set_value()
604 attr->isMalloced = B_TRUE; in attribute_set_value()
607 (void) memcpy(attr->attribute.pValue, new_attr->pValue, in attribute_set_value()
609 attr->attribute.ulValueLen = new_attr->ulValueLen; in attribute_set_value()
610 attr->hasValueForClone = B_TRUE; in attribute_set_value()
625 generic_attr_t *attr; in find_attribute() local
630 for (i = 0, attr = attributes; i < num_attributes; i++, attr++) { in find_attribute()
631 if (attr->attribute.type == attrtype) { in find_attribute()
637 *found_attribute = found ? attr : NULL; in find_attribute()