From 5cfcab54375c93fec3f04cd1cb76ea2f5beaaf97 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Mon, 4 Feb 2013 14:59:21 -0800 Subject: [PATCH] Add VbExEcGetExpectedRWHash() This is used by vboot to retrieve the precomputed hash of the expected EC image, which requires reading less data from EEPROM than getting the entire EC image. BUG=chrome-os-partner:17606 BRANCH=spring TEST=none; just a new API not used yet Change-Id: I226643144280acabba147d345ef1f83a77a91fbc Signed-off-by: Randall Spangler Reviewed-on: https://gerrit.chromium.org/gerrit/42566 --- firmware/include/vboot_api.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h index d91db7d81d..31e91a7bd4 100644 --- a/firmware/include/vboot_api.h +++ b/firmware/include/vboot_api.h @@ -105,7 +105,11 @@ enum VbErrorPredefined_t { /* Need VGA and don't have it, or vice-versa */ VBERROR_VGA_OPROM_MISMATCH = 0x10021, /* Need EC to reboot to read-only code */ - VBERROR_EC_REBOOT_TO_RO_REQUIRED = 0x10022 + VBERROR_EC_REBOOT_TO_RO_REQUIRED = 0x10022, + + /* VbExEcGetExpectedRWHash() may return the following codes */ + /* Compute expected RW hash from the EC image; BIOS doesn't have it */ + VBERROR_EC_GET_EXPECTED_HASH_FROM_IMAGE = 0x20000, }; @@ -754,6 +758,13 @@ VbError_t VbExEcHashRW(const uint8_t **hash, int *hash_size); VbError_t VbExEcGetExpectedRW(enum VbSelectFirmware_t select, const uint8_t **image, int *image_size); +/** + * Read the SHA-256 hash of the expected contents of the EC image associated + * with the main firmware specified by the "select" argument. + */ +VbError_t VbExEcGetExpectedRWHash(enum VbSelectFirmware_t select, + const uint8_t **hash, int *hash_size); + /** * Update the EC rewritable image. */