Re: [PATCH 2/2] boot: image-pre-load: Check environment for location of signature info

2022-10-11 Thread Tom Rini
On Wed, Sep 14, 2022 at 08:57:28PM +0200, Steven Lawrance wrote:

> Setting an alternative signature info node in "pre_load_sig_info_path"
> allows verification of an image using the bootm pre-load mechanism with
> a different key, e.g.: setenv pre_load_sig_info_path "/alt/sig" ; bootm
> preload [addr]
> 
> Signed-off-by: Steven Lawrance 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 2/2] boot: image-pre-load: Check environment for location of signature info

2022-09-15 Thread Simon Glass
On Wed, 14 Sept 2022 at 12:57, Steven Lawrance
 wrote:
>
> Setting an alternative signature info node in "pre_load_sig_info_path"
> allows verification of an image using the bootm pre-load mechanism with
> a different key, e.g.: setenv pre_load_sig_info_path "/alt/sig" ; bootm
> preload [addr]
>
> Signed-off-by: Steven Lawrance 
> ---
>  boot/image-pre-load.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass 


[PATCH 2/2] boot: image-pre-load: Check environment for location of signature info

2022-09-14 Thread Steven Lawrance
Setting an alternative signature info node in "pre_load_sig_info_path"
allows verification of an image using the bootm pre-load mechanism with
a different key, e.g.: setenv pre_load_sig_info_path "/alt/sig" ; bootm
preload [addr]

Signed-off-by: Steven Lawrance 
---
 boot/image-pre-load.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/boot/image-pre-load.c b/boot/image-pre-load.c
index 01b60030fc..b504ab42a5 100644
--- a/boot/image-pre-load.c
+++ b/boot/image-pre-load.c
@@ -33,6 +33,7 @@ static int image_pre_load_sig_setup(struct image_sig_info 
*info)
const u32 *sig_size;
int key_len;
int node, ret = 0;
+   char *sig_info_path = NULL;
 
if (!info) {
log_err("ERROR: info is NULL for image pre-load sig check\n");
@@ -42,7 +43,11 @@ static int image_pre_load_sig_setup(struct image_sig_info 
*info)
 
memset(info, 0, sizeof(*info));
 
-   node = fdt_path_offset(gd_fdt_blob(), IMAGE_PRE_LOAD_PATH);
+   sig_info_path = env_get("pre_load_sig_info_path");
+   if (!sig_info_path)
+   sig_info_path = IMAGE_PRE_LOAD_PATH;
+
+   node = fdt_path_offset(gd_fdt_blob(), sig_info_path);
if (node < 0) {
log_info("INFO: no info for image pre-load sig check\n");
ret = 1;
-- 
2.37.2