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

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

Issue 2865014: Assorted integration fixes. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Add struct size tests 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
« no previous file with comments | « firmware/lib/include/vboot_struct.h ('k') | firmware/lib/vboot_kernel.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 params->kernel_sign_key_blob = NULL; 48 params->kernel_sign_key_blob = NULL;
49 params->kernel_sign_key_size = 0; 49 params->kernel_sign_key_size = 0;
50 50
51 debug("LoadFirmware started...\n"); 51 debug("LoadFirmware started...\n");
52 52
53 /* Must have a root key */ 53 /* Must have a root key */
54 if (!root_key) 54 if (!root_key)
55 return LOAD_FIRMWARE_RECOVERY; 55 return LOAD_FIRMWARE_RECOVERY;
56 56
57 /* Initialize the TPM and read rollback indices. */ 57 /* Initialize the TPM and read rollback indices. */
58 /* TODO: fix SetupTPM parameter */ 58 /* TODO: fix SetupTPM parameter for developer mode */
59 if (0 != SetupTPM(0, 0) ) 59 if (0 != SetupTPM(RO_NORMAL_MODE, 0) )
60 return LOAD_FIRMWARE_RECOVERY; 60 return LOAD_FIRMWARE_RECOVERY;
61 if (0 != GetStoredVersions(FIRMWARE_VERSIONS, 61 if (0 != GetStoredVersions(FIRMWARE_VERSIONS,
62 &tpm_key_version, &tpm_fw_version)) 62 &tpm_key_version, &tpm_fw_version))
63 return LOAD_FIRMWARE_RECOVERY; 63 return LOAD_FIRMWARE_RECOVERY;
64 64
65 /* Allocate our internal data */ 65 /* Allocate our internal data */
66 lfi = (VbLoadFirmwareInternal*)Malloc(sizeof(VbLoadFirmwareInternal)); 66 lfi = (VbLoadFirmwareInternal*)Malloc(sizeof(VbLoadFirmwareInternal));
67 if (!lfi) 67 if (!lfi)
68 return LOAD_FIRMWARE_RECOVERY; 68 return LOAD_FIRMWARE_RECOVERY;
69 params->load_firmware_internal = (uint8_t*)lfi; 69 params->load_firmware_internal = (uint8_t*)lfi;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 (uint16_t)lowest_key_version, 197 (uint16_t)lowest_key_version,
198 (uint16_t)lowest_fw_version)) 198 (uint16_t)lowest_fw_version))
199 return LOAD_FIRMWARE_RECOVERY; 199 return LOAD_FIRMWARE_RECOVERY;
200 } 200 }
201 201
202 /* Lock Firmware TPM rollback indices from further writes. In 202 /* Lock Firmware TPM rollback indices from further writes. In
203 * this design, this is done by setting the globalLock bit, which 203 * this design, this is done by setting the globalLock bit, which
204 * is cleared only by TPM_Init at reboot. */ 204 * is cleared only by TPM_Init at reboot. */
205 if (0 != LockFirmwareVersions()) 205 if (0 != LockFirmwareVersions())
206 return LOAD_FIRMWARE_RECOVERY; 206 return LOAD_FIRMWARE_RECOVERY;
207
208 /* Success */
209 return LOAD_FIRMWARE_SUCCESS;
207 } 210 }
208 211
209 /* If we're still here, no good firmware, so go to recovery mode. */ 212 /* If we're still here, no good firmware, so go to recovery mode. */
210 return LOAD_FIRMWARE_RECOVERY; 213 return LOAD_FIRMWARE_RECOVERY;
211 } 214 }
OLDNEW
« no previous file with comments | « firmware/lib/include/vboot_struct.h ('k') | firmware/lib/vboot_kernel.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698