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

Unified Diff: src/platform/vboot_reference/utils/firmware_image.c

Issue 1320010: VBoot Reference: Add kernel rollback prevention and choosing logic. (Closed)
Patch Set: fix priority in test case Created 10 years, 9 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 | « src/platform/vboot_reference/tests/test_common.c ('k') | src/platform/vboot_reference/utils/kernel_image.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/utils/firmware_image.c
diff --git a/src/platform/vboot_reference/utils/firmware_image.c b/src/platform/vboot_reference/utils/firmware_image.c
index 13eba6c9bce9321fe42e8d43fefa966e7a168673..a197708427c4e7053bcd6e22941f3d40b18131e7 100644
--- a/src/platform/vboot_reference/utils/firmware_image.c
+++ b/src/platform/vboot_reference/utils/firmware_image.c
@@ -680,15 +680,15 @@ int VerifyFirmwareDriver_f(uint8_t* root_key_blob,
/* Stored version may need to be updated but only if FirmwareB
* is successfully verified and has a logical version greater than
* the stored logical version. */
- if (VERIFY_FIRMWARE_SUCCESS == VerifyFirmware(root_key_blob, firmwareB)) {
- if (stored_lversion < firmwareB_lversion) {
- WriteStoredVersion(FIRMWARE_KEY_VERSION,
- (uint16_t) (min_lversion >> 16));
- WriteStoredVersion(FIRMWARE_VERSION,
- (uint16_t) (min_lversion & 0x00FFFF));
- stored_lversion = min_lversion; /* Update stored version as it's used
- * later. */
- }
+ if (stored_lversion < firmwareB_lversion) {
+ if (VERIFY_FIRMWARE_SUCCESS == VerifyFirmware(root_key_blob, firmwareB)) {
+ WriteStoredVersion(FIRMWARE_KEY_VERSION,
+ (uint16_t) (min_lversion >> 16));
+ WriteStoredVersion(FIRMWARE_VERSION,
+ (uint16_t) (min_lversion & 0x00FFFF));
+ stored_lversion = min_lversion; /* Update stored version as it's used
+ * later. */
+ }
}
}
/* Lock Firmware TPM rollback indices from further writes. */
@@ -724,7 +724,7 @@ int VerifyFirmwareDriver_f(uint8_t* root_key_blob,
*/
if (stored_lversion <= firmwareB_lversion &&
(VERIFY_FIRMWARE_SUCCESS == VerifyFirmware(root_key_blob, firmwareB)))
- return BOOT_FIRMWARE_B_CONTINUE;
+ return BOOT_FIRMWARE_B_CONTINUE;
}
/* D'oh: No bootable firmware. */
return BOOT_FIRMWARE_RECOVERY_CONTINUE;
« no previous file with comments | « src/platform/vboot_reference/tests/test_common.c ('k') | src/platform/vboot_reference/utils/kernel_image.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698