mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 3/6] bootm: fit: Print error when image is not hashed
Date: Tue, 10 May 2016 16:08:06 +0200	[thread overview]
Message-ID: <1462889289-24215-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1462889289-24215-1-git-send-email-s.hauer@pengutronix.de>

When fit is configured to check hashes print an error when an image
does not contain hashes instead of failing silently.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/image-fit.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index 4f5c1f1..a6e1082 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -436,9 +436,12 @@ static int fit_open_image(struct fit_handle *handle, const char *unit, const voi
 			if (ret < 0)
 				return ret;
 		}
+
+		if (ret < 0) {
+			pr_err("image '%s': '%s' does not have hashes\n", unit, desc);
+			return ret;
+		}
 	}
-	if (ret < 0)
-		return ret;
 
 	*outdata = data;
 	*outsize = data_len;
-- 
2.8.0.rc3


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

  parent reply	other threads:[~2016-05-10 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 14:08 [PATCH 1/6] bootm: Move bootm options to common/Kconfig Sascha Hauer
2016-05-10 14:08 ` [PATCH 2/6] bootm: Add missing BOOTM_FORCE_SIGNED_IMAGES option Sascha Hauer
2016-05-10 14:08 ` Sascha Hauer [this message]
2016-05-10 14:08 ` [PATCH 4/6] bootm: fit: Print error when image is not signed Sascha Hauer
2016-05-10 14:08 ` [PATCH 5/6] bootm: set bootm_verify_mode to correct value Sascha Hauer
2016-05-10 14:08 ` [PATCH 6/6] bootm: Add verify mode "available" 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=1462889289-24215-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@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