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

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

Issue 2792009: Fix normal/recovery mode, and RO firmware vs. RW firmware behavior. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: add a comment 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 unified diff | Download patch
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 "vboot_firmware.h" 9 #include "vboot_firmware.h"
10 10
(...skipping 22 matching lines...) Expand all
33 /* Clear output params in case we fail */ 33 /* Clear output params in case we fail */
34 params->firmware_index = 0; 34 params->firmware_index = 0;
35 params->kernel_sign_key_blob = NULL; 35 params->kernel_sign_key_blob = NULL;
36 params->kernel_sign_key_size = 0; 36 params->kernel_sign_key_size = 0;
37 37
38 /* Must have a root key */ 38 /* Must have a root key */
39 if (!root_key) 39 if (!root_key)
40 return LOAD_FIRMWARE_RECOVERY; 40 return LOAD_FIRMWARE_RECOVERY;
41 41
42 /* Initialize the TPM and read rollback indices. */ 42 /* Initialize the TPM and read rollback indices. */
43 if (0 != SetupTPM() ) 43 /* TODO: fix SetupTPM parameter */
gauravsh 2010/06/14 10:57:53 fix parameter how?
44 if (0 != SetupTPM(0, 0) )
44 return LOAD_FIRMWARE_RECOVERY; 45 return LOAD_FIRMWARE_RECOVERY;
45 if (0 != GetStoredVersions(FIRMWARE_VERSIONS, 46 if (0 != GetStoredVersions(FIRMWARE_VERSIONS,
46 &tpm_key_version, &tpm_fw_version)) 47 &tpm_key_version, &tpm_fw_version))
47 return LOAD_FIRMWARE_RECOVERY; 48 return LOAD_FIRMWARE_RECOVERY;
48 49
49 /* Loop over indices */ 50 /* Loop over indices */
50 for (index = 0; index < 2; index++) { 51 for (index = 0; index < 2; index++) {
51 VbKeyBlockHeader* key_block; 52 VbKeyBlockHeader* key_block;
52 uint64_t vblock_size; 53 uint64_t vblock_size;
53 VbFirmwarePreambleHeader* preamble; 54 VbFirmwarePreambleHeader* preamble;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 /* Lock Firmware TPM rollback indices from further writes. In 165 /* Lock Firmware TPM rollback indices from further writes. In
165 * this design, this is done by setting the globalLock bit, which 166 * this design, this is done by setting the globalLock bit, which
166 * is cleared only by TPM_Init at reboot. */ 167 * is cleared only by TPM_Init at reboot. */
167 if (0 != LockFirmwareVersions()) 168 if (0 != LockFirmwareVersions())
168 return LOAD_FIRMWARE_RECOVERY; 169 return LOAD_FIRMWARE_RECOVERY;
169 } 170 }
170 171
171 /* If we're still here, no good firmware, so go to recovery mode. */ 172 /* If we're still here, no good firmware, so go to recovery mode. */
172 return LOAD_FIRMWARE_RECOVERY; 173 return LOAD_FIRMWARE_RECOVERY;
173 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698