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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 error("Error verifying key block.\n"); | 654 error("Error verifying key block.\n"); |
655 goto verify_exit; | 655 goto verify_exit; |
656 } | 656 } |
657 now = key_block->key_block_size; | 657 now = key_block->key_block_size; |
658 | 658 |
659 printf("Key block:\n"); | 659 printf("Key block:\n"); |
660 data_key = &key_block->data_key; | 660 data_key = &key_block->data_key; |
661 if (verbose) | 661 if (verbose) |
662 printf(" Signature: %s\n", sign_key ? "valid" : "ignored"); | 662 printf(" Signature: %s\n", sign_key ? "valid" : "ignored"); |
663 printf(" Size: 0x%" PRIx64 "\n", key_block->key_block_size); | 663 printf(" Size: 0x%" PRIx64 "\n", key_block->key_block_size); |
| 664 printf(" Flags: %" PRIu64 " ", key_block->key_block_flags); |
| 665 if (key_block->key_block_flags & KEY_BLOCK_FLAG_DEVELOPER_0) |
| 666 printf(" !DEV"); |
| 667 if (key_block->key_block_flags & KEY_BLOCK_FLAG_DEVELOPER_1) |
| 668 printf(" DEV"); |
| 669 if (key_block->key_block_flags & KEY_BLOCK_FLAG_RECOVERY_0) |
| 670 printf(" !REC"); |
| 671 if (key_block->key_block_flags & KEY_BLOCK_FLAG_RECOVERY_1) |
| 672 printf(" REC"); |
| 673 printf("\n"); |
664 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm, | 674 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm, |
665 (data_key->algorithm < kNumAlgorithms ? | 675 (data_key->algorithm < kNumAlgorithms ? |
666 algo_strings[data_key->algorithm] : "(invalid)")); | 676 algo_strings[data_key->algorithm] : "(invalid)")); |
667 printf(" Data key version: %" PRIu64 "\n", data_key->key_version); | 677 printf(" Data key version: %" PRIu64 "\n", data_key->key_version); |
668 printf(" Flags: %" PRIu64 "\n", key_block->key_block_flags); | 678 printf(" Data key sha1sum: "); |
| 679 PrintPubKeySha1Sum(data_key); |
| 680 printf("\n"); |
669 | 681 |
670 rsa = PublicKeyToRSA(&key_block->data_key); | 682 rsa = PublicKeyToRSA(&key_block->data_key); |
671 if (!rsa) { | 683 if (!rsa) { |
672 error("Error parsing data key.\n"); | 684 error("Error parsing data key.\n"); |
673 goto verify_exit; | 685 goto verify_exit; |
674 } | 686 } |
675 | 687 |
676 /* Verify preamble */ | 688 /* Verify preamble */ |
677 preamble = bp->preamble; | 689 preamble = bp->preamble; |
678 if (0 != VerifyKernelPreamble( | 690 if (0 != VerifyKernelPreamble( |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 | 864 |
853 case OPT_MODE_VERIFY: | 865 case OPT_MODE_VERIFY: |
854 return Verify(filename, signpubkey, verbose); | 866 return Verify(filename, signpubkey, verbose); |
855 | 867 |
856 default: | 868 default: |
857 fprintf(stderr, | 869 fprintf(stderr, |
858 "You must specify a mode: --pack, --repack or --verify\n"); | 870 "You must specify a mode: --pack, --repack or --verify\n"); |
859 return PrintHelp(progname); | 871 return PrintHelp(progname); |
860 } | 872 } |
861 } | 873 } |
OLD | NEW |