Lines Matching refs:key

35 	kenter("{%d,%d},%d", cons->key->serial, cons->authkey->serial, error);  in complete_request_key()
38 key_negate_and_link(cons->key, key_negative_timeout, NULL, in complete_request_key()
43 key_put(cons->key); in complete_request_key()
58 struct key *keyring = info->data; in umh_keys_init()
68 struct key *keyring = info->data; in umh_keys_cleanup()
76 struct key *session_keyring, int wait) in call_usermodehelper_keys()
100 struct key *key = cons->key, *authkey = cons->authkey, *keyring, in call_sbin_request_key() local
107 kenter("{%d},{%d},%s", key->serial, authkey->serial, op); in call_sbin_request_key()
114 sprintf(desc, "_req.%u", key->serial); in call_sbin_request_key()
136 sprintf(key_str, "%d", key->serial); in call_sbin_request_key()
180 if (test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) || in call_sbin_request_key()
181 key_validate(key) < 0) in call_sbin_request_key()
203 static int construct_key(struct key *key, const void *callout_info, in construct_key() argument
205 struct key *dest_keyring) in construct_key()
209 struct key *authkey; in construct_key()
212 kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux); in construct_key()
219 authkey = request_key_auth_new(key, callout_info, callout_len, in construct_key()
227 cons->key = key_get(key); in construct_key()
231 if (key->type->request_key) in construct_key()
232 actor = key->type->request_key; in construct_key()
253 static void construct_get_dest_keyring(struct key **_dest_keyring) in construct_get_dest_keyring()
257 struct key *dest_keyring = *_dest_keyring, *authkey; in construct_get_dest_keyring()
331 struct key *dest_keyring, in construct_alloc_key()
334 struct key **_key) in construct_alloc_key()
337 struct key *key; in construct_alloc_key() local
356 key = key_alloc(ctx->index_key.type, ctx->index_key.description, in construct_alloc_key()
359 if (IS_ERR(key)) in construct_alloc_key()
362 set_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags); in construct_alloc_key()
380 __key_link(key, &edit); in construct_alloc_key()
386 *_key = key; in construct_alloc_key()
387 kleave(" = 0 [%d]", key_serial(key)); in construct_alloc_key()
393 key_put(key); in construct_alloc_key()
395 key = key_ref_to_ptr(key_ref); in construct_alloc_key()
397 ret = __key_link_check_live_key(dest_keyring, key); in construct_alloc_key()
399 __key_link(key, &edit); in construct_alloc_key()
405 *_key = key; in construct_alloc_key()
406 kleave(" = -EINPROGRESS [%d]", key_serial(key)); in construct_alloc_key()
411 key_put(key); in construct_alloc_key()
417 key_put(key); in construct_alloc_key()
423 kleave(" = %ld", PTR_ERR(key)); in construct_alloc_key()
424 return PTR_ERR(key); in construct_alloc_key()
430 static struct key *construct_key_and_link(struct keyring_search_context *ctx, in construct_key_and_link()
434 struct key *dest_keyring, in construct_key_and_link()
438 struct key *key; in construct_key_and_link() local
452 ret = construct_alloc_key(ctx, dest_keyring, flags, user, &key); in construct_key_and_link()
456 ret = construct_key(key, callout_info, callout_len, aux, in construct_key_and_link()
469 kleave(" = key %d", key_serial(key)); in construct_key_and_link()
470 return key; in construct_key_and_link()
473 key_negate_and_link(key, key_negative_timeout, NULL, NULL); in construct_key_and_link()
474 key_put(key); in construct_key_and_link()
508 struct key *request_key_and_link(struct key_type *type, in request_key_and_link()
513 struct key *dest_keyring, in request_key_and_link()
526 struct key *key; in request_key_and_link() local
537 key = ERR_PTR(ret); in request_key_and_link()
546 key = key_ref_to_ptr(key_ref); in request_key_and_link()
549 ret = key_link(dest_keyring, key); in request_key_and_link()
552 key_put(key); in request_key_and_link()
553 key = ERR_PTR(ret); in request_key_and_link()
558 key = ERR_CAST(key_ref); in request_key_and_link()
562 key = ERR_PTR(-ENOKEY); in request_key_and_link()
566 key = construct_key_and_link(&ctx, callout_info, callout_len, in request_key_and_link()
574 kleave(" = %p", key); in request_key_and_link()
575 return key; in request_key_and_link()
589 int wait_for_key_construction(struct key *key, bool intr) in wait_for_key_construction() argument
593 ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT, in wait_for_key_construction()
597 if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) { in wait_for_key_construction()
599 return key->reject_error; in wait_for_key_construction()
601 return key_validate(key); in wait_for_key_construction()
619 struct key *request_key(struct key_type *type, in request_key()
623 struct key *key; in request_key() local
629 key = request_key_and_link(type, description, callout_info, callout_len, in request_key()
631 if (!IS_ERR(key)) { in request_key()
632 ret = wait_for_key_construction(key, false); in request_key()
634 key_put(key); in request_key()
638 return key; in request_key()
656 struct key *request_key_with_auxdata(struct key_type *type, in request_key_with_auxdata()
662 struct key *key; in request_key_with_auxdata() local
665 key = request_key_and_link(type, description, callout_info, callout_len, in request_key_with_auxdata()
667 if (!IS_ERR(key)) { in request_key_with_auxdata()
668 ret = wait_for_key_construction(key, false); in request_key_with_auxdata()
670 key_put(key); in request_key_with_auxdata()
674 return key; in request_key_with_auxdata()
692 struct key *request_key_async(struct key_type *type, in request_key_async()
717 struct key *request_key_async_with_auxdata(struct key_type *type, in request_key_async_with_auxdata()