diff options
author | Jakub Czapiga <jacz@semihalf.com> | 2022-11-17 10:34:48 +0000 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2022-12-01 22:12:16 +0000 |
commit | a7f669049daadf6e7c6b3c66ec6b8fc973c7bd46 (patch) | |
tree | a19fd2b3e0035f691421d00fb5c241ab9f25861a /src/ec | |
parent | d27fff59230ce2f3540a34e79c3632f455616abf (diff) |
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/ec')
-rw-r--r-- | src/ec/google/chromeec/vboot_storage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ec/google/chromeec/vboot_storage.c b/src/ec/google/chromeec/vboot_storage.c index f708b3e680..63e131448a 100644 --- a/src/ec/google/chromeec/vboot_storage.c +++ b/src/ec/google/chromeec/vboot_storage.c @@ -14,8 +14,8 @@ int vboot_save_hash(void *digest, size_t digest_size) uint32_t lock_status; int num_slots; - /* Ensure the digests being saved match the EC's slot size. */ - assert(digest_size == EC_VSTORE_SLOT_SIZE); + /* Ensure the digests being saved does not exceed the EC's slot size. */ + assert(digest_size > 0 && digest_size <= EC_VSTORE_SLOT_SIZE); if (google_chromeec_vstore_write(slot, digest, digest_size)) return -1; |