diff options
author | Bill Richardson <wfrichar@chromium.org> | 2012-03-15 10:00:41 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-03-15 12:00:24 -0700 |
commit | bde0696234c2c665aec56fa4de768d8414af9621 (patch) | |
tree | b628fcecbeea9dfad8471f0aa6277ca88996e468 /utility | |
parent | c8b9ca685610397a0748677778ac8416b160d46e (diff) | |
download | vboot-bde0696234c2c665aec56fa4de768d8414af9621.tar.gz |
Make vbutil_kernel use correct size when verifying headers.
Added a test to demonstrate the fix.
BUG=none
TEST=manual
make
make runtests
Change-Id: I06e85b993cbe21088641a62d55a3d3ddb696ba76
Reviewed-on: https://gerrit.chromium.org/gerrit/18240
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'utility')
-rw-r--r-- | utility/vbutil_kernel.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/utility/vbutil_kernel.c b/utility/vbutil_kernel.c index f2bd6bad..688d57a1 100644 --- a/utility/vbutil_kernel.c +++ b/utility/vbutil_kernel.c @@ -719,7 +719,7 @@ static int Verify(const char* infile, const char* signpubkey, int verbose, /* Verify key block */ key_block = bp->key_block; - if (0 != KeyBlockVerify(key_block, bp->kern_blob_size, sign_key, + if (0 != KeyBlockVerify(key_block, key_block->key_block_size, sign_key, (sign_key ? 0 : 1))) { VbExError("Error verifying key block.\n"); goto verify_exit; @@ -778,8 +778,7 @@ static int Verify(const char* infile, const char* signpubkey, int verbose, /* Verify preamble */ preamble = bp->preamble; - if (0 != VerifyKernelPreamble( - preamble, bp->kern_blob_size - key_block->key_block_size, rsa)) { + if (0 != VerifyKernelPreamble(preamble, preamble->preamble_size, rsa)) { VbExError("Error verifying preamble.\n"); goto verify_exit; } |