Skip to content

Commit

Permalink
fscrypt: remove unnecessary check for non-logon key type
Browse files Browse the repository at this point in the history
We're passing 'key_type_logon' to request_key(), so the found key is
guaranteed to be of type "logon".  Thus, there is no reason to check
later that the key is really a "logon" key.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: khusika <khusikadhamar@gmail.com>
  • Loading branch information
ebiggers authored and khusika committed Aug 9, 2018
1 parent 7a2ada2 commit 842a5b8
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions fs/crypto/keyinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ static int validate_user_key(struct fscrypt_info *crypt_info,
return PTR_ERR(keyring_key);
down_read(&keyring_key->sem);

if (keyring_key->type != &key_type_logon) {
printk_once(KERN_WARNING
"%s: key type must be logon\n", __func__);
res = -ENOKEY;
goto out;
}
ukp = user_key_payload(keyring_key);
if (!ukp) {
/* key was revoked before we acquired its semaphore */
Expand Down

0 comments on commit 842a5b8

Please sign in to comment.