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

Side by Side Diff: firmware/lib/vboot_firmware.c

Issue 2869022: New rollback_index API. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: small API change Created 10 years, 5 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 unified diff | Download patch
« no previous file with comments | « firmware/lib/rollback_index.c ('k') | firmware/linktest/main.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 * 4 *
5 * High-level firmware API for loading and verifying rewritable firmware. 5 * High-level firmware API for loading and verifying rewritable firmware.
6 * (Firmware portion) 6 * (Firmware portion)
7 */ 7 */
8 8
9 #include "load_firmware_fw.h" 9 #include "load_firmware_fw.h"
10 #include "rollback_index.h" 10 #include "rollback_index.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return LOAD_FIRMWARE_RECOVERY; 53 return LOAD_FIRMWARE_RECOVERY;
54 } 54 }
55 55
56 /* Must have a root key */ 56 /* Must have a root key */
57 if (!root_key) { 57 if (!root_key) {
58 VBDEBUG(("No root key\n")); 58 VBDEBUG(("No root key\n"));
59 return LOAD_FIRMWARE_RECOVERY; 59 return LOAD_FIRMWARE_RECOVERY;
60 } 60 }
61 61
62 /* Initialize the TPM and read rollback indices. */ 62 /* Initialize the TPM and read rollback indices. */
63 if (0 != RollbackFirmwareSetup( 63 if (0 != RollbackFirmwareSetup(params->boot_flags & BOOT_FLAG_DEVELOPER)) {
64 (params->boot_flags & BOOT_FLAG_DEVELOPER ? 1 : 0), 64 VBDEBUG(("Unable to setup TPM.\n"));
65 &tpm_key_version, &tpm_fw_version)) { 65 return LOAD_FIRMWARE_RECOVERY;
66 VBDEBUG(("Unable to get stored versions.\n")); 66 }
67 if (0 != RollbackFirmwareRead(&tpm_key_version, &tpm_fw_version)) {
68 VBDEBUG(("Unable to read stored versions.\n"));
67 return LOAD_FIRMWARE_RECOVERY; 69 return LOAD_FIRMWARE_RECOVERY;
68 } 70 }
69 71
70 /* Allocate our internal data */ 72 /* Allocate our internal data */
71 lfi = (VbLoadFirmwareInternal*)Malloc(sizeof(VbLoadFirmwareInternal)); 73 lfi = (VbLoadFirmwareInternal*)Malloc(sizeof(VbLoadFirmwareInternal));
72 if (!lfi) 74 if (!lfi)
73 return LOAD_FIRMWARE_RECOVERY; 75 return LOAD_FIRMWARE_RECOVERY;
74 params->load_firmware_internal = (uint8_t*)lfi; 76 params->load_firmware_internal = (uint8_t*)lfi;
75 77
76 /* Loop over indices */ 78 /* Loop over indices */
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 234
233 /* Success */ 235 /* Success */
234 VBDEBUG(("Will boot firmware index %d\n", (int)params->firmware_index)); 236 VBDEBUG(("Will boot firmware index %d\n", (int)params->firmware_index));
235 return LOAD_FIRMWARE_SUCCESS; 237 return LOAD_FIRMWARE_SUCCESS;
236 } 238 }
237 239
238 /* If we're still here, no good firmware, so go to recovery mode. */ 240 /* If we're still here, no good firmware, so go to recovery mode. */
239 VBDEBUG(("Alas, no good firmware.\n")); 241 VBDEBUG(("Alas, no good firmware.\n"));
240 return LOAD_FIRMWARE_RECOVERY; 242 return LOAD_FIRMWARE_RECOVERY;
241 } 243 }
OLDNEW
« no previous file with comments | « firmware/lib/rollback_index.c ('k') | firmware/linktest/main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698