diff options
author | Simon Glass <sjg@chromium.org> | 2021-11-12 12:28:10 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-01-26 08:50:44 -0700 |
commit | 99f844ba3a6b3ddd73742cddf7dee955bbb96c61 (patch) | |
tree | 27fbc1ca8b923dcfa06f090e6d0337993f0c9940 /boot/image-fit.c | |
parent | 2ad90b395313a7350cfb0543b4979a24746413b3 (diff) | |
download | u-boot-99f844ba3a6b3ddd73742cddf7dee955bbb96c61.tar.gz u-boot-99f844ba3a6b3ddd73742cddf7dee955bbb96c61.tar.bz2 u-boot-99f844ba3a6b3ddd73742cddf7dee955bbb96c61.zip |
tools: Pass the key blob around
At present we rely on the key blob being in the global_data fdt_blob
pointer. This is true in U-Boot but not with tools. For clarity, pass the
parameter around.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/image-fit.c')
-rw-r--r-- | boot/image-fit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/boot/image-fit.c b/boot/image-fit.c index 85a6f223c8..f01cafe4e2 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -1309,7 +1309,8 @@ static int fit_image_check_hash(const void *fit, int noffset, const void *data, } int fit_image_verify_with_data(const void *fit, int image_noffset, - const void *data, size_t size) + const void *key_blob, const void *data, + size_t size) { int noffset = 0; char *err_msg = ""; @@ -1319,7 +1320,7 @@ int fit_image_verify_with_data(const void *fit, int image_noffset, /* Verify all required signatures */ if (FIT_IMAGE_ENABLE_VERIFY && fit_image_verify_required_sigs(fit, image_noffset, data, size, - gd_fdt_blob(), &verify_all)) { + key_blob, &verify_all)) { err_msg = "Unable to verify required signature"; goto error; } @@ -1342,8 +1343,8 @@ int fit_image_verify_with_data(const void *fit, int image_noffset, } 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, - size, -1, &err_msg); + ret = fit_image_check_sig(fit, noffset, data, size, + gd_fdt_blob(), -1, &err_msg); /* * Show an indication on failure, but do not return @@ -1406,7 +1407,8 @@ int fit_image_verify(const void *fit, int image_noffset) goto err; } - return fit_image_verify_with_data(fit, image_noffset, data, size); + return fit_image_verify_with_data(fit, image_noffset, gd_fdt_blob(), + data, size); err: printf("error!\n%s in '%s' image node\n", err_msg, |