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

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

Issue 2825019: fix passing key out of 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 27 matching lines...) Expand all
38 38
39 uint16_t tpm_key_version = 0; 39 uint16_t tpm_key_version = 0;
40 uint16_t tpm_fw_version = 0; 40 uint16_t tpm_fw_version = 0;
41 uint64_t lowest_key_version = 0xFFFF; 41 uint64_t lowest_key_version = 0xFFFF;
42 uint64_t lowest_fw_version = 0xFFFF; 42 uint64_t lowest_fw_version = 0xFFFF;
43 int good_index = -1; 43 int good_index = -1;
44 int index; 44 int index;
45 45
46 /* Clear output params in case we fail */ 46 /* Clear output params in case we fail */
47 params->firmware_index = 0; 47 params->firmware_index = 0;
48 params->kernel_sign_key_blob = NULL;
49 params->kernel_sign_key_size = 0;
50 48
51 debug("LoadFirmware started...\n"); 49 debug("LoadFirmware started...\n");
52 50
51 if (params->kernel_sign_key_size < sizeof(VbPublicKey)) {
52 debug("Kernel sign key buffer too small\n");
53 return LOAD_FIRMWARE_RECOVERY;
54 }
55
53 /* Must have a root key */ 56 /* Must have a root key */
54 if (!root_key) { 57 if (!root_key) {
55 debug("No root key\n"); 58 debug("No root key\n");
56 return LOAD_FIRMWARE_RECOVERY; 59 return LOAD_FIRMWARE_RECOVERY;
57 } 60 }
58 61
59 /* Initialize the TPM and read rollback indices. */ 62 /* Initialize the TPM and read rollback indices. */
60 /* TODO: fix SetupTPM parameter for developer mode */ 63 /* TODO: fix SetupTPM parameter for developer mode */
61 if (0 != RollbackFirmwareSetup(0, &tpm_key_version, &tpm_fw_version)) { 64 if (0 != RollbackFirmwareSetup(0, &tpm_key_version, &tpm_fw_version)) {
62 debug("Unable to get stored versions.\n"); 65 debug("Unable to get stored versions.\n");
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 230
228 /* Success */ 231 /* Success */
229 debug("Will boot firmware index %d\n", (int)params->firmware_index); 232 debug("Will boot firmware index %d\n", (int)params->firmware_index);
230 return LOAD_FIRMWARE_SUCCESS; 233 return LOAD_FIRMWARE_SUCCESS;
231 } 234 }
232 235
233 /* If we're still here, no good firmware, so go to recovery mode. */ 236 /* If we're still here, no good firmware, so go to recovery mode. */
234 debug("Alas, no good firmware.\n"); 237 debug("Alas, no good firmware.\n");
235 return LOAD_FIRMWARE_RECOVERY; 238 return LOAD_FIRMWARE_RECOVERY;
236 } 239 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698