| 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 * Verified boot kernel utility | 5 * Verified boot kernel 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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 634 |
| 635 /* Read blob */ | 635 /* Read blob */ |
| 636 bp = OldBlob(infile); | 636 bp = OldBlob(infile); |
| 637 if (!bp) { | 637 if (!bp) { |
| 638 error("Error reading input file\n"); | 638 error("Error reading input file\n"); |
| 639 return 1; | 639 return 1; |
| 640 } | 640 } |
| 641 | 641 |
| 642 /* Verify key block */ | 642 /* Verify key block */ |
| 643 key_block = bp->key_block; | 643 key_block = bp->key_block; |
| 644 if (0 != KeyBlockVerify(key_block, bp->blob_size, sign_key)) { | 644 if (0 != KeyBlockVerify(key_block, bp->blob_size, sign_key, |
| 645 (sign_key ? 0 : 1))) { |
| 645 error("Error verifying key block.\n"); | 646 error("Error verifying key block.\n"); |
| 646 goto verify_exit; | 647 goto verify_exit; |
| 647 } | 648 } |
| 648 now = key_block->key_block_size; | 649 now = key_block->key_block_size; |
| 649 | 650 |
| 650 printf("Key block:\n"); | 651 printf("Key block:\n"); |
| 651 data_key = &key_block->data_key; | 652 data_key = &key_block->data_key; |
| 652 if (verbose) | 653 if (verbose) |
| 653 printf(" Signature: %s\n", sign_key ? "valid" : "ignored"); | 654 printf(" Signature: %s\n", sign_key ? "valid" : "ignored"); |
| 654 printf(" Size: 0x%" PRIx64 "\n", key_block->key_block_size); | 655 printf(" Size: 0x%" PRIx64 "\n", key_block->key_block_size); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 | 844 |
| 844 case OPT_MODE_VERIFY: | 845 case OPT_MODE_VERIFY: |
| 845 return Verify(filename, signpubkey, verbose); | 846 return Verify(filename, signpubkey, verbose); |
| 846 | 847 |
| 847 default: | 848 default: |
| 848 fprintf(stderr, | 849 fprintf(stderr, |
| 849 "You must specify a mode: --pack, --repack or --verify\n"); | 850 "You must specify a mode: --pack, --repack or --verify\n"); |
| 850 return PrintHelp(progname); | 851 return PrintHelp(progname); |
| 851 } | 852 } |
| 852 } | 853 } |
| OLD | NEW |