summaryrefslogtreecommitdiff
path: root/utility
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2010-07-19 10:35:40 -0700
committerRandall Spangler <rspangler@chromium.org>2010-07-19 10:35:40 -0700
commit87c13d806b1f58542b0fc0893144de45d31cabd2 (patch)
tree2b99c041f6be2e734a120de649026c0e3566a86f /utility
parent3e1081fb71385d72fd3a522599c35b516dda7a37 (diff)
downloadvboot-87c13d806b1f58542b0fc0893144de45d31cabd2.tar.gz
Added size param to VerifyData()
Also renamed verify preamble functions, now that they do not need the '2' at the end to differentiate them from the now-deleted original implementation. BUG=4501 TEST=Ran make runtests; all pass. Review URL: http://codereview.chromium.org/3027009
Diffstat (limited to 'utility')
-rw-r--r--utility/vbutil_firmware.c4
-rw-r--r--utility/vbutil_kernel.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/utility/vbutil_firmware.c b/utility/vbutil_firmware.c
index cdeed265..3992a3a8 100644
--- a/utility/vbutil_firmware.c
+++ b/utility/vbutil_firmware.c
@@ -224,7 +224,7 @@ static int Verify(const char* infile, const char* signpubkey,
/* Verify preamble */
preamble = (VbFirmwarePreambleHeader*)(blob + now);
- if (0 != VerifyFirmwarePreamble2(preamble, blob_size - now, rsa)) {
+ if (0 != VerifyFirmwarePreamble(preamble, blob_size - now, rsa)) {
error("Error verifying preamble.\n");
return 1;
}
@@ -247,7 +247,7 @@ static int Verify(const char* infile, const char* signpubkey,
/* TODO: verify body size same as signature size */
/* Verify body */
- if (0 != VerifyData(fv_data, &preamble->body_signature, rsa)) {
+ if (0 != VerifyData(fv_data, fv_size, &preamble->body_signature, rsa)) {
error("Error verifying firmware body.\n");
return 1;
}
diff --git a/utility/vbutil_kernel.c b/utility/vbutil_kernel.c
index d688e61f..893f889c 100644
--- a/utility/vbutil_kernel.c
+++ b/utility/vbutil_kernel.c
@@ -661,7 +661,7 @@ static int Verify(const char* infile, const char* signpubkey, int verbose) {
/* Verify preamble */
preamble = bp->preamble;
- if (0 != VerifyKernelPreamble2(
+ if (0 != VerifyKernelPreamble(
preamble, bp->blob_size - key_block->key_block_size, rsa)) {
error("Error verifying preamble.\n");
goto verify_exit;
@@ -676,11 +676,13 @@ static int Verify(const char* infile, const char* signpubkey, int verbose) {
printf(" Body load address: 0x%" PRIx64 "\n", preamble->body_load_address);
printf(" Body size: 0x%" PRIx64 "\n",
preamble->body_signature.data_size);
- printf(" Bootloader address: 0x%" PRIx64 "\n", preamble->bootloader_address);
+ printf(" Bootloader address: 0x%" PRIx64 "\n",
+ preamble->bootloader_address);
printf(" Bootloader size: 0x%" PRIx64 "\n", preamble->bootloader_size);
/* Verify body */
- if (0 != VerifyData(bp->blob, &preamble->body_signature, rsa)) {
+ if (0 != VerifyData(bp->blob, bp->blob_size, &preamble->body_signature,
+ rsa)) {
error("Error verifying kernel body.\n");
goto verify_exit;
}