summaryrefslogtreecommitdiffstats
path: root/src/security
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2022-11-17 10:34:48 +0000
committerJulius Werner <jwerner@chromium.org>2022-12-01 22:12:16 +0000
commita7f669049daadf6e7c6b3c66ec6b8fc973c7bd46 (patch)
treea19fd2b3e0035f691421d00fb5c241ab9f25861a /src/security
parentd27fff59230ce2f3540a34e79c3632f455616abf (diff)
downloadcoreboot-a7f669049daadf6e7c6b3c66ec6b8fc973c7bd46.tar.gz
coreboot-a7f669049daadf6e7c6b3c66ec6b8fc973c7bd46.tar.bz2
coreboot-a7f669049daadf6e7c6b3c66ec6b8fc973c7bd46.zip
vboot: Allow for comparison of hash without zero-padding
Adjust asserts to allow to store and compare (at S3 resume) hashes without padding to maximum hash length / slot size. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: If6d46e0b58dbca86af56221b7ff2606ab2d1799a Reviewed-on: https://review.coreboot.org/c/coreboot/+/69762 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src/security')
-rw-r--r--src/security/vboot/vboot_logic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c
index 98a044c7e1d6..f7b4801ad1ef 100644
--- a/src/security/vboot/vboot_logic.c
+++ b/src/security/vboot/vboot_logic.c
@@ -86,7 +86,7 @@ static vb2_error_t handle_digest_result(void *slot_hash, size_t slot_hash_sz)
uint8_t saved_hash[VBOOT_MAX_HASH_SIZE];
const size_t saved_hash_sz = sizeof(saved_hash);
- assert(slot_hash_sz == saved_hash_sz);
+ assert(slot_hash_sz <= saved_hash_sz);
printk(BIOS_DEBUG, "Platform is resuming.\n");