Skip to content

Commit

Permalink
encrypted_keys: avoid dumping the master key if the request fails
Browse files Browse the repository at this point in the history
Do not dump the master key if an error is encountered during the request.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
  • Loading branch information
Roberto Sassu authored and Mimi Zohar committed Jun 27, 2011
1 parent 4d67431 commit f91c2c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions security/keys/encrypted.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,13 @@ static struct key *request_master_key(struct encrypted_key_payload *epayload,
} else
goto out;

if (IS_ERR(mkey))
if (IS_ERR(mkey)) {
pr_info("encrypted_key: key %s not found",
epayload->master_desc);
if (mkey)
dump_master_key(*master_key, *master_keylen);
goto out;
}

dump_master_key(*master_key, *master_keylen);
out:
return mkey;
}
Expand Down

0 comments on commit f91c2c5

Please sign in to comment.