VBoot Reference: Add version checking to for preventing rollbacks.

This CL adds a new function VerifyFirmwareDriver_f() means to be a part of the RO firmware which determine which copy of the firmware to boot from. It is meant to ensure that a particular firmware is only booted if 1) it verifies successfully, 2) its version is newer or equal to current stored version. In addition, the driver function also updates the stored version if needed.

Currently I am using the TLCL API with stub calls, (in fact, most of the TPM interaction is done in rollback_index.c which implements the actual version query/update API) used by the firmware.

Review URL: http://codereview.chromium.org/1241002
This commit is contained in:
Gaurav Shah
2010-03-24 13:48:55 -07:00
parent 1e56693763
commit ce0cc30e55
14 changed files with 725 additions and 81 deletions

View File

@@ -13,6 +13,14 @@
#include <inttypes.h>
#include <string.h>
/* Combine [msw] and [lsw] uint16s to a uint32_t with its [msw] and
* [lsw] forming the most and least signficant 16-bit words.
*/
#define CombineUint16Pair(msw,lsw) (((msw) << 16) | \
(((lsw)) & 0xFFFF))
/* Return the minimum of (a) or (b). */
#define Min(a, b) (((a) < (b)) ? (a) : (b))
/* Allocate [size] bytes and return a pointer to the allocated memory. Abort
* on error.
*/