All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common: fit-sig: Fix error message in fit_config_verify_sig()
@ 2021-01-11 14:46 Alexandru Gagniuc
  2021-01-13 16:10 ` Simon Glass
  2021-01-28 23:57 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Alexandru Gagniuc @ 2021-01-11 14:46 UTC (permalink / raw)
  To: u-boot

In fit_config_verify_sig(), when no 'signature*' subnode exists in
the configuration node, the fdt_for_each_subnode() loop is a no-op.
Therefore, no error flags are set, and 'err_,sg' is not populated
with an error string. This is incorrect behavior.

Populate err_msg to indicate that no 'signature' is found, before
entering the loop. The first call to fit_image_verify_sig() will
override clear err_msg, or set it to a more specific message.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 common/image-fit-sig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c
index 7fcbb47235..f8a68b08dc 100644
--- a/common/image-fit-sig.c
+++ b/common/image-fit-sig.c
@@ -374,7 +374,7 @@ static int fit_config_verify_sig(const void *fit, int conf_noffset,
 				 const void *sig_blob, int sig_offset)
 {
 	int noffset;
-	char *err_msg = "";
+	char *err_msg = "No 'signature' subnode found";
 	int verified = 0;
 	int ret;
 
-- 
2.26.2

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

* [PATCH] common: fit-sig: Fix error message in fit_config_verify_sig()
  2021-01-11 14:46 [PATCH] common: fit-sig: Fix error message in fit_config_verify_sig() Alexandru Gagniuc
@ 2021-01-13 16:10 ` Simon Glass
  2021-01-28 23:57 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-01-13 16:10 UTC (permalink / raw)
  To: u-boot

On Mon, 11 Jan 2021 at 07:47, Alexandru Gagniuc <mr.nuke.me@gmail.com> wrote:
>
> In fit_config_verify_sig(), when no 'signature*' subnode exists in
> the configuration node, the fdt_for_each_subnode() loop is a no-op.
> Therefore, no error flags are set, and 'err_,sg' is not populated
> with an error string. This is incorrect behavior.
>
> Populate err_msg to indicate that no 'signature' is found, before
> entering the loop. The first call to fit_image_verify_sig() will
> override clear err_msg, or set it to a more specific message.
>
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> ---
>  common/image-fit-sig.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [PATCH] common: fit-sig: Fix error message in fit_config_verify_sig()
  2021-01-11 14:46 [PATCH] common: fit-sig: Fix error message in fit_config_verify_sig() Alexandru Gagniuc
  2021-01-13 16:10 ` Simon Glass
@ 2021-01-28 23:57 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-01-28 23:57 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 11, 2021 at 08:46:58AM -0600, Alexandru Gagniuc wrote:

> In fit_config_verify_sig(), when no 'signature*' subnode exists in
> the configuration node, the fdt_for_each_subnode() loop is a no-op.
> Therefore, no error flags are set, and 'err_,sg' is not populated
> with an error string. This is incorrect behavior.
> 
> Populate err_msg to indicate that no 'signature' is found, before
> entering the loop. The first call to fit_image_verify_sig() will
> override clear err_msg, or set it to a more specific message.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/5e0fd6bd/attachment.sig>

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

end of thread, other threads:[~2021-01-28 23:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 14:46 [PATCH] common: fit-sig: Fix error message in fit_config_verify_sig() Alexandru Gagniuc
2021-01-13 16:10 ` Simon Glass
2021-01-28 23:57 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.