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()
101 struct key *key = cons->key, *authkey = cons->authkey, *keyring, in call_sbin_request_key() local
108 kenter("{%d},{%d},%s", key->serial, authkey->serial, op); in call_sbin_request_key()
115 sprintf(desc, "_req.%u", key->serial); in call_sbin_request_key()
137 sprintf(key_str, "%d", key->serial); in call_sbin_request_key()
181 if (test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) || in call_sbin_request_key()
182 key_validate(key) < 0) in call_sbin_request_key()
204 static int construct_key(struct key *key, const void *callout_info, in construct_key() argument
206 struct key *dest_keyring) in construct_key()
210 struct key *authkey; in construct_key()
213 kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux); in construct_key()
220 authkey = request_key_auth_new(key, callout_info, callout_len, in construct_key()
228 cons->key = key_get(key); in construct_key()
232 if (key->type->request_key) in construct_key()
233 actor = key->type->request_key; in construct_key()
254 static int construct_get_dest_keyring(struct key **_dest_keyring) in construct_get_dest_keyring()
258 struct key *dest_keyring = *_dest_keyring, *authkey; in construct_get_dest_keyring()
355 struct key *dest_keyring, in construct_alloc_key()
358 struct key **_key) in construct_alloc_key()
361 struct key *key; in construct_alloc_key() local
380 key = key_alloc(ctx->index_key.type, ctx->index_key.description, in construct_alloc_key()
383 if (IS_ERR(key)) in construct_alloc_key()
386 set_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags); in construct_alloc_key()
404 __key_link(key, &edit); in construct_alloc_key()
410 *_key = key; in construct_alloc_key()
411 kleave(" = 0 [%d]", key_serial(key)); in construct_alloc_key()
417 key_put(key); in construct_alloc_key()
419 key = key_ref_to_ptr(key_ref); in construct_alloc_key()
421 ret = __key_link_check_live_key(dest_keyring, key); in construct_alloc_key()
423 __key_link(key, &edit); in construct_alloc_key()
429 *_key = key; in construct_alloc_key()
430 kleave(" = -EINPROGRESS [%d]", key_serial(key)); in construct_alloc_key()
435 key_put(key); in construct_alloc_key()
441 key_put(key); in construct_alloc_key()
447 kleave(" = %ld", PTR_ERR(key)); in construct_alloc_key()
448 return PTR_ERR(key); in construct_alloc_key()
454 static struct key *construct_key_and_link(struct keyring_search_context *ctx, in construct_key_and_link()
458 struct key *dest_keyring, in construct_key_and_link()
462 struct key *key; in construct_key_and_link() local
480 ret = construct_alloc_key(ctx, dest_keyring, flags, user, &key); in construct_key_and_link()
484 ret = construct_key(key, callout_info, callout_len, aux, in construct_key_and_link()
497 kleave(" = key %d", key_serial(key)); in construct_key_and_link()
498 return key; in construct_key_and_link()
501 key_negate_and_link(key, key_negative_timeout, NULL, NULL); in construct_key_and_link()
502 key_put(key); in construct_key_and_link()
537 struct key *request_key_and_link(struct key_type *type, in request_key_and_link()
542 struct key *dest_keyring, in request_key_and_link()
555 struct key *key; in request_key_and_link() local
566 key = ERR_PTR(ret); in request_key_and_link()
575 key = key_ref_to_ptr(key_ref); in request_key_and_link()
577 ret = key_link(dest_keyring, key); in request_key_and_link()
579 key_put(key); in request_key_and_link()
580 key = ERR_PTR(ret); in request_key_and_link()
585 key = ERR_CAST(key_ref); in request_key_and_link()
589 key = ERR_PTR(-ENOKEY); in request_key_and_link()
593 key = construct_key_and_link(&ctx, callout_info, callout_len, in request_key_and_link()
601 kleave(" = %p", key); in request_key_and_link()
602 return key; in request_key_and_link()
616 int wait_for_key_construction(struct key *key, bool intr) in wait_for_key_construction() argument
620 ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT, in wait_for_key_construction()
624 ret = key_read_state(key); in wait_for_key_construction()
627 return key_validate(key); in wait_for_key_construction()
645 struct key *request_key(struct key_type *type, in request_key()
649 struct key *key; in request_key() local
655 key = request_key_and_link(type, description, callout_info, callout_len, in request_key()
657 if (!IS_ERR(key)) { in request_key()
658 ret = wait_for_key_construction(key, false); in request_key()
660 key_put(key); in request_key()
664 return key; in request_key()
682 struct key *request_key_with_auxdata(struct key_type *type, in request_key_with_auxdata()
688 struct key *key; in request_key_with_auxdata() local
691 key = request_key_and_link(type, description, callout_info, callout_len, in request_key_with_auxdata()
693 if (!IS_ERR(key)) { in request_key_with_auxdata()
694 ret = wait_for_key_construction(key, false); in request_key_with_auxdata()
696 key_put(key); in request_key_with_auxdata()
700 return key; in request_key_with_auxdata()
718 struct key *request_key_async(struct key_type *type, in request_key_async()
743 struct key *request_key_async_with_auxdata(struct key_type *type, in request_key_async_with_auxdata()