diff options
author | Philippe Reynes <philippe.reynes@softathome.com> | 2018-11-14 13:51:00 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-12-03 10:44:10 -0500 |
commit | 20031567e12bb312bff95b70767f6275e20f0346 (patch) | |
tree | 00c9c34581da071f3a87ee01c27370cc524cf223 /include/image.h | |
parent | 3b5d6979fcb80ffae3b140be6edc04cbde1a0b72 (diff) | |
download | u-boot-20031567e12bb312bff95b70767f6275e20f0346.tar.gz |
rsa: add a structure for the padding
The rsa signature use a padding algorithm. By default, we use the
padding pkcs-1.5. In order to add some new padding algorithm, we
add a padding framework to manage several padding algorithm.
The choice of the padding is done in the file .its.
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/image.h')
-rw-r--r-- | include/image.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/image.h b/include/image.h index f67502e333..e75d1763b5 100644 --- a/include/image.h +++ b/include/image.h @@ -1101,6 +1101,7 @@ struct image_sign_info { int node_offset; /* Offset of signature node */ const char *name; /* Algorithm name */ struct checksum_algo *checksum; /* Checksum algorithm information */ + struct padding_algo *padding; /* Padding algorithm information */ struct crypto_algo *crypto; /* Crypto algorithm information */ const void *fdt_blob; /* FDT containing public keys */ int required_keynode; /* Node offset of key to use: -1=any */ @@ -1186,6 +1187,13 @@ struct crypto_algo { uint8_t *sig, uint sig_len); }; +struct padding_algo { + const char *name; + int (*verify)(struct image_sign_info *info, + uint8_t *pad, int pad_len, + const uint8_t *hash, int hash_len); +}; + /** * image_get_checksum_algo() - Look up a checksum algorithm * @@ -1203,6 +1211,14 @@ struct checksum_algo *image_get_checksum_algo(const char *full_name); struct crypto_algo *image_get_crypto_algo(const char *full_name); /** + * image_get_padding_algo() - Look up a padding algorithm + * + * @param name Name of padding algorithm + * @return pointer to algorithm information, or NULL if not found + */ +struct padding_algo *image_get_padding_algo(const char *name); + +/** * fit_image_verify_required_sigs() - Verify signatures marked as 'required' * * @fit: FIT to check |