From: Roland Hieber <r.hieber@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Roland Hieber <r.hieber@pengutronix.de>
Subject: [PATCH v2] FIT: be more verbose when RSA signature check fails
Date: Thu, 9 Aug 2018 23:37:15 +0200 [thread overview]
Message-ID: <20180809213715.23715-1-r.hieber@pengutronix.de> (raw)
In-Reply-To: <20180809130740.14125-1-r.hieber@pengutronix.de>
Tell the user what device tree node we're looking for.
Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
---
v1 -> v2: prevent use-after-free of key_path
---
common/image-fit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/common/image-fit.c b/common/image-fit.c
index 6cbf23250d..dfd1fa02c9 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -289,11 +289,12 @@ static int fit_check_rsa_signature(struct device_node *sig_node,
}
key_path = xasprintf("/signature/key-%s", key_name);
key_node = of_find_node_by_path(key_path);
- free(key_path);
if (!key_node) {
- pr_info("failed to find key node\n");
+ pr_info("failed to find key node %s\n", key_path);
+ free(key_path);
return -ENOENT;
}
+ free(key_path);
ret = rsa_of_read_key(key_node, &key);
if (ret) {
--
2.18.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-08-09 21:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-09 13:07 [PATCH] " Roland Hieber
2018-08-09 21:37 ` Roland Hieber [this message]
2018-08-10 6:27 ` [PATCH v2] " Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180809213715.23715-1-r.hieber@pengutronix.de \
--to=r.hieber@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox