mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] FIT: be more verbose when RSA signature check fails
@ 2018-08-09 13:07 Roland Hieber
  2018-08-09 21:37 ` [PATCH v2] " Roland Hieber
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Hieber @ 2018-08-09 13:07 UTC (permalink / raw)
  To: barebox; +Cc: Roland Hieber

Tell the user what device tree node we're looking for.

Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
---
 common/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index 6cbf23250d..72b5bbf179 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -291,7 +291,7 @@ static int fit_check_rsa_signature(struct device_node *sig_node,
 	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);
 		return -ENOENT;
 	}
 
-- 
2.18.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] FIT: be more verbose when RSA signature check fails
  2018-08-09 13:07 [PATCH] FIT: be more verbose when RSA signature check fails Roland Hieber
@ 2018-08-09 21:37 ` Roland Hieber
  2018-08-10  6:27   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Hieber @ 2018-08-09 21:37 UTC (permalink / raw)
  To: barebox; +Cc: Roland Hieber

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] FIT: be more verbose when RSA signature check fails
  2018-08-09 21:37 ` [PATCH v2] " Roland Hieber
@ 2018-08-10  6:27   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2018-08-10  6:27 UTC (permalink / raw)
  To: Roland Hieber; +Cc: barebox

On Thu, Aug 09, 2018 at 11:37:15PM +0200, Roland Hieber wrote:
> 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(-)

Applied, thanks

Sascha

> 
> 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
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-10  6:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09 13:07 [PATCH] FIT: be more verbose when RSA signature check fails Roland Hieber
2018-08-09 21:37 ` [PATCH v2] " Roland Hieber
2018-08-10  6:27   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox