| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 * | 4 * |
| 5 * Developer file-signing utility | 5 * Developer file-signing utility |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <getopt.h> | 9 #include <getopt.h> |
| 10 #include <inttypes.h> /* For PRIu64 */ | 10 #include <inttypes.h> /* For PRIu64 */ |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 preamble = (VbKernelPreambleHeader*)(buf + current_buf_offset); | 203 preamble = (VbKernelPreambleHeader*)(buf + current_buf_offset); |
| 204 Debug("Preamble is 0x%" PRIx64 " bytes\n", preamble->preamble_size); | 204 Debug("Preamble is 0x%" PRIx64 " bytes\n", preamble->preamble_size); |
| 205 current_buf_offset += preamble->preamble_size; | 205 current_buf_offset += preamble->preamble_size; |
| 206 if (current_buf_offset > buf_size ) { | 206 if (current_buf_offset > buf_size ) { |
| 207 error("preamble_size advances past the end of the buffer\n"); | 207 error("preamble_size advances past the end of the buffer\n"); |
| 208 return 1; | 208 return 1; |
| 209 } | 209 } |
| 210 | 210 |
| 211 Debug("Current buf offset is at 0x%" PRIx64 " bytes\n", current_buf_offset); | 211 Debug("Current buf offset is at 0x%" PRIx64 " bytes\n", current_buf_offset); |
| 212 | 212 |
| 213 /* Check the keyblock */ | 213 /* Check the key block (hash only) */ |
| 214 if (0 != KeyBlockVerify(key_block, file_size, NULL)) { | 214 if (0 != KeyBlockVerify(key_block, file_size, NULL, 1)) { |
| 215 error("Error verifying key block.\n"); | 215 error("Error verifying key block.\n"); |
| 216 return 1; | 216 return 1; |
| 217 } | 217 } |
| 218 | 218 |
| 219 printf("Key block:\n"); | 219 printf("Key block:\n"); |
| 220 data_key = &key_block->data_key; | 220 data_key = &key_block->data_key; |
| 221 printf(" Size: 0x%" PRIx64 "\n", key_block->key_block_size); | 221 printf(" Size: 0x%" PRIx64 "\n", key_block->key_block_size); |
| 222 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm, | 222 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm, |
| 223 (data_key->algorithm < kNumAlgorithms ? | 223 (data_key->algorithm < kNumAlgorithms ? |
| 224 algo_strings[data_key->algorithm] : "(invalid)")); | 224 algo_strings[data_key->algorithm] : "(invalid)")); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 default: | 334 default: |
| 335 fprintf(stderr, | 335 fprintf(stderr, |
| 336 "You must specify either --sign or --verify\n"); | 336 "You must specify either --sign or --verify\n"); |
| 337 return PrintHelp(progname); | 337 return PrintHelp(progname); |
| 338 } | 338 } |
| 339 | 339 |
| 340 /* NOTREACHED */ | 340 /* NOTREACHED */ |
| 341 return 1; | 341 return 1; |
| 342 } | 342 } |
| OLD | NEW |