diff options
author | Andrew Duda <aduda@meraki.com> | 2016-11-08 18:53:41 +0000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-11-21 14:07:31 -0500 |
commit | 0c1d74fda7c0063eeca4d8d9fa8674e6ec2ef685 (patch) | |
tree | 44482dc837d5bbd88006520062b443d43ab28fdb /include | |
parent | da29f2991d75fc8aa3289407a0e686a4a22f8c9e (diff) |
image: Add crypto_algo struct for RSA info
Cut down on the repetition of algorithm information by defining separate
checksum and crypto structs. image_sig_algos are now simply pairs of
unique checksum and crypto algos.
Signed-off-by: Andrew Duda <aduda@meraki.com>
Signed-off-by: aduda <aduda@meraki.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/image.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/image.h b/include/image.h index de73a071d9..c3c9866738 100644 --- a/include/image.h +++ b/include/image.h @@ -1072,7 +1072,6 @@ struct checksum_algo { const int checksum_len; const int der_len; const uint8_t *der_prefix; - const int key_len; #if IMAGE_ENABLE_SIGN const EVP_MD *(*calculate_sign)(void); #endif @@ -1081,8 +1080,9 @@ struct checksum_algo { int region_count, uint8_t *checksum); }; -struct image_sig_algo { +struct crypto_algo { const char *name; /* Name of algorithm */ + const int key_len; /** * sign() - calculate and return signature for given input data @@ -1131,7 +1131,12 @@ struct image_sig_algo { int (*verify)(struct image_sign_info *info, const struct image_region region[], int region_count, uint8_t *sig, uint sig_len); +}; +struct image_sig_algo { + const char *name; + /* pointer to cryptosystem algorithm */ + struct crypto_algo *crypto; /* pointer to checksum algorithm */ struct checksum_algo *checksum; }; |