summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2010-06-23 19:42:09 -0700
committerRandall Spangler <rspangler@chromium.org>2010-06-23 19:42:09 -0700
commit07f78652276e75d3a1102e58de6078d08ceb4e69 (patch)
treef4cc629f2241a987cde03d70ad8bc131f323c818 /firmware
parent1078838fff3554c0c4bcae771984cb2164bd7359 (diff)
downloadvboot-07f78652276e75d3a1102e58de6078d08ceb4e69.tar.gz
fix passing key out of LoadFirmware
Review URL: http://codereview.chromium.org/2825019
Diffstat (limited to 'firmware')
-rw-r--r--firmware/lib/vboot_firmware.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/lib/vboot_firmware.c b/firmware/lib/vboot_firmware.c
index a59b238e..8fa4c538 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");