Lines Matching refs:head
1229 static enum pkcs11_rc check_attrs_misc_integrity(struct obj_attrs *head) in check_attrs_misc_integrity() argument
1231 if (get_bool(head, PKCS11_CKA_NEVER_EXTRACTABLE) && in check_attrs_misc_integrity()
1232 get_bool(head, PKCS11_CKA_EXTRACTABLE)) { in check_attrs_misc_integrity()
1234 get_bool(head, PKCS11_CKA_NEVER_EXTRACTABLE), in check_attrs_misc_integrity()
1235 get_bool(head, PKCS11_CKA_EXTRACTABLE)); in check_attrs_misc_integrity()
1240 if (get_bool(head, PKCS11_CKA_ALWAYS_SENSITIVE) && in check_attrs_misc_integrity()
1241 !get_bool(head, PKCS11_CKA_SENSITIVE)) { in check_attrs_misc_integrity()
1243 get_bool(head, PKCS11_CKA_SENSITIVE), in check_attrs_misc_integrity()
1244 get_bool(head, PKCS11_CKA_ALWAYS_SENSITIVE)); in check_attrs_misc_integrity()
1252 bool object_is_private(struct obj_attrs *head) in object_is_private() argument
1254 return get_bool(head, PKCS11_CKA_PRIVATE); in object_is_private()
1257 bool object_is_token(struct obj_attrs *head) in object_is_token() argument
1259 return get_bool(head, PKCS11_CKA_TOKEN); in object_is_token()
1262 bool object_is_modifiable(struct obj_attrs *head) in object_is_modifiable() argument
1264 return get_bool(head, PKCS11_CKA_MODIFIABLE); in object_is_modifiable()
1267 bool object_is_copyable(struct obj_attrs *head) in object_is_copyable() argument
1269 return get_bool(head, PKCS11_CKA_COPYABLE); in object_is_copyable()
1276 struct obj_attrs *head) in check_access_attrs_against_token() argument
1280 switch (get_class(head)) { in check_access_attrs_against_token()
1286 private = object_is_private(head); in check_access_attrs_against_token()
1306 struct obj_attrs *head) in check_created_attrs_against_token() argument
1310 rc = check_attrs_misc_integrity(head); in check_created_attrs_against_token()
1314 if (get_bool(head, PKCS11_CKA_TRUSTED) && in check_created_attrs_against_token()
1321 if (get_bool(head, PKCS11_CKA_TOKEN) && in check_created_attrs_against_token()
1334 #define DMSG_BAD_BBOOL(attr, proc, head) \ argument
1340 _rc = get_attribute((head), _attr, &_bvalue, NULL); \
1347 struct obj_attrs *head, in check_attr_bval() argument
1353 if (!get_attribute(head, attribute, &bbool, &sz) && !!bbool == val) in check_attr_bval()
1356 DMSG_BAD_BBOOL(attribute, proc_id, head); in check_attr_bval()
1368 struct obj_attrs *head) in check_created_attrs_against_processing() argument
1380 assert(check_attr_bval(proc_id, head, PKCS11_CKA_LOCAL, false)); in check_created_attrs_against_processing()
1386 assert(check_attr_bval(proc_id, head, PKCS11_CKA_LOCAL, true)); in check_created_attrs_against_processing()
1395 assert(get_key_type(head) == PKCS11_CKK_GENERIC_SECRET); in check_created_attrs_against_processing()
1398 assert(get_key_type(head) == PKCS11_CKK_AES); in check_created_attrs_against_processing()
1401 assert(get_key_type(head) == PKCS11_CKK_EC); in check_created_attrs_against_processing()
1404 assert(get_key_type(head) == PKCS11_CKK_RSA); in check_created_attrs_against_processing()
1584 struct obj_attrs *head) in parent_key_complies_allowed_processings() argument
1592 rc = get_attribute_ptr(head, PKCS11_CKA_ALLOWED_MECHANISMS, in parent_key_complies_allowed_processings()
1638 struct obj_attrs *head) in check_parent_attrs_against_processing() argument
1640 enum pkcs11_class_id key_class = get_class(head); in check_parent_attrs_against_processing()
1641 enum pkcs11_key_type key_type = get_key_type(head); in check_parent_attrs_against_processing()
1644 if (!get_bool(head, attr)) { in check_parent_attrs_against_processing()
1678 if (get_bool(head, PKCS11_CKA_ENCRYPT)) { in check_parent_attrs_against_processing()
1801 if (!parent_key_complies_allowed_processings(proc_id, head)) { in check_parent_attrs_against_processing()
2058 struct obj_attrs *head, in check_attrs_against_modification() argument
2069 cur = (char *)head + sizeof(struct obj_attrs); in check_attrs_against_modification()
2070 end = cur + head->attrs_size; in check_attrs_against_modification()
2106 get_bool(head, PKCS11_CKA_TOKEN)) { in check_attrs_against_modification()
2116 bool obj_priv = get_bool(head, cli_ref.id); in check_attrs_against_modification()
2140 static enum pkcs11_rc set_secret_key_data(struct obj_attrs **head, void *data, in set_secret_key_data() argument
2148 rc = get_attribute(*head, PKCS11_CKA_VALUE_LEN, &key_length, &size); in set_secret_key_data()
2157 rc = set_attribute(head, PKCS11_CKA_VALUE_LEN, &key_length, in set_secret_key_data()
2164 rc = check_created_attrs(*head, NULL); in set_secret_key_data()
2169 rc = remove_empty_attribute(head, PKCS11_CKA_VALUE); in set_secret_key_data()
2173 return add_attribute(head, PKCS11_CKA_VALUE, data, key_length); in set_secret_key_data()
2176 enum pkcs11_rc set_key_data(struct obj_attrs **head, void *data, in set_key_data() argument
2179 switch (get_class(*head)) { in set_key_data()
2181 return set_secret_key_data(head, data, key_size); in set_key_data()
2187 enum pkcs11_rc get_key_data_to_wrap(struct obj_attrs *head, void **data, in get_key_data_to_wrap() argument
2190 switch (get_class(head)) { in get_key_data_to_wrap()
2192 if (get_attribute_ptr(head, PKCS11_CKA_VALUE, data, sz)) in get_key_data_to_wrap()