diff options
author | Roberto Sassu <roberto.sassu@polito.it> | 2011-06-27 07:45:39 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2011-06-27 09:08:39 -0400 |
commit | f91c2c5cfa2950a20265b45bcc13e49ed9e49aac (patch) | |
tree | f5ed8f02cc44dfe9274440c8cdcd50b4345621e6 /security | |
parent | 4d67431f80b1b822f0286afc9123ee453eac7334 (diff) |
encrypted_keys: avoid dumping the master key if the request fails
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>
Diffstat (limited to 'security')
-rw-r--r-- | security/keys/encrypted.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/security/keys/encrypted.c b/security/keys/encrypted.c index b1cba5bf0a5e..37cd913f18ae 100644 --- a/security/keys/encrypted.c +++ b/security/keys/encrypted.c | |||
@@ -378,11 +378,13 @@ static struct key *request_master_key(struct encrypted_key_payload *epayload, | |||
378 | } else | 378 | } else |
379 | goto out; | 379 | goto out; |
380 | 380 | ||
381 | if (IS_ERR(mkey)) | 381 | if (IS_ERR(mkey)) { |
382 | pr_info("encrypted_key: key %s not found", | 382 | pr_info("encrypted_key: key %s not found", |
383 | epayload->master_desc); | 383 | epayload->master_desc); |
384 | if (mkey) | 384 | goto out; |
385 | dump_master_key(*master_key, *master_keylen); | 385 | } |
386 | |||
387 | dump_master_key(*master_key, *master_keylen); | ||
386 | out: | 388 | out: |
387 | return mkey; | 389 | return mkey; |
388 | } | 390 | } |