commonlib: Add function to hash contents of a CBFS region

Hardware / Coreboot - Aaron Durbin [chromium.org] - 5 January 2016 18:12 UTC

Provide a common routine to hash the contents of a cbfs region. The cbfs region is hashed in the following order: 1. potential cbfs header at offset 0 2. potential cbfs header retlative offset at cbfs size - 4 3. For each file the metadata of the file. 4. For each non-empty file the data of the file.

BUG=chrome-os-partner:48412 BUG=chromium:445938 BRANCH=None TEST=Utilized in chromeos cros_bundle_firmware as well as at runtime during vboot verification on glados.

Change-Id: Ie1e5db5b8a80d9465e88d3f69f5367d887bdf73f

cbb6c75 commonlib: Add function to hash contents of a CBFS region.
Makefile.inc | 2 +
src/commonlib/cbfs.c | 158 ++++++++++++++++++++++++++-
src/commonlib/include/commonlib/cbfs.h | 12 ++
src/vendorcode/amd/pi/Makefile.inc | 1 +
src/vendorcode/google/chromeos/Makefile.inc | 2 -
5 files changed, 168 insertions(+), 7 deletions(-)

Upstream: review.coreboot.org


  • Share