summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-10-27 13:25:21 +0900
committerTom Rini <trini@konsulko.com>2017-11-06 09:59:00 -0500
commit1d88a99d1b9175c41f015631311fd9e5966eb997 (patch)
treeb79fea8451b86b2ba0af6c1f5b592ef793b63c16 /tools
parentac122efdb66f24fe4a642ec76bd32d80bf34bba4 (diff)
tools: image: fix "algo" property of public key for verified boot
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@socionext.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/image-host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/image-host.c b/tools/image-host.c
index c60d4adb3d..ad9a73acf8 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;