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

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

Issue 2743004: Add dummy implementation of LoadFirmware(); currently a wrapper around the old implementation. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: rename member 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 | « vboot_firmware/include/load_firmware_fw.h ('k') | vboot_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
(Empty)
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
3 * found in the LICENSE file.
4 *
5 * High-level firmware API for loading and verifying rewritable firmware.
6 * (Firmware portion)
7 */
8
9 #include "load_firmware_fw.h"
10
11 #include "firmware_image_fw.h"
12 #include "utility.h"
13
14
15 static const char kFakeKernelBlob[] = "Fake kernel sign key blob";
16
17 void UpdateFirmwareBodyHash(uint8_t* data, uint64_t size) {
18 /* TODO: actually update the hash. */
19 }
20
21
22 int LoadFirmware(LoadFirmwareParams* params) {
23 /* TODO: real implementation! For now, this just chains to the old
24 * implementation. */
25
26 uint8_t* fw0;
27 uint8_t* fw1;
28 uint64_t len;
29 int rv;
30
31 /* Get the firmware data */
32 fw0 = GetFirmwareBody(0, &len);
33 fw1 = GetFirmwareBody(1, &len);
34
35 /* Call the old firmware image driver */
36 rv = VerifyFirmwareDriver_f(params->firmware_root_key_blob,
37 params->verification_block_0,
38 fw0,
39 params->verification_block_1,
40 fw1);
41
42 /* Pass back a dummy key blob, since we can't extract the real
43 * kernel sign key blob yet */
44 params->kernel_sign_key_blob = (void*)kFakeKernelBlob;
45 params->kernel_sign_key_size = sizeof(kFakeKernelBlob);
46
47 switch(rv) {
48 case BOOT_FIRMWARE_A_CONTINUE:
49 params->firmware_index = 0;
50 return LOAD_FIRMWARE_SUCCESS;
51 case BOOT_FIRMWARE_B_CONTINUE:
52 params->firmware_index = 1;
53 return LOAD_FIRMWARE_SUCCESS;
54 }
55
56 /* If we're still here, we failed */
57 return LOAD_FIRMWARE_RECOVERY;
58
59 }
OLDNEW
« no previous file with comments | « vboot_firmware/include/load_firmware_fw.h ('k') | vboot_firmware/linktest/main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698