include/image.h defines constants for the FIT property names, but mkimage still spells out two of them as string literals.
When the signing algorithm is given with -o, fit_image_write_sig() records it in the "algo" property of the signature node using a literal, while fit_image_hash_get_algo(), which mkimage and the verification code use to read that property, uses FIT_ALGO_PROP. Use the constant for the write as well. fdt_property_file() takes the property name as an argument but ignores it and always writes "data". Every caller passes FIT_DATA_PROP, so use the argument. No functional change. Signed-off-by: Aristo Chen <[email protected]> --- tools/fit_image.c | 2 +- tools/image-host.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/fit_image.c b/tools/fit_image.c index f7d11904472..077906889ca 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -250,7 +250,7 @@ static int fdt_property_file(struct image_tool_params *params, goto err; } - ret = fdt_property_placeholder(fdt, "data", sbuf.st_size, &ptr); + ret = fdt_property_placeholder(fdt, name, sbuf.st_size, &ptr); if (ret) goto err; ret = read(fd, ptr, sbuf.st_size); diff --git a/tools/image-host.c b/tools/image-host.c index 46036673050..3974ee3d389 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -167,7 +167,8 @@ static int fit_image_write_sig(void *fit, int noffset, uint8_t *value, } } if (algo_name && !ret) - ret = fdt_setprop_string(fit, noffset, "algo", algo_name); + ret = fdt_setprop_string(fit, noffset, FIT_ALGO_PROP, + algo_name); return ret; } -- 2.43.0
