From f356db46a6da14ae503a445e4d3a71217071b7ab Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 25 Oct 2010 11:39:16 -0700 Subject: [PATCH] Recommit a change that got accidently uncommitted. Display keyblock information, even if not checking the signature. Change-Id: Ie96ac39e2598fdfdc49898f92fd528edefd36313 BUG=none TEST=none Review URL: http://codereview.chromium.org/3602014 TBR=none --- utility/vbutil_keyblock.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/utility/vbutil_keyblock.c b/utility/vbutil_keyblock.c index ff1b44be45..dd13eb3df0 100644 --- a/utility/vbutil_keyblock.c +++ b/utility/vbutil_keyblock.c @@ -127,12 +127,7 @@ static int Unpack(const char* infile, const char* datapubkey, /* If the block is signed, then verify it with the signing public key, since KeyBlockRead() only verified the hash. */ - if (block->key_block_signature.sig_size) { - if (!signpubkey) { - fprintf(stderr, - "vbutil_keyblock: keyblock requires public key to verify\n"); - return 1; - } + if (block->key_block_signature.sig_size && signpubkey) { sign_key = PublicKeyRead(signpubkey); if (!sign_key) { fprintf(stderr, "vbutil_keyblock: Error reading signpubkey.\n"); @@ -142,16 +137,12 @@ static int Unpack(const char* infile, const char* datapubkey, fprintf(stderr, "vbutil_keyblock: Error verifying key block.\n"); return 1; } - printf("Signature algorithm: %" PRIu64 " %s\n", sign_key->algorithm, - (sign_key->algorithm < kNumAlgorithms ? - algo_strings[sign_key->algorithm] : "(invalid)")); Free(sign_key); - } else { - printf("Signature Algorithm: \n"); } printf("Key block file: %s\n", infile); - printf("Flags: %" PRIu64 "\n", block->key_block_flags); + printf("Signature %s\n", sign_key ? "valid" : "ignored"); + printf("Flags: %" PRIu64 " ", block->key_block_flags); if (block->key_block_flags & KEY_BLOCK_FLAG_DEVELOPER_0) printf(" !DEV"); if (block->key_block_flags & KEY_BLOCK_FLAG_DEVELOPER_1)