Searched refs:index_key (Results 1 - 12 of 12) sorted by relevance

/linux-4.1.27/security/keys/
H A Dpersistent.c43 struct keyring_index_key *index_key) key_create_persistent()
54 persistent_ref = find_key_to_update(reg_ref, index_key); key_create_persistent()
59 persistent = keyring_alloc(index_key->description, key_create_persistent()
78 struct keyring_index_key index_key; key_get_persistent() local
85 index_key.type = &key_type_keyring; key_get_persistent()
86 index_key.description = buf; key_get_persistent()
87 index_key.desc_len = sprintf(buf, "_persistent.%u", from_kuid(ns, uid)); key_get_persistent()
92 persistent_ref = find_key_to_update(reg_ref, &index_key); key_get_persistent()
103 persistent_ref = key_create_persistent(ns, uid, &index_key); key_get_persistent()
42 key_create_persistent(struct user_namespace *ns, kuid_t uid, struct keyring_index_key *index_key) key_create_persistent() argument
H A Dkeyring.c171 static unsigned long hash_key_type_and_desc(const struct keyring_index_key *index_key) hash_key_type_and_desc() argument
175 const char *description = index_key->description; hash_key_type_and_desc()
179 int n, desc_len = index_key->desc_len; hash_key_type_and_desc()
181 type = (unsigned long)index_key->type; hash_key_type_and_desc()
208 if (index_key->type != &key_type_keyring && (hash & fan_mask) == 0) hash_key_type_and_desc()
210 if (index_key->type == &key_type_keyring && (hash & fan_mask) != 0) hash_key_type_and_desc()
232 const struct keyring_index_key *index_key = data; keyring_get_key_chunk() local
235 int desc_len = index_key->desc_len, n = sizeof(chunk); keyring_get_key_chunk()
240 return hash_key_type_and_desc(index_key); keyring_get_key_chunk()
242 return ((unsigned long)index_key->type << 8) | desc_len; keyring_get_key_chunk()
245 return (u8)((unsigned long)index_key->type >> keyring_get_key_chunk()
260 chunk |= ((u8*)index_key->description)[--offset]; keyring_get_key_chunk()
265 chunk |= (u8)((unsigned long)index_key->type >> keyring_get_key_chunk()
275 return keyring_get_key_chunk(&key->index_key, level); keyring_get_object_key_chunk()
280 const struct keyring_index_key *index_key = data; keyring_compare_object() local
283 return key->index_key.type == index_key->type && keyring_compare_object()
284 key->index_key.desc_len == index_key->desc_len && keyring_compare_object()
285 memcmp(key->index_key.description, index_key->description, keyring_compare_object()
286 index_key->desc_len) == 0; keyring_compare_object()
296 const struct keyring_index_key *a = &key_a->index_key; keyring_diff_objects()
534 if (key->type != ctx->index_key.type) { keyring_search_iterator()
602 &ctx->index_key); search_keyring()
629 ctx->index_key.type->name, search_nested_keyrings()
630 ctx->index_key.description); search_nested_keyrings()
636 if (ctx->index_key.description) search_nested_keyrings()
637 ctx->index_key.desc_len = strlen(ctx->index_key.description); search_nested_keyrings()
643 keyring_compare_object(keyring, &ctx->index_key)) { search_nested_keyrings()
689 if ((shortcut->index_key[0] & ASSOC_ARRAY_FAN_MASK) != 0) search_nested_keyrings()
894 .index_key.type = type, keyring_search()
895 .index_key.description = description, keyring_search()
934 const struct keyring_index_key *index_key) find_key_to_update()
942 keyring->serial, index_key->type->name, index_key->description); find_key_to_update()
945 index_key); find_key_to_update()
1052 .index_key = A->index_key, keyring_detect_cycle()
1072 const struct keyring_index_key *index_key,
1081 keyring->serial, index_key->type->name, index_key->description);
1083 BUG_ON(index_key->desc_len == 0);
1096 if (index_key->type == &key_type_keyring)
1104 index_key,
1128 if (index_key->type == &key_type_keyring)
1173 const struct keyring_index_key *index_key,
1178 BUG_ON(index_key->type == NULL);
1179 kenter("%d,%s,", keyring->serial, index_key->type->name);
1181 if (index_key->type == &key_type_keyring)
1228 ret = __key_link_begin(keyring, &key->index_key, &edit); key_link()
1234 __key_link_end(keyring, &key->index_key, edit); key_link()
1273 &key->index_key); key_unlink()
933 find_key_to_update(key_ref_t keyring_ref, const struct keyring_index_key *index_key) find_key_to_update() argument
H A Dkey.c279 key->index_key.desc_len = desclen; key_alloc()
280 key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL); key_alloc()
287 key->index_key.type = type; key_alloc()
493 ret = __key_link_begin(keyring, &key->index_key, &edit); key_instantiate_and_link()
501 __key_link_end(keyring, &key->index_key, edit); key_instantiate_and_link()
549 link_ret = __key_link_begin(keyring, &key->index_key, &edit); key_reject_and_link()
582 __key_link_end(keyring, &key->index_key, edit); key_reject_and_link()
781 struct keyring_index_key index_key = { key_create_or_update() local
793 index_key.type = key_type_lookup(type); key_create_or_update()
794 if (IS_ERR(index_key.type)) { key_create_or_update()
800 if (!index_key.type->instantiate || key_create_or_update()
801 (!index_key.description && !index_key.type->preparse)) key_create_or_update()
815 prep.quotalen = index_key.type->def_datalen; key_create_or_update()
818 if (index_key.type->preparse) { key_create_or_update()
819 ret = index_key.type->preparse(&prep); key_create_or_update()
824 if (!index_key.description) key_create_or_update()
825 index_key.description = prep.description; key_create_or_update()
827 if (!index_key.description) key_create_or_update()
830 index_key.desc_len = strlen(index_key.description); key_create_or_update()
837 ret = __key_link_begin(keyring, &index_key, &edit); key_create_or_update()
855 if (index_key.type->update) { key_create_or_update()
856 key_ref = find_key_to_update(keyring_ref, &index_key); key_create_or_update()
866 if (index_key.type->read) key_create_or_update()
869 if (index_key.type == &key_type_keyring || key_create_or_update()
870 index_key.type->update) key_create_or_update()
875 key = key_alloc(index_key.type, index_key.description, key_create_or_update()
893 __key_link_end(keyring, &index_key, edit); key_create_or_update()
895 if (index_key.type->preparse) key_create_or_update()
896 index_key.type->free_preparse(&prep); key_create_or_update()
898 key_type_put(index_key.type); key_create_or_update()
906 __key_link_end(keyring, &index_key, edit); key_create_or_update()
H A Drequest_key.c343 ctx->index_key.type->name, ctx->index_key.description); construct_alloc_key()
350 if (ctx->index_key.type->read) construct_alloc_key()
352 if (ctx->index_key.type == &key_type_keyring || construct_alloc_key()
353 ctx->index_key.type->update) construct_alloc_key()
356 key = key_alloc(ctx->index_key.type, ctx->index_key.description, construct_alloc_key()
365 ret = __key_link_begin(dest_keyring, &ctx->index_key, &edit); construct_alloc_key()
384 __key_link_end(dest_keyring, &ctx->index_key, edit); construct_alloc_key()
400 __key_link_end(dest_keyring, &ctx->index_key, edit); construct_alloc_key()
514 .index_key.type = type, request_key_and_link()
515 .index_key.description = description, request_key_and_link()
528 ctx.index_key.type->name, ctx.index_key.description, request_key_and_link()
H A Dinternal.h92 const struct keyring_index_key *index_key,
97 const struct keyring_index_key *index_key,
101 const struct keyring_index_key *index_key);
111 struct keyring_index_key index_key; member in struct:keyring_search_context
H A Dproc.c188 .index_key.type = key->type, proc_keys_show()
189 .index_key.description = key->description, proc_keys_show()
H A Drequest_key_auth.c246 .index_key.type = &key_type_request_key_auth, key_get_instantiation_authkey()
247 .index_key.description = description, key_get_instantiation_authkey()
H A Dprocess_keys.c452 ctx->index_key.type != &key_type_request_key_auth search_process_keyrings()
674 ctx.index_key.type = key->type; lookup_user_key()
675 ctx.index_key.description = key->description; lookup_user_key()
676 ctx.index_key.desc_len = strlen(key->description); lookup_user_key()
/linux-4.1.27/include/linux/
H A Dassoc_array.h36 unsigned long (*get_key_chunk)(const void *index_key, int level);
42 bool (*compare_object)(const void *object, const void *index_key);
47 int (*diff_objects)(const void *object, const void *index_key);
70 const void *index_key);
75 const void *index_key,
81 const void *index_key);
H A Dassoc_array_priv.h72 unsigned long index_key[]; member in struct:assoc_array_shortcut
H A Dkey.h182 struct keyring_index_key index_key; member in union:key::__anon11887
/linux-4.1.27/lib/
H A Dassoc_array.c184 const void *index_key, assoc_array_walk()
211 segments = ops->get_key_chunk(index_key, level); assoc_array_walk()
268 segments = ops->get_key_chunk(index_key, sc_level); assoc_array_walk()
270 sc_segments = shortcut->index_key[sc_level >> ASSOC_ARRAY_KEY_CHUNK_SHIFT]; assoc_array_walk()
311 * @index_key: The key to the object.
321 const void *index_key) assoc_array_find()
329 if (assoc_array_walk(array, ops, index_key, &result) != assoc_array_find()
348 if (ops->compare_object(leaf, index_key)) assoc_array_find()
493 const void *index_key, assoc_array_insert_into_terminal_node()
529 index_key)) { assoc_array_insert_into_terminal_node()
766 index_key); assoc_array_insert_into_terminal_node()
798 new_s0->index_key[i] = assoc_array_insert_into_terminal_node()
799 ops->get_key_chunk(index_key, i * ASSOC_ARRAY_KEY_CHUNK_SIZE); assoc_array_insert_into_terminal_node()
803 new_s0->index_key[keylen - 1] &= ~blank; assoc_array_insert_into_terminal_node()
816 base_seg = ops->get_key_chunk(index_key, level); assoc_array_insert_into_terminal_node()
898 memcpy(new_s0->index_key, shortcut->index_key, assoc_array_insert_mid_shortcut()
903 new_s0->index_key[keylen - 1] &= ~blank; assoc_array_insert_mid_shortcut()
947 memcpy(new_s1->index_key, shortcut->index_key, assoc_array_insert_mid_shortcut()
981 * @index_key: The key to insert at.
998 const void *index_key, assoc_array_insert()
1021 switch (assoc_array_walk(array, ops, index_key, &result)) { assoc_array_insert()
1033 if (!assoc_array_insert_into_terminal_node(edit, ops, index_key, assoc_array_insert()
1096 * @index_key: The key to the object.
1113 const void *index_key) assoc_array_delete()
1132 switch (assoc_array_walk(array, ops, index_key, &result)) { assoc_array_delete()
1145 index_key)) assoc_array_delete()
182 assoc_array_walk(const struct assoc_array *array, const struct assoc_array_ops *ops, const void *index_key, struct assoc_array_walk_result *result) assoc_array_walk() argument
319 assoc_array_find(const struct assoc_array *array, const struct assoc_array_ops *ops, const void *index_key) assoc_array_find() argument
491 assoc_array_insert_into_terminal_node(struct assoc_array_edit *edit, const struct assoc_array_ops *ops, const void *index_key, struct assoc_array_walk_result *result) assoc_array_insert_into_terminal_node() argument
996 assoc_array_insert(struct assoc_array *array, const struct assoc_array_ops *ops, const void *index_key, void *object) assoc_array_insert() argument
1111 assoc_array_delete(struct assoc_array *array, const struct assoc_array_ops *ops, const void *index_key) assoc_array_delete() argument

Completed in 268 milliseconds