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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_firmware.c
diff --git a/firmware/lib/vboot_firmware.c b/firmware/lib/vboot_firmware.c
index a59b238e850d40d60f253defe5d5432e2593d5eb..8fa4c53834ffb419b1a80f0c2c8379a9399dc1ea 100644
--- a/firmware/lib/vboot_firmware.c
+++ b/firmware/lib/vboot_firmware.c
@@ -45,11 +45,14 @@ int LoadFirmware(LoadFirmwareParams* params) {
/* Clear output params in case we fail */
params->firmware_index = 0;
- params->kernel_sign_key_blob = NULL;
- params->kernel_sign_key_size = 0;
debug("LoadFirmware started...\n");
+ if (params->kernel_sign_key_size < sizeof(VbPublicKey)) {
+ debug("Kernel sign key buffer too small\n");
+ return LOAD_FIRMWARE_RECOVERY;
+ }
+
/* Must have a root key */
if (!root_key) {
debug("No root key\n");
« 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