Lines Matching defs:keyring
207 * keyring is destroyed, so it must be dynamically allocated.
422 * Instantiate a key and link it into the target keyring atomically. Must be
423 * called with the target keyring's semaphore writelocked. The target key's
429 struct key *keyring,
436 key_check(keyring);
457 /* and link it into the destination keyring */
458 if (keyring) {
459 if (test_bit(KEY_FLAG_KEEP, &keyring->flags))
462 __key_link(keyring, key, _edit);
484 * key_instantiate_and_link - Instantiate a key and link it into the keyring.
486 * @data: The data to use to instantiate the keyring.
488 * @keyring: Keyring to create a link in on success (or NULL).
492 * and, if successful, link it in to the destination keyring if one is
502 struct key *keyring,
521 if (keyring) {
522 ret = __key_link_lock(keyring, &key->index_key);
526 ret = __key_link_begin(keyring, &key->index_key, &edit);
530 if (keyring->restrict_link && keyring->restrict_link->check) {
531 struct key_restriction *keyres = keyring->restrict_link;
533 ret = keyres->check(keyring, key->type, &prep.payload,
540 ret = __key_instantiate_and_link(key, &prep, keyring, authkey, &edit);
543 if (keyring)
544 __key_link_end(keyring, &key->index_key, edit);
555 * key_reject_and_link - Negatively instantiate a key and link it into the keyring.
559 * @keyring: Keyring to create a link in on success (or NULL).
564 * destination keyring if one is supplied. The key and any links to the key
578 struct key *keyring,
585 key_check(keyring);
590 if (keyring) {
591 if (keyring->restrict_link)
594 link_ret = __key_link_lock(keyring, &key->index_key);
596 link_ret = __key_link_begin(keyring, &key->index_key, &edit);
598 __key_link_end(keyring, &key->index_key, edit);
617 /* and link it into the destination keyring */
618 if (keyring && link_ret == 0)
619 __key_link(keyring, key, &edit);
628 if (keyring && link_ret == 0)
629 __key_link_end(keyring, &key->index_key, edit);
821 struct key *keyring, *key = NULL;
839 keyring = key_ref_to_ptr(keyring_ref);
841 key_check(keyring);
844 restrict_link = keyring->restrict_link;
847 if (keyring->type != &key_type_keyring)
871 ret = __key_link_lock(keyring, &index_key);
877 ret = __key_link_begin(keyring, &index_key, &edit);
884 ret = restrict_link->check(keyring, index_key.type,
893 * to modify the keyring */
902 * destination keyring and update that instead if possible
940 /* instantiate it and link it into the target keyring */
941 ret = __key_instantiate_and_link(key, &prep, keyring, NULL, &edit);
948 security_key_post_create_or_update(keyring, key, payload, plen, flags,
954 __key_link_end(keyring, &index_key, edit);
967 __key_link_end(keyring, &index_key, edit);
982 security_key_post_create_or_update(keyring, key, payload, plen,
990 * @keyring_ref: A pointer to the destination keyring with possession flag.
998 * Search the destination keyring for a key of the same description and if one
1000 * link to it from that keyring.
1006 * wasn't available, -ENOTDIR if the keyring wasn't a keyring, -EACCES if the
1007 * caller isn't permitted to modify the keyring or the LSM did not permit
1010 * On success, the possession flag from the keyring ref will be tacked on to
1028 * @keyring_ref: A pointer to the destination keyring with possession flag.
1036 * Create and instantiate a new key and link to it from the destination keyring.
1043 * -ENOTDIR if the keyring wasn't a keyring, -EACCES if the caller isn't
1044 * permitted to modify the keyring or the LSM did not permit creation of the
1047 * On success, the possession flag from the keyring ref will be tacked on to