Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: firmware/lib/vboot_firmware.c

Issue 2861020: Refactor rollback interface for LoadKernel(), LoadFirmware(). (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/rollback_index.c ('k') | firmware/lib/vboot_kernel.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_firmware.c
diff --git a/firmware/lib/vboot_firmware.c b/firmware/lib/vboot_firmware.c
index 6f20641af5967cabe70b450b4e3be22690de1224..a59b238e850d40d60f253defe5d5432e2593d5eb 100644
--- a/firmware/lib/vboot_firmware.c
+++ b/firmware/lib/vboot_firmware.c
@@ -58,12 +58,7 @@ int LoadFirmware(LoadFirmwareParams* params) {
/* Initialize the TPM and read rollback indices. */
/* TODO: fix SetupTPM parameter for developer mode */
- if (0 != SetupTPM(RO_NORMAL_MODE, 0)) {
- debug("SetupTPM failed\n");
- return LOAD_FIRMWARE_RECOVERY;
- }
- if (0 != GetStoredVersions(FIRMWARE_VERSIONS,
- &tpm_key_version, &tpm_fw_version)) {
+ if (0 != RollbackFirmwareSetup(0, &tpm_key_version, &tpm_fw_version)) {
debug("Unable to get stored versions.\n");
return LOAD_FIRMWARE_RECOVERY;
}
@@ -217,18 +212,15 @@ int LoadFirmware(LoadFirmwareParams* params) {
if ((lowest_key_version > tpm_key_version) ||
(lowest_key_version == tpm_key_version &&
lowest_fw_version > tpm_fw_version)) {
- if (0 != WriteStoredVersions(FIRMWARE_VERSIONS,
- (uint16_t)lowest_key_version,
- (uint16_t)lowest_fw_version)) {
+ if (0 != RollbackFirmwareWrite((uint16_t)lowest_key_version,
+ (uint16_t)lowest_fw_version)) {
debug("Unable to write stored versions.\n");
return LOAD_FIRMWARE_RECOVERY;
}
}
- /* Lock Firmware TPM rollback indices from further writes. In
- * this design, this is done by setting the globalLock bit, which
- * is cleared only by TPM_Init at reboot. */
- if (0 != LockFirmwareVersions()) {
+ /* Lock firmware versions in TPM */
+ if (0 != RollbackFirmwareLock()) {
debug("Unable to lock firmware versions.\n");
return LOAD_FIRMWARE_RECOVERY;
}
« no previous file with comments | « firmware/lib/rollback_index.c ('k') | firmware/lib/vboot_kernel.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698