Commit 4f137c38 authored by David Zeuthen's avatar David Zeuthen
Browse files

libavb: Use size_t instead of uint32_t for lengths in avb_sha*() functions.

This way we support hashing content which is bigger than 4 GiB. Current
limit is now 2^64 which should be big enough for at least a while.

FWIW, we won't run into this problem with the way we use SHA-256 or
SHA-512 (the partitions with hash descriptors - e.g. boot.img and
others - are typically less than 4 GiB) but it might be nice to fix
anyway.  Bowgo pointed this out a while ago but we never fixed it.

Also add a new unit test to fix this, including tests for when the
content is greater than 4 GiB. Disable the tests for large content by
default since they're very slow to run.

Bug: None
Test: New unit tests + all unit tests pass (both on 32- and 64-bit).
Change-Id: I964ee1056c61c4591ff4c1d93ad8a1d1676e2632
parent f4f51ebe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment