diff options
author | Tom Rini <trini@konsulko.com> | 2020-03-12 12:45:27 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-03-12 12:45:27 -0400 |
commit | e24f0a39d0daa2d8c597650aeb3f559d44a195ae (patch) | |
tree | 650803dabb55a0669b19e6a7069273f703d78b84 /common/image-fit.c | |
parent | 36bdcf7f3b17ec6d8cec782e7f1d5b0b8014300a (diff) | |
parent | 2201fe70d878074a9176f352693c582d7464a8d1 (diff) |
Merge branch '2020-03-12-rsa-improvements' into next
(Description from AKASHI Takahiro)
extend rsa_verify() for UEFI secure boot:
The current rsa_verify() requires five parameters for a RSA public key
for efficiency while RSA, in theory, requires only two. In addition,
those parameters are expected to come from FIT image.
So this function won't fit very well when we want to use it for the
purpose of implementing UEFI secure boot, in particular, image
authentication as well as variable authentication, where the essential
two parameters are set to be retrieved from one of X509 certificates in
signature database.
So, in this patch, additional three parameters will be calculated on the
fly when rsa_verify() is called without fdt which should contain
parameters above.
This calculation heavily relies on "big-number (or multi-precision)
library." Therefore some routines from BearSSL under MIT license are
imported in this implementation.
Diffstat (limited to 'common/image-fit.c')
-rw-r--r-- | common/image-fit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/image-fit.c b/common/image-fit.c index f3bb00c98a..9357e66e1f 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1269,7 +1269,7 @@ int fit_image_verify_with_data(const void *fit, int image_noffset, int ret; /* Verify all required signatures */ - if (IMAGE_ENABLE_VERIFY && + if (FIT_IMAGE_ENABLE_VERIFY && fit_image_verify_required_sigs(fit, image_noffset, data, size, gd_fdt_blob(), &verify_all)) { err_msg = "Unable to verify required signature"; @@ -1291,7 +1291,7 @@ int fit_image_verify_with_data(const void *fit, int image_noffset, &err_msg)) goto error; puts("+ "); - } else if (IMAGE_ENABLE_VERIFY && verify_all && + } else if (FIT_IMAGE_ENABLE_VERIFY && verify_all && !strncmp(name, FIT_SIG_NODENAME, strlen(FIT_SIG_NODENAME))) { ret = fit_image_check_sig(fit, noffset, data, @@ -1949,7 +1949,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr, if (image_type == IH_TYPE_KERNEL) images->fit_uname_cfg = fit_base_uname_config; - if (IMAGE_ENABLE_VERIFY && images->verify) { + if (FIT_IMAGE_ENABLE_VERIFY && images->verify) { puts(" Verifying Hash Integrity ... "); if (fit_config_verify(fit, cfg_noffset)) { puts("Bad Data Hash\n"); |