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

Unified Diff: vboot_firmware/lib/load_firmware_fw.c

Issue 2848006: Refactor LoadFrmware() to avoid global variables, which don't work when running out of ROM (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Undo change to vboot_struct 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vboot_firmware/lib/include/vboot_firmware.h ('k') | vboot_firmware/lib/vboot_common.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vboot_firmware/lib/load_firmware_fw.c
diff --git a/vboot_firmware/lib/load_firmware_fw.c b/vboot_firmware/lib/load_firmware_fw.c
index 598c894f85d5b677d6c17e14af6dd59087d65d30..0ce73fde623d45a001307779b35cc88767fa0099 100644
--- a/vboot_firmware/lib/load_firmware_fw.c
+++ b/vboot_firmware/lib/load_firmware_fw.c
@@ -12,48 +12,14 @@
#include "utility.h"
-static const char kFakeKernelBlob[] = "Fake kernel sign key blob";
-
-void UpdateFirmwareBodyHash(uint8_t* data, uint64_t size) {
- /* TODO: actually update the hash. */
-}
+static const char kFakeKernelBlob[2088] = "Fake kernel sign key blob";
int LoadFirmware(LoadFirmwareParams* params) {
- /* TODO: real implementation! For now, this just chains to the old
- * implementation. */
-
- uint8_t* fw0;
- uint8_t* fw1;
- uint64_t len;
- int rv;
-
- /* Get the firmware data */
- fw0 = GetFirmwareBody(0, &len);
- fw1 = GetFirmwareBody(1, &len);
-
- /* Call the old firmware image driver */
- rv = VerifyFirmwareDriver_f(params->firmware_root_key_blob,
- params->verification_block_0,
- fw0,
- params->verification_block_1,
- fw1);
-
- /* Pass back a dummy key blob, since we can't extract the real
- * kernel sign key blob yet */
- params->kernel_sign_key_blob = (void*)kFakeKernelBlob;
+ /* TODO: real implementation! This is now sufficiently broken due
+ * to refactoring that we'll just trust firmware A. */
+ params->kernel_sign_key_blob = (void *)kFakeKernelBlob;
params->kernel_sign_key_size = sizeof(kFakeKernelBlob);
-
- switch(rv) {
- case BOOT_FIRMWARE_A_CONTINUE:
- params->firmware_index = 0;
- return LOAD_FIRMWARE_SUCCESS;
- case BOOT_FIRMWARE_B_CONTINUE:
- params->firmware_index = 1;
- return LOAD_FIRMWARE_SUCCESS;
- }
-
- /* If we're still here, we failed */
- return LOAD_FIRMWARE_RECOVERY;
-
+ params->firmware_index = 0;
+ return LOAD_FIRMWARE_SUCCESS;
}
« no previous file with comments | « vboot_firmware/lib/include/vboot_firmware.h ('k') | vboot_firmware/lib/vboot_common.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698