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

Unified Diff: firmware/lib/vboot_common.c

Issue 6759075: Fix preamble range checks (Closed) Base URL: ssh://gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 9 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_common.c
diff --git a/firmware/lib/vboot_common.c b/firmware/lib/vboot_common.c
index d9838c41fcca8c2a0061fa3d55d6ce5d312e1bd6..a20e16fb0a808a1ddc267d0b63c7ac27cc3cf838 100644
--- a/firmware/lib/vboot_common.c
+++ b/firmware/lib/vboot_common.c
@@ -333,15 +333,15 @@ int VerifyFirmwarePreamble(const VbFirmwarePreambleHeader* preamble,
return VBOOT_PREAMBLE_INVALID;
}
- /* Verify body signature is inside the block */
- if (VerifySignatureInside(preamble, preamble->preamble_size,
+ /* Verify body signature is inside the signed data */
+ if (VerifySignatureInside(preamble, sig->data_size,
&preamble->body_signature)) {
VBDEBUG(("Firmware body signature off end of preamble\n"));
return VBOOT_PREAMBLE_INVALID;
}
- /* Verify kernel subkey is inside the block */
- if (VerifyPublicKeyInside(preamble, preamble->preamble_size,
+ /* Verify kernel subkey is inside the signed data */
+ if (VerifyPublicKeyInside(preamble, sig->data_size,
&preamble->kernel_subkey)) {
VBDEBUG(("Kernel subkey off end of preamble\n"));
return VBOOT_PREAMBLE_INVALID;
@@ -387,8 +387,8 @@ int VerifyKernelPreamble(const VbKernelPreambleHeader* preamble,
return VBOOT_PREAMBLE_INVALID;
}
- /* Verify body signature is inside the block */
- if (VerifySignatureInside(preamble, preamble->preamble_size,
+ /* Verify body signature is inside the signed data */
+ if (VerifySignatureInside(preamble, sig->data_size,
&preamble->body_signature)) {
VBDEBUG(("Kernel body signature off end of preamble\n"));
return VBOOT_PREAMBLE_INVALID;
« 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