[U-Boot] [PATCH] tools: image: fix "algo" property of public key for verified boot

Masahiro Yamada yamada.masahiro at socionext.com
Fri Oct 27 04:25:21 UTC 2017


The "algo_name" points to a property in a blob being edited.  The
pointer becomes stale when fit_image_write_sig() inserts signatures.
Then crypto->add_verify_data() writes wrong data to the public key
destination.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 tools/image-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/image-host.c b/tools/image-host.c
index c60d4ad..ad9a73a 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -166,7 +166,7 @@ static int fit_image_setup_sig(struct image_sign_info *info,
 	info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
 	info->fit = fit;
 	info->node_offset = noffset;
-	info->name = algo_name;
+	info->name = strdup(algo_name);
 	info->checksum = image_get_checksum_algo(algo_name);
 	info->crypto = image_get_crypto_algo(algo_name);
 	info->require_keys = require_keys;
-- 
2.7.4



More information about the U-Boot mailing list