Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 39) sorted by relevance

12

/security/keys/
Dkey.c42 void __key_check(const struct key *key) in __key_check() argument
45 key, key->magic, KEY_DEBUG_MAGIC); in __key_check()
137 static inline void key_alloc_serial(struct key *key) in key_alloc_serial() argument
140 struct key *xkey; in key_alloc_serial()
145 get_random_bytes(&key->serial, sizeof(key->serial)); in key_alloc_serial()
147 key->serial >>= 1; /* negative numbers are not permitted */ in key_alloc_serial()
148 } while (key->serial < 3); in key_alloc_serial()
158 xkey = rb_entry(parent, struct key, serial_node); in key_alloc_serial()
160 if (key->serial < xkey->serial) in key_alloc_serial()
162 else if (key->serial > xkey->serial) in key_alloc_serial()
[all …]
Drequest_key.c53 kenter("{%d,%d},%d", cons->key->serial, cons->authkey->serial, error); in complete_request_key()
56 key_negate_and_link(cons->key, key_negative_timeout, NULL, in complete_request_key()
61 key_put(cons->key); in complete_request_key()
76 struct key *keyring = info->data; in umh_keys_init()
86 struct key *keyring = info->data; in umh_keys_cleanup()
94 struct key *session_keyring, int wait) in call_usermodehelper_keys()
118 struct key *key = cons->key, *authkey = cons->authkey, *keyring, in call_sbin_request_key() local
125 kenter("{%d},{%d},%s", key->serial, authkey->serial, op); in call_sbin_request_key()
132 sprintf(desc, "_req.%u", key->serial); in call_sbin_request_key()
154 sprintf(key_str, "%d", key->serial); in call_sbin_request_key()
[all …]
Dgc.c139 static void key_gc_keyring(struct key *keyring, time_t limit) in key_gc_keyring()
159 struct key *key = rcu_dereference(klist->keys[loop]); in key_gc_keyring() local
160 if (key_is_dead(key, limit)) in key_gc_keyring()
183 struct key *key = in key_gc_unused_keys() local
184 list_entry(keys->next, struct key, graveyard_link); in key_gc_unused_keys()
185 list_del(&key->graveyard_link); in key_gc_unused_keys()
187 kdebug("- %u", key->serial); in key_gc_unused_keys()
188 key_check(key); in key_gc_unused_keys()
191 if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags) && in key_gc_unused_keys()
192 !test_bit(KEY_FLAG_NEGATIVE, &key->flags) && in key_gc_unused_keys()
[all …]
Dproc.c97 struct key *key = rb_entry(n, struct key, serial_node); in key_serial_next() local
98 if (kuid_has_mapping(user_ns, key->user->uid)) in key_serial_next()
110 static struct key *find_ge_key(struct seq_file *p, key_serial_t id) in find_ge_key()
114 struct key *minkey = NULL; in find_ge_key()
117 struct key *key = rb_entry(n, struct key, serial_node); in find_ge_key() local
118 if (id < key->serial) { in find_ge_key()
119 if (!minkey || minkey->serial > key->serial) in find_ge_key()
120 minkey = key; in find_ge_key()
122 } else if (id > key->serial) { in find_ge_key()
125 minkey = key; in find_ge_key()
[all …]
Duser_defined.c61 int user_instantiate(struct key *key, struct key_preparsed_payload *prep) in user_instantiate() argument
71 ret = key_payload_reserve(key, datalen); in user_instantiate()
83 rcu_assign_keypointer(key, upayload); in user_instantiate()
96 int user_update(struct key *key, struct key_preparsed_payload *prep) in user_update() argument
118 ret = key_payload_reserve(key, datalen); in user_update()
122 zap = key->payload.data; in user_update()
123 rcu_assign_keypointer(key, upayload); in user_update()
124 key->expiry = 0; in user_update()
139 int user_match(const struct key *key, const void *description) in user_match() argument
141 return strcmp(key->description, description) == 0; in user_match()
[all …]
Dkeyring.c35 ((PAGE_SIZE - sizeof(struct keyring_list)) / sizeof(struct key *)))
68 static int keyring_instantiate(struct key *keyring,
70 static int keyring_match(const struct key *keyring, const void *criterion);
71 static void keyring_revoke(struct key *keyring);
72 static void keyring_destroy(struct key *keyring);
73 static void keyring_describe(const struct key *keyring, struct seq_file *m);
74 static long keyring_read(const struct key *keyring,
99 static void keyring_publish_name(struct key *keyring) in keyring_publish_name()
123 static int keyring_instantiate(struct key *keyring, in keyring_instantiate()
141 static int keyring_match(const struct key *keyring, const void *description) in keyring_match()
[all …]
Dinternal.h91 extern int __key_link_begin(struct key *keyring,
95 extern int __key_link_check_live_key(struct key *keyring, struct key *key);
96 extern void __key_link(struct key *keyring, struct key *key,
98 extern void __key_link_end(struct key *keyring,
107 extern struct key *keyring_search_instkey(struct key *keyring,
110 typedef int (*key_match_func_t)(const struct key *, const void *);
129 extern struct key *find_keyring_by_name(const char *name, bool skip_perm_check);
134 extern int install_session_keyring_to_cred(struct cred *, struct key *);
136 extern struct key *request_key_and_link(struct key_type *type,
141 struct key *dest_keyring,
[all …]
Dpermission.c33 struct key *key; in key_task_permission() local
37 key = key_ref_to_ptr(key_ref); in key_task_permission()
40 if (uid_eq(key->uid, cred->fsuid)) { in key_task_permission()
41 kperm = key->perm >> 16; in key_task_permission()
47 if (gid_valid(key->gid) && key->perm & KEY_GRP_ALL) { in key_task_permission()
48 if (gid_eq(key->gid, cred->fsgid)) { in key_task_permission()
49 kperm = key->perm >> 8; in key_task_permission()
53 ret = groups_search(cred->group_info, key->gid); in key_task_permission()
55 kperm = key->perm >> 8; in key_task_permission()
61 kperm = key->perm; in key_task_permission()
[all …]
Drequest_key_auth.c22 static int request_key_auth_instantiate(struct key *,
24 static void request_key_auth_describe(const struct key *, struct seq_file *);
25 static void request_key_auth_revoke(struct key *);
26 static void request_key_auth_destroy(struct key *);
27 static long request_key_auth_read(const struct key *, char __user *, size_t);
45 static int request_key_auth_instantiate(struct key *key, in request_key_auth_instantiate() argument
48 key->payload.data = (struct request_key_auth *)prep->data; in request_key_auth_instantiate()
55 static void request_key_auth_describe(const struct key *key, in request_key_auth_describe() argument
58 struct request_key_auth *rka = key->payload.data; in request_key_auth_describe()
61 seq_puts(m, key->description); in request_key_auth_describe()
[all …]
Dprocess_keys.c47 struct key *uid_keyring, *session_keyring; in install_user_keyrings()
133 struct key *keyring; in install_thread_keyring_to_cred()
176 struct key *keyring; in install_process_keyring_to_cred()
219 int install_session_keyring_to_cred(struct cred *cred, struct key *keyring) in install_session_keyring_to_cred()
222 struct key *old; in install_session_keyring_to_cred()
255 static int install_session_keyring(struct key *keyring) in install_session_keyring()
499 int lookup_user_key_possessed(const struct key *key, const void *target) in lookup_user_key_possessed() argument
501 return key == target; in lookup_user_key_possessed()
527 struct key *key; in lookup_user_key() local
549 key = cred->thread_keyring; in lookup_user_key()
[all …]
Dkeyctl.c164 struct key *key; in SYSCALL_DEFINE4() local
213 key = request_key_and_link(ktype, description, callout_info, in SYSCALL_DEFINE4()
216 if (IS_ERR(key)) { in SYSCALL_DEFINE4()
217 ret = PTR_ERR(key); in SYSCALL_DEFINE4()
222 ret = wait_for_key_construction(key, 1); in SYSCALL_DEFINE4()
226 ret = key->serial; in SYSCALL_DEFINE4()
229 key_put(key); in SYSCALL_DEFINE4()
546 struct key *key, *instkey; in keyctl_describe_key() local
578 key = key_ref_to_ptr(key_ref); in keyctl_describe_key()
582 key->type->name, in keyctl_describe_key()
[all …]
Dtrusted.c76 static int TSS_rawhmac(unsigned char *digest, const unsigned char *key, in TSS_rawhmac() argument
91 ret = crypto_shash_setkey(hmacalg, key, keylen); in TSS_rawhmac()
123 static int TSS_authhmac(unsigned char *digest, const unsigned char *key, in TSS_authhmac() argument
163 ret = TSS_rawhmac(digest, key, keylen, SHA1_DIGEST_SIZE, in TSS_authhmac()
177 const unsigned char *key, in TSS_checkhmac1() argument
239 ret = TSS_rawhmac(testhmac, key, keylen, SHA1_DIGEST_SIZE, paramdigest, in TSS_checkhmac1()
394 const unsigned char *key, uint16_t type, uint32_t handle) in osap() argument
421 return TSS_rawhmac(s->secret, key, SHA1_DIGEST_SIZE, TPM_NONCE_SIZE, in osap()
672 p->key[p->key_len] = p->migratable; in key_seal()
675 p->key, p->key_len + 1, p->blob, &p->blob_len, in key_seal()
[all …]
DKconfig6 bool "Enable access key retention support"
15 Furthermore, a special type of key is available that acts as keyring:
49 which are encrypted/decrypted with a 'master' symmetric key. The
50 'master' key can be either a trusted-key or user-key type.
68 Only key attributes are listed here; key payloads are not included in
/security/selinux/ss/
Davtab.c38 struct avtab_key *key, struct avtab_datum *datum) in avtab_insert_node() argument
45 newnode->key = *key; in avtab_insert_node()
47 if (key->specified & AVTAB_XPERMS) { in avtab_insert_node()
71 static int avtab_insert(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum) in avtab_insert() argument
75 u16 specified = key->specified & ~(AVTAB_ENABLED|AVTAB_ENABLED_OLD); in avtab_insert()
80 hvalue = avtab_hash(key, h->mask); in avtab_insert()
84 if (key->source_type == cur->key.source_type && in avtab_insert()
85 key->target_type == cur->key.target_type && in avtab_insert()
86 key->target_class == cur->key.target_class && in avtab_insert()
87 (specified & cur->key.specified)) { in avtab_insert()
[all …]
Dhashtab.c11 struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key), in hashtab_create() argument
38 int hashtab_insert(struct hashtab *h, void *key, void *datum) in hashtab_insert() argument
46 hvalue = h->hash_value(h, key); in hashtab_insert()
49 while (cur && h->keycmp(h, key, cur->key) > 0) { in hashtab_insert()
54 if (cur && (h->keycmp(h, key, cur->key) == 0)) in hashtab_insert()
60 newnode->key = key; in hashtab_insert()
74 void *hashtab_search(struct hashtab *h, const void *key) in hashtab_search() argument
82 hvalue = h->hash_value(h, key); in hashtab_search()
84 while (cur && h->keycmp(h, key, cur->key) > 0) in hashtab_search()
87 if (cur == NULL || (h->keycmp(h, key, cur->key) != 0)) in hashtab_search()
[all …]
Dconditional.c103 cur->node->key.specified &= ~AVTAB_ENABLED; in evaluate_cond_node()
105 cur->node->key.specified |= AVTAB_ENABLED; in evaluate_cond_node()
111 cur->node->key.specified &= ~AVTAB_ENABLED; in evaluate_cond_node()
113 cur->node->key.specified |= AVTAB_ENABLED; in evaluate_cond_node()
186 int cond_destroy_bool(void *key, void *datum, void *p) in cond_destroy_bool() argument
188 kfree(key); in cond_destroy_bool()
193 int cond_index_bool(void *key, void *datum, void *datap) in cond_index_bool() argument
206 if (flex_array_put_ptr(fa, booldatum->value - 1, key, in cond_index_bool()
223 char *key = NULL; in cond_read_bool() local
247 key = kmalloc(len + 1, GFP_KERNEL); in cond_read_bool()
[all …]
Dpolicydb.c177 char *key = NULL; in roles_init() local
192 key = kstrdup(OBJECT_R, GFP_KERNEL); in roles_init()
193 if (!key) in roles_init()
196 rc = hashtab_insert(p->p_roles.table, key, role); in roles_init()
202 kfree(key); in roles_init()
246 const struct range_trans *key = k; in rangetr_hash() local
247 return (key->source_type + (key->target_type << 3) + in rangetr_hash()
248 (key->target_class << 5)) & (h->size - 1); in rangetr_hash()
327 static int common_index(void *key, void *datum, void *datap) in common_index() argument
339 if (flex_array_put_ptr(fa, comdatum->value - 1, key, in common_index()
[all …]
Dconditional.h67 int cond_destroy_bool(void *key, void *datum, void *p);
69 int cond_index_bool(void *key, void *datum, void *datap);
73 int cond_write_bool(void *key, void *datum, void *ptr);
76 void cond_compute_av(struct avtab *ctab, struct avtab_key *key,
78 void cond_compute_xperms(struct avtab *ctab, struct avtab_key *key,
Dhashtab.h16 void *key; member
25 u32 (*hash_value)(struct hashtab *h, const void *key);
42 struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key),
Davtab.h80 struct avtab_key key; member
109 struct avtab_node *avtab_insert_nonunique(struct avtab *h, struct avtab_key *key,
112 struct avtab_node *avtab_search_node(struct avtab *h, struct avtab_key *key);
/security/integrity/
Ddigsig_asymmetric.c36 static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid) in request_asymmetric_key()
38 struct key *key; in request_asymmetric_key() local
51 key = ERR_CAST(kref); in request_asymmetric_key()
53 key = key_ref_to_ptr(kref); in request_asymmetric_key()
55 key = request_key(&key_type_asymmetric, name, NULL); in request_asymmetric_key()
58 if (IS_ERR(key)) { in request_asymmetric_key()
60 name, PTR_ERR(key)); in request_asymmetric_key()
61 switch (PTR_ERR(key)) { in request_asymmetric_key()
68 return key; in request_asymmetric_key()
72 pr_debug("%s() = 0 [%x]\n", __func__, key_serial(key)); in request_asymmetric_key()
[all …]
/security/keys/encrypted-keys/
Dencrypted.c306 static struct key *request_user_key(const char *master_desc, u8 **master_key, in request_user_key()
310 struct key *ukey; in request_user_key()
338 static int calc_hmac(u8 *digest, const u8 *key, unsigned int keylen, in calc_hmac() argument
350 ret = crypto_shash_setkey(hmacalg, key, keylen); in calc_hmac()
404 static int init_blkcipher_desc(struct blkcipher_desc *desc, const u8 *key, in init_blkcipher_desc() argument
418 ret = crypto_blkcipher_setkey(desc->tfm, key, key_len); in init_blkcipher_desc()
428 static struct key *request_master_key(struct encrypted_key_payload *epayload, in request_master_key()
431 struct key *mkey = NULL; in request_master_key()
598 static struct encrypted_key_payload *encrypted_key_alloc(struct key *key, in encrypted_key_alloc() argument
635 ret = key_payload_reserve(key, payload_datalen + datablob_len in encrypted_key_alloc()
[all …]
Dmasterkey_trusted.c31 struct key *request_trusted_key(const char *trusted_desc, in request_trusted_key()
35 struct key *tkey; in request_trusted_key()
43 *master_key = tpayload->key; in request_trusted_key()
/security/integrity/ima/
Dima_queue.c47 unsigned int key; in ima_lookup_digest_entry() local
50 key = ima_hash_key(digest_value); in ima_lookup_digest_entry()
52 hlist_for_each_entry_rcu(qe, &ima_htable.queue[key], hnext) { in ima_lookup_digest_entry()
71 unsigned int key; in ima_add_digest_entry() local
84 key = ima_hash_key(entry->digest); in ima_add_digest_entry()
85 hlist_add_head_rcu(&qe->hnext, &ima_htable.queue[key]); in ima_add_digest_entry()
/security/tomoyo/
Dsecurityfs_if.c138 const int key = ((u8 *) file_inode(file)->i_private) in tomoyo_open() local
140 return tomoyo_open_control(key, file); in tomoyo_open()
228 struct dentry *parent, const u8 key) in tomoyo_create_entry() argument
230 securityfs_create_file(name, mode, parent, ((u8 *) NULL) + key, in tomoyo_create_entry()

12