aboutsummaryrefslogtreecommitdiff
path: root/tools/image-host.c
diff options
context:
space:
mode:
authorAndrew Duda2016-11-08 18:53:41 +0000
committerTom Rini2016-11-21 14:07:31 -0500
commit0c1d74fda7c0063eeca4d8d9fa8674e6ec2ef685 (patch)
tree44482dc837d5bbd88006520062b443d43ab28fdb /tools/image-host.c
parentda29f2991d75fc8aa3289407a0e686a4a22f8c9e (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 'tools/image-host.c')
-rw-r--r--tools/image-host.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/image-host.c b/tools/image-host.c
index 11046952fcf..dac85b4b747 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -213,7 +213,7 @@ static int fit_image_process_sig(const char *keydir, void *keydest,
node_name = fit_get_name(fit, noffset, NULL);
region.data = data;
region.size = size;
- ret = info.algo->sign(&info, &region, 1, &value, &value_len);
+ ret = info.algo->crypto->sign(&info, &region, 1, &value, &value_len);
if (ret) {
printf("Failed to sign '%s' signature node in '%s' image node: %d\n",
node_name, image_name, ret);
@@ -239,7 +239,7 @@ static int fit_image_process_sig(const char *keydir, void *keydest,
info.keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
if (keydest)
- ret = info.algo->add_verify_data(&info, keydest);
+ ret = info.algo->crypto->add_verify_data(&info, keydest);
else
return -1;
@@ -588,7 +588,8 @@ static int fit_config_process_sig(const char *keydir, void *keydest,
require_keys ? "conf" : NULL))
return -1;
- ret = info.algo->sign(&info, region, region_count, &value, &value_len);
+ ret = info.algo->crypto->sign(&info, region, region_count, &value,
+ &value_len);
free(region);
if (ret) {
printf("Failed to sign '%s' signature node in '%s' conf node\n",
@@ -617,7 +618,7 @@ static int fit_config_process_sig(const char *keydir, void *keydest,
/* Write the public key into the supplied FDT file */
if (keydest) {
- ret = info.algo->add_verify_data(&info, keydest);
+ ret = info.algo->crypto->add_verify_data(&info, keydest);
if (ret == -ENOSPC)
return -ENOSPC;
if (ret) {