diff options
author | Simon Glass <sjg@chromium.org> | 2021-11-12 12:28:13 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-01-26 08:50:44 -0700 |
commit | 2d2384bbaff0ab84c868b553c74048a5f6acc9e3 (patch) | |
tree | 1edf6dbd436d0459c85a769626387dbf1c3ff93c /include/image.h | |
parent | 9737c2d1ebe0fe61e1f406f7158b97552b6acad2 (diff) | |
download | u-boot-2d2384bbaff0ab84c868b553c74048a5f6acc9e3.zip u-boot-2d2384bbaff0ab84c868b553c74048a5f6acc9e3.tar.gz u-boot-2d2384bbaff0ab84c868b553c74048a5f6acc9e3.tar.bz2 |
tools: mkimage: Show where signatures/keys are written
At present mkimage displays the node information but it is not clear what
signing action was taken. Add a message that shows it. For now it only
supports showing a single signing action, since that is the common case.
Sample:
Signature written to 'sha1-basic/test.fit',
node '/configurations/conf-1/signature'
Public key written to 'sha1-basic/sandbox-u-boot.dtb',
node '/signature/key-dev'
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/image.h')
-rw-r--r-- | include/image.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/include/image.h b/include/image.h index cf38aec..97e5f2e 100644 --- a/include/image.h +++ b/include/image.h @@ -1021,6 +1021,25 @@ int fit_cipher_data(const char *keydir, void *keydest, void *fit, const char *comment, int require_keys, const char *engine_id, const char *cmdname); +#define NODE_MAX_NAME_LEN 80 + +/** + * struct image_summary - Provides information about signing info added + * + * @sig_offset: Offset of the node in the blob devicetree where the signature + * was wriiten + * @sig_path: Path to @sig_offset + * @keydest_offset: Offset of the node in the keydest devicetree where the + * public key was written (-1 if none) + * @keydest_path: Path to @keydest_offset + */ +struct image_summary { + int sig_offset; + char sig_path[NODE_MAX_NAME_LEN]; + int keydest_offset; + char keydest_path[NODE_MAX_NAME_LEN]; +}; + /** * fit_add_verification_data() - add verification data to FIT image nodes * @@ -1032,6 +1051,7 @@ int fit_cipher_data(const char *keydir, void *keydest, void *fit, * @engine_id: Engine to use for signing * @cmdname: Command name used when reporting errors * @algo_name: Algorithm name, or NULL if to be read from FIT + * @summary: Returns information about what data was written * * Adds hash values for all component images in the FIT blob. * Hashes are calculated for all component images which have hash subnodes @@ -1046,7 +1066,8 @@ int fit_cipher_data(const char *keydir, void *keydest, void *fit, int fit_add_verification_data(const char *keydir, const char *keyfile, void *keydest, void *fit, const char *comment, int require_keys, const char *engine_id, - const char *cmdname, const char *algo_name); + const char *cmdname, const char *algo_name, + struct image_summary *summary); /** * fit_image_verify_with_data() - Verify an image with given data |