Commit Graph

6 Commits

Author SHA1 Message Date
Gaurav Shah
0265882a34 Change VerifyFirmware() to take separate pointers to firmware verification header and firmware data.
The firmware verification code no longer assumes that verification data and firmware data are contiguous and follow each other. Needed for EFI where the actual firmware must be stored in its own firmware volume.

BUG=1704
TEST=modified existing tests for the new API, and they still pass

Review URL: http://codereview.chromium.org/1578035
2010-04-18 16:35:07 -07:00
Gaurav Shah
e450be4ce4 Propagate use of uint64_t to more functions that may need to deal with arbitrary length data.
This CL fixes some functions to use uint64_t that I missed the first time around. It ended up requiring some minor changes to how some of the helper functions work (StatefulMemcpy*()).

Also adds new tests to make sure that reference code can verify/process big firmware and kernel images.

BUG=670
TEST=Adds some new, old ones still pass.

Review URL: http://codereview.chromium.org/1519008
2010-03-29 21:27:08 -07:00
Gaurav Shah
463be3f135 VBoot Reference: Fix splicing bugs in Firmware and Kernel verification.
BUG=670
TESTS=Adds new tests which verify this doesn't occur anymore. Existing tests still pass.

The existing code computes and verifies signatures on firmware/kernel data and firmware/kernel versions separately. This causes a image splicing bug where it is possible to combine together a version signature from a valid new firmware with firmware data and signature from an older version. The same problem exists with kernel verification.

This CL fixes this by changing the firmware/kernel signatures to also include the version information.

For the Firmware, there's a separate signature on the preamble (which contains the version) but the firmware signature now also includes this preamble in addition to the firmware data.

For the Kernel, there's a separate signature on the kernel config/options (wich also contains the version), but the kernel signature now also includes these config/options in addition to the kernel data.

Review URL: http://codereview.chromium.org/1430001
2010-03-29 16:13:45 -07:00
Gaurav Shah
a82bf268b2 VBoot Reference: Add kernel rollback prevention and choosing logic.
Also adds tests for kernel rollback prevention.

Review URL: http://codereview.chromium.org/1320010
2010-03-26 10:38:08 -07:00
Gaurav Shah
3199eed3d3 Move test utility functions to a common place.
Also removes the dev_mode flag from Firmware Image verification as key signature for the firmware should be checked whether or not dev mode is enabled.

BUG=670
TEST=All tests still pass.

Merge remote branch 'refs/remotes/origin/master' into fixtests

Fix tests, remove dev mode. Move common code.

Review URL: http://codereview.chromium.org/1280002
2010-03-25 13:04:45 -07:00
Gaurav Shah
ce0cc30e55 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
2010-03-24 13:48:55 -07:00