• Home
  • Raw
  • Download

Lines Matching refs:key

47 	kenter("{%d,%d},%d", cons->key->serial, cons->authkey->serial, error);  in complete_request_key()
50 key_negate_and_link(cons->key, key_negative_timeout, NULL, in complete_request_key()
55 key_put(cons->key); in complete_request_key()
71 struct key *key = cons->key, *authkey = cons->authkey, *keyring; in call_sbin_request_key() local
77 kenter("{%d},{%d},%s", key->serial, authkey->serial, op); in call_sbin_request_key()
84 sprintf(desc, "_req.%u", key->serial); in call_sbin_request_key()
105 sprintf(key_str, "%d", key->serial); in call_sbin_request_key()
146 if (test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) || in call_sbin_request_key()
147 key_validate(key) < 0) in call_sbin_request_key()
168 static int construct_key(struct key *key, const void *callout_info, in construct_key() argument
170 struct key *dest_keyring) in construct_key()
174 struct key *authkey; in construct_key()
177 kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux); in construct_key()
184 authkey = request_key_auth_new(key, callout_info, callout_len, in construct_key()
192 cons->key = key_get(key); in construct_key()
196 if (key->type->request_key) in construct_key()
197 actor = key->type->request_key; in construct_key()
217 static void construct_get_dest_keyring(struct key **_dest_keyring) in construct_get_dest_keyring()
221 struct key *dest_keyring = *_dest_keyring, *authkey; in construct_get_dest_keyring()
294 struct key *dest_keyring, in construct_alloc_key()
297 struct key **_key) in construct_alloc_key()
300 struct key *key; in construct_alloc_key() local
307 key = key_alloc(type, description, cred->fsuid, cred->fsgid, cred, in construct_alloc_key()
309 if (IS_ERR(key)) in construct_alloc_key()
312 set_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags); in construct_alloc_key()
325 __key_link(dest_keyring, key); in construct_alloc_key()
330 *_key = key; in construct_alloc_key()
331 kleave(" = 0 [%d]", key_serial(key)); in construct_alloc_key()
339 key_put(key); in construct_alloc_key()
340 *_key = key = key_ref_to_ptr(key_ref); in construct_alloc_key()
341 kleave(" = -EINPROGRESS [%d]", key_serial(key)); in construct_alloc_key()
347 kleave(" = %ld", PTR_ERR(key)); in construct_alloc_key()
348 return PTR_ERR(key); in construct_alloc_key()
354 static struct key *construct_key_and_link(struct key_type *type, in construct_key_and_link()
359 struct key *dest_keyring, in construct_key_and_link()
363 struct key *key; in construct_key_and_link() local
375 &key); in construct_key_and_link()
379 ret = construct_key(key, callout_info, callout_len, aux, in construct_key_and_link()
388 kleave(" = key %d", key_serial(key)); in construct_key_and_link()
389 return key; in construct_key_and_link()
392 key_negate_and_link(key, key_negative_timeout, NULL, NULL); in construct_key_and_link()
393 key_put(key); in construct_key_and_link()
406 struct key *request_key_and_link(struct key_type *type, in request_key_and_link()
411 struct key *dest_keyring, in request_key_and_link()
415 struct key *key; in request_key_and_link() local
427 key = key_ref_to_ptr(key_ref); in request_key_and_link()
429 key = ERR_CAST(key_ref); in request_key_and_link()
433 key = ERR_PTR(-ENOKEY); in request_key_and_link()
437 key = construct_key_and_link(type, description, callout_info, in request_key_and_link()
443 kleave(" = %p", key); in request_key_and_link()
444 return key; in request_key_and_link()
450 int wait_for_key_construction(struct key *key, bool intr) in wait_for_key_construction() argument
454 ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT, in wait_for_key_construction()
459 return key_validate(key); in wait_for_key_construction()
470 struct key *request_key(struct key_type *type, in request_key()
474 struct key *key; in request_key() local
480 key = request_key_and_link(type, description, callout_info, callout_len, in request_key()
482 if (!IS_ERR(key)) { in request_key()
483 ret = wait_for_key_construction(key, false); in request_key()
485 key_put(key); in request_key()
489 return key; in request_key()
500 struct key *request_key_with_auxdata(struct key_type *type, in request_key_with_auxdata()
506 struct key *key; in request_key_with_auxdata() local
509 key = request_key_and_link(type, description, callout_info, callout_len, in request_key_with_auxdata()
511 if (!IS_ERR(key)) { in request_key_with_auxdata()
512 ret = wait_for_key_construction(key, false); in request_key_with_auxdata()
514 key_put(key); in request_key_with_auxdata()
518 return key; in request_key_with_auxdata()
528 struct key *request_key_async(struct key_type *type, in request_key_async()
545 struct key *request_key_async_with_auxdata(struct key_type *type, in request_key_async_with_auxdata()