]> git.ipfire.org Git - people/ms/u-boot.git/commit
tools: image: allow to sign image nodes without -K option
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 27 Oct 2017 06:04:20 +0000 (15:04 +0900)
committerTom Rini <trini@konsulko.com>
Mon, 6 Nov 2017 14:59:00 +0000 (09:59 -0500)
commit6793d017a7679477402f5d30229651dba0db5ed2
tree052f1366fe6ad79259618e243ee4af40e6c0f26b
parent1d88a99d1b9175c41f015631311fd9e5966eb997
tools: image: allow to sign image nodes without -K option

If -K option is missing when you sign image nodes, it fails with
an unclear error message:

  tools/mkimage Can't add hashes to FIT blob: -1

It is hard to figure out the cause of the failure.

In contrast, when you sign configuration nodes, -K is optional because
fit_config_process_sig() returns successfully if keydest is unset.
Probably this is a preferred behavior when you want to update FIT with
the same key; you do not have to update the public key in this case.

So, this commit changes fit_image_process_sig() to continue signing
without keydest.  If ->add_verify_data() fails, show a clearer error
message, which has been borrowed from fit_config_process_sig().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
tools/image-host.c