Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f91c2c5c authored by Roberto Sassu's avatar Roberto Sassu Committed by Mimi Zohar
Browse files

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: default avatarRoberto Sassu <roberto.sassu@polito.it>
Acked-by: default avatarGianluca Ramunno <ramunno@polito.it>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 4d67431f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -378,10 +378,12 @@ 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)
		goto out;
	}

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