summaryrefslogtreecommitdiff
path: root/utility/vbutil_key.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2010-09-09 14:53:56 -0700
committerBill Richardson <wfrichar@chromium.org>2010-09-09 14:53:56 -0700
commit60bcbe3cd4c3921e6499170fd91eb47a040933a9 (patch)
treee8fc49cf9a6de79bb625ce682d2b047fedd31978 /utility/vbutil_key.c
parent7c88d4c31df2bd05494d0fdd2a300d69d7e503bd (diff)
downloadvboot-60bcbe3cd4c3921e6499170fd91eb47a040933a9.tar.gz
New tools to help debug vboot failures.
This adds some tools to help us figure out why a particular kernel isn't booting. Often we suspect it's because it was signed with the wrong keys, or has flags restricting its use to certain boot modes. This change adds some tools to extract and display all the keys from the BIOS, and try them on the various kernels. We also display the sha1sum of all the keys we find, to make comparing them easier. Change-Id: I38e447bf95cb6c3a0b87aa949611bb135f2f94b4 BUG=chromeos-partner:888 TEST=manual To test, obtain a root shell, and run dev_debug_vboot. You should see lots of useful information go by. Review URL: http://codereview.chromium.org/3303018
Diffstat (limited to 'utility/vbutil_key.c')
-rw-r--r--utility/vbutil_key.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/utility/vbutil_key.c b/utility/vbutil_key.c
index c076bfff..38d90003 100644
--- a/utility/vbutil_key.c
+++ b/utility/vbutil_key.c
@@ -108,15 +108,6 @@ static int Pack(const char *infile, const char *outfile, uint64_t algorithm,
}
-static void PrintDigest(const uint8_t* buf, uint64_t buflen) {
- uint8_t *digest = DigestBuf(buf, buflen, SHA1_DIGEST_ALGORITHM);
- int i;
- for (i=0; i<SHA1_DIGEST_SIZE; i++)
- printf("%02x", digest[i]);
- printf("\n");
- Free(digest);
-}
-
/* Unpack a .vbpubk or .vbprivk */
static int Unpack(const char *infile, const char *outfile) {
VbPublicKey* pubkey;
@@ -134,7 +125,8 @@ static int Unpack(const char *infile, const char *outfile) {
algo_strings[pubkey->algorithm] : "(invalid)"));
printf("Key Version: %" PRIu64 "\n", pubkey->key_version);
printf("Key sha1sum: ");
- PrintDigest(((uint8_t *)pubkey) + pubkey->key_offset, pubkey->key_size);
+ PrintPubKeySha1Sum(pubkey);
+ printf("\n");
if (outfile) {
if (0 != PublicKeyWrite(outfile, pubkey)) {
fprintf(stderr, "vbutil_key: Error writing key copy.\n");
@@ -146,7 +138,6 @@ static int Unpack(const char *infile, const char *outfile) {
return 0;
}
-
if ((privkey = PrivateKeyRead(infile))) {
printf("Private Key file: %s\n", infile);
printf("Algorithm: %" PRIu64 " %s\n", privkey->algorithm,