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
449 ret = construct_alloc_key(ctx, dest_keyring, flags, user, &key); in construct_key_and_link()
453 ret = construct_key(key, callout_info, callout_len, aux, in construct_key_and_link()
466 kleave(" = key %d", key_serial(key)); in construct_key_and_link()
467 return key; in construct_key_and_link()
470 key_negate_and_link(key, key_negative_timeout, NULL, NULL); in construct_key_and_link()
471 key_put(key); in construct_key_and_link()
505 struct key *request_key_and_link(struct key_type *type, in request_key_and_link()
510 struct key *dest_keyring, in request_key_and_link()
523 struct key *key; in request_key_and_link() local
534 key = ERR_PTR(ret); in request_key_and_link()
543 key = key_ref_to_ptr(key_ref); in request_key_and_link()
546 ret = key_link(dest_keyring, key); in request_key_and_link()
549 key_put(key); in request_key_and_link()
550 key = ERR_PTR(ret); in request_key_and_link()
555 key = ERR_CAST(key_ref); in request_key_and_link()
559 key = ERR_PTR(-ENOKEY); in request_key_and_link()
563 key = construct_key_and_link(&ctx, callout_info, callout_len, in request_key_and_link()
571 kleave(" = %p", key); in request_key_and_link()
572 return key; in request_key_and_link()
586 int wait_for_key_construction(struct key *key, bool intr) in wait_for_key_construction() argument
590 ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT, in wait_for_key_construction()
594 if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) { in wait_for_key_construction()
596 return key->type_data.reject_error; in wait_for_key_construction()
598 return key_validate(key); in wait_for_key_construction()
616 struct key *request_key(struct key_type *type, in request_key()
620 struct key *key; in request_key() local
626 key = request_key_and_link(type, description, callout_info, callout_len, in request_key()
628 if (!IS_ERR(key)) { in request_key()
629 ret = wait_for_key_construction(key, false); in request_key()
631 key_put(key); in request_key()
635 return key; in request_key()
653 struct key *request_key_with_auxdata(struct key_type *type, in request_key_with_auxdata()
659 struct key *key; in request_key_with_auxdata() local
662 key = request_key_and_link(type, description, callout_info, callout_len, in request_key_with_auxdata()
664 if (!IS_ERR(key)) { in request_key_with_auxdata()
665 ret = wait_for_key_construction(key, false); in request_key_with_auxdata()
667 key_put(key); in request_key_with_auxdata()
671 return key; in request_key_with_auxdata()
689 struct key *request_key_async(struct key_type *type, in request_key_async()
714 struct key *request_key_async_with_auxdata(struct key_type *type, in request_key_async_with_auxdata()