diff options
Diffstat (limited to 'security/keys/keyring.c')
-rw-r--r-- | security/keys/keyring.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 09d92d52ef75..d65a180f888d 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
@@ -481,51 +481,6 @@ key_ref_t __keyring_search_one(key_ref_t keyring_ref, | |||
481 | 481 | ||
482 | /*****************************************************************************/ | 482 | /*****************************************************************************/ |
483 | /* | 483 | /* |
484 | * search for an instantiation authorisation key matching a target key | ||
485 | * - the RCU read lock must be held by the caller | ||
486 | * - a target_id of zero specifies any valid token | ||
487 | */ | ||
488 | struct key *keyring_search_instkey(struct key *keyring, | ||
489 | key_serial_t target_id) | ||
490 | { | ||
491 | struct request_key_auth *rka; | ||
492 | struct keyring_list *klist; | ||
493 | struct key *instkey; | ||
494 | int loop; | ||
495 | |||
496 | klist = rcu_dereference(keyring->payload.subscriptions); | ||
497 | if (klist) { | ||
498 | for (loop = 0; loop < klist->nkeys; loop++) { | ||
499 | instkey = klist->keys[loop]; | ||
500 | |||
501 | if (instkey->type != &key_type_request_key_auth) | ||
502 | continue; | ||
503 | |||
504 | rka = instkey->payload.data; | ||
505 | if (target_id && rka->target_key->serial != target_id) | ||
506 | continue; | ||
507 | |||
508 | /* the auth key is revoked during instantiation */ | ||
509 | if (!test_bit(KEY_FLAG_REVOKED, &instkey->flags)) | ||
510 | goto found; | ||
511 | |||
512 | instkey = ERR_PTR(-EKEYREVOKED); | ||
513 | goto error; | ||
514 | } | ||
515 | } | ||
516 | |||
517 | instkey = ERR_PTR(-EACCES); | ||
518 | goto error; | ||
519 | |||
520 | found: | ||
521 | atomic_inc(&instkey->usage); | ||
522 | error: | ||
523 | return instkey; | ||
524 | |||
525 | } /* end keyring_search_instkey() */ | ||
526 | |||
527 | /*****************************************************************************/ | ||
528 | /* | ||
529 | * find a keyring with the specified name | 484 | * find a keyring with the specified name |
530 | * - all named keyrings are searched | 485 | * - all named keyrings are searched |
531 | * - only find keyrings with search permission for the process | 486 | * - only find keyrings with search permission for the process |