public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] mkimage: ublimage must return if the header is not verified
@ 2011-09-16  9:50 Stefano Babic
  2011-09-16  9:50 ` [U-Boot] [PATCH 2/3] mkimage: Add variable lenght header support Stefano Babic
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Stefano Babic @ 2011-09-16  9:50 UTC (permalink / raw)
  To: u-boot

Each image handler must return a not-zero velue if the
header is not recognized to allow the main program to
iterate to the next handler.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Heiko Schocher <hs@denx.de>
---
 tools/ublimage.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/ublimage.c b/tools/ublimage.c
index 9987462..d6b4017 100644
--- a/tools/ublimage.c
+++ b/tools/ublimage.c
@@ -214,6 +214,11 @@ static int ublimage_check_image_types(uint8_t type)
 static int ublimage_verify_header(unsigned char *ptr, int image_size,
 			struct mkimage_params *params)
 {
+	struct ubl_header *ubl_hdr = (struct ubl_header *)ptr;
+
+	if ((ubl_hdr->magic & 0xFFFFFF00) != UBL_MAGIC_BASE)
+		return -1;
+
 	return 0;
 }
 
-- 
1.7.1

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

end of thread, other threads:[~2011-10-30 13:14 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-16  9:50 [U-Boot] [PATCH 1/3] mkimage: ublimage must return if the header is not verified Stefano Babic
2011-09-16  9:50 ` [U-Boot] [PATCH 2/3] mkimage: Add variable lenght header support Stefano Babic
2011-10-05 18:56   ` Wolfgang Denk
2011-09-16  9:50 ` [U-Boot] [PATCH 3/3] mkimage: adding support for Davinci AIS image Stefano Babic
2011-10-05 18:56   ` Wolfgang Denk
2011-10-05 20:21     ` Wolfgang Denk
2011-09-16 10:03 ` [U-Boot] [PATCH 1/3] mkimage: ublimage must return if the header is not verified Heiko Schocher
2011-09-22 10:25 ` [U-Boot] [PATCH V2 " Stefano Babic
2011-10-05 18:55   ` Wolfgang Denk
2011-10-06  8:20 ` [U-Boot] [PATCH v2 3/3] mkimage: adding support for Davinci AIS image Stefano Babic
2011-10-15 20:23   ` Wolfgang Denk
2011-10-17  8:21     ` Stefano Babic
2011-10-17  9:18       ` Wolfgang Denk
2011-10-17 10:07 ` [U-Boot] [PATCH V3 " Stefano Babic
2011-10-23 21:08   ` Wolfgang Denk
2011-10-29 16:51     ` Dirk Behme
2011-10-30  7:29       ` stefano babic
2011-10-30  8:23         ` Dirk Behme
2011-10-30 13:14           ` Wolfgang Denk

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