summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2023-12-21 15:38:53 -0800
committerShelley Chen <shchen@google.com>2023-12-26 17:30:26 +0000
commitacbc03c79d5cc31b2ee87d744635dabc4bd27eb9 (patch)
tree6b57acc631151f3b1ed9286d8f9b5a82f029ed31 /src/soc/amd
parent708a11c5c72fd76ca5983b856b02c408e1826c5e (diff)
Update vboot submodule to upstream main
Updating from commit id c0cb4bfa: 2023-12-08 signer: sign_android_image.sh should die when image repacking fails to commit id 7c3b60bb: 2023-10-13 firmware/2lib: Use SSE2 to speed-up Montgomery multiplication This brings in 3 new commits: 7c3b60bb firmware/2lib: Use SSE2 to speed-up Montgomery multiplication 8bb2f369 firmware: 2load_kernel: Set data_key allow_hwcrypto flag 2b183b58 vboot_reference: open drive rdonly when getting details 6ee22049 sign_official_build: switch from dgst to pkeyutl da69cf46 Makefile: Add support for make 4.3 Also update the implementations of the vb2ex_hwcrypto_modexp() callback to match the API changes made in vboot. Change-Id: Ia6e535f4e49045e24ab005ccd7dcbbcf250f96ac Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79685 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com> Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/psp_verstage/vboot_crypto.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/soc/amd/common/psp_verstage/vboot_crypto.c b/src/soc/amd/common/psp_verstage/vboot_crypto.c
index 5ed351b604..370416f8f7 100644
--- a/src/soc/amd/common/psp_verstage/vboot_crypto.c
+++ b/src/soc/amd/common/psp_verstage/vboot_crypto.c
@@ -135,17 +135,17 @@ vb2_error_t vb2ex_hwcrypto_digest_finalize(uint8_t *digest, uint32_t digest_size
vb2_error_t vb2ex_hwcrypto_modexp(const struct vb2_public_key *key,
uint8_t *inout,
- uint32_t *workbuf32, int exp)
+ void *workbuf, size_t workbuf_size,
+ int exp)
{
- /* workbuf32 is guaranteed to be a length of
- * 3 * key->arrsize * sizeof(uint32_t).
+ /*
* Since PSP expects everything in LE and *inout is BE array,
* we'll use workbuf for temporary buffer for endian conversion.
*/
struct mod_exp_params mod_exp_param;
unsigned int key_bytes = key->arrsize * sizeof(uint32_t);
- uint32_t *sig_swapped = workbuf32;
- uint32_t *output_buffer = &workbuf32[key->arrsize];
+ uint32_t *sig_swapped = workbuf;
+ uint32_t *output_buffer = &sig_swapped[key->arrsize];
uint32_t *inout_32 = (uint32_t *)inout;
uint32_t retval;
uint32_t i;
@@ -157,6 +157,9 @@ vb2_error_t vb2ex_hwcrypto_modexp(const struct vb2_public_key *key,
return VB2_ERROR_EX_HWCRYPTO_UNSUPPORTED;
}
+ if ((void *)&output_buffer[key->arrsize] - workbuf > workbuf_size)
+ return VB2_ERROR_WORKBUF_SMALL;
+
for (i = 0; i < key->arrsize; i++)
sig_swapped[i] = swab32(inout_32[key->arrsize - i - 1]);