summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPhilippe Reynes <philippe.reynes@softathome.com>2018-11-14 13:51:00 +0100
committerTom Rini <trini@konsulko.com>2018-12-03 10:44:10 -0500
commit20031567e12bb312bff95b70767f6275e20f0346 (patch)
tree00c9c34581da071f3a87ee01c27370cc524cf223 /tools
parent3b5d6979fcb80ffae3b140be6edc04cbde1a0b72 (diff)
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 'tools')
-rw-r--r--tools/image-host.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/image-host.c b/tools/image-host.c
index 09e4f47e5ab..88b329502ca 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -157,6 +157,7 @@ static int fit_image_setup_sig(struct image_sign_info *info,
{
const char *node_name;
char *algo_name;
+ const char *padding_name;
node_name = fit_get_name(fit, noffset, NULL);
if (fit_image_hash_get_algo(fit, noffset, &algo_name)) {
@@ -165,6 +166,8 @@ static int fit_image_setup_sig(struct image_sign_info *info,
return -1;
}
+ padding_name = fdt_getprop(fit, noffset, "padding", NULL);
+
memset(info, '\0', sizeof(*info));
info->keydir = keydir;
info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
@@ -173,6 +176,7 @@ static int fit_image_setup_sig(struct image_sign_info *info,
info->name = strdup(algo_name);
info->checksum = image_get_checksum_algo(algo_name);
info->crypto = image_get_crypto_algo(algo_name);
+ info->padding = image_get_padding_algo(padding_name);
info->require_keys = require_keys;
info->engine_id = engine_id;
if (!info->checksum || !info->crypto) {