Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Unified Diff: utility/vbutil_key.c

Issue 3303018: New tools to help debug vboot failures. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git
Patch Set: Respond to comments. Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utility/vbutil_kernel.c ('k') | utility/vbutil_keyblock.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utility/vbutil_key.c
diff --git a/utility/vbutil_key.c b/utility/vbutil_key.c
index c076bfff0fa7a2afb47f490218f0bcc74cf3b360..38d90003050283804972365dbce384c4a1d90beb 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,
« no previous file with comments | « utility/vbutil_kernel.c ('k') | utility/vbutil_keyblock.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698