mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-25 01:07:22 +00:00
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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user