提交 f91c2c5c 编写于 作者: R Roberto Sassu 提交者: Mimi Zohar

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: NRoberto Sassu <roberto.sassu@polito.it>
Acked-by: NGianluca Ramunno <ramunno@polito.it>
Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
上级 4d67431f
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册