summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2018-12-17 23:56:16 +0000
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2019-09-09 00:23:19 +0100
commit319817bd424b1dde057281887c0f0ee0332099e1 (patch)
tree8f616896f881a4bc0b448b0c6d75e86b572a49bc
parentceae8c623fdc323be12014f50041fbddee4c5ed5 (diff)
cmd: image_info: Add checking of default FIT configlinaro-imx
This patch adds a check for the default FIT config to iminfo. Once applied any signing of the config will show a pass fail similar to rsa+/rsa- for pass/fail. Output looks like this: Hash(es) for Image 0 (kernel@1): sha1+ Hash(es) for Image 1 (fdt@imx7s-warp.dtb): sha1+ Hash(es) for Image 2 (ramdisk@1): sha1+ Hash(es) for Image 3 (bootscr): sha1+ Hash for default configuration: sha1,rsa2048:mbl-fit-rot-key+ Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Jun Nie <jun.nie@linaro.org> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
-rw-r--r--cmd/bootm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/bootm.c b/cmd/bootm.c
index 41b341e2e5..62b9b931df 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -244,6 +244,9 @@ static int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
static int image_info(ulong addr)
{
+#if defined(CONFIG_FIT)
+ int cfg_noffset, noffset;
+#endif
void *hdr = (void *)addr;
printf("\n## Checking Image at %08lx ...\n", addr);
@@ -294,6 +297,20 @@ static int image_info(ulong addr)
return 1;
}
+ cfg_noffset = fit_conf_get_node(hdr, NULL);
+ if (!cfg_noffset) {
+ printf("Could not find configuration node: %s\n",
+ fdt_strerror(cfg_noffset));
+ return 1;
+ }
+
+ puts(" Hash for default configuration: ");
+ if (fit_config_verify(hdr, cfg_noffset)) {
+ puts("Unable to verify default fit config\n");
+ return 1;
+ }
+ puts("\n");
+
return 0;
#endif
default: