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

Side by Side Diff: host/lib/host_misc.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « host/include/host_misc.h ('k') | utility/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * Host functions for verified boot. 5 * Host functions for verified boot.
6 */ 6 */
7 7
8 /* TODO: change all 'return 0', 'return 1' into meaningful return codes */ 8 /* TODO: change all 'return 0', 'return 1' into meaningful return codes */
9 9
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 if (1 != fwrite(data, size, 1, f)) { 60 if (1 != fwrite(data, size, 1, f)) {
61 VBDEBUG(("Unable to write to file %s\n", filename)); 61 VBDEBUG(("Unable to write to file %s\n", filename));
62 fclose(f); 62 fclose(f);
63 unlink(filename); /* Delete any partial file */ 63 unlink(filename); /* Delete any partial file */
64 } 64 }
65 65
66 fclose(f); 66 fclose(f);
67 return 0; 67 return 0;
68 } 68 }
69
70 void PrintPubKeySha1Sum(VbPublicKey* key) {
71 uint8_t* buf = ((uint8_t *)key) + key->key_offset;
72 uint64_t buflen = key->key_size;
73 uint8_t* digest = DigestBuf(buf, buflen, SHA1_DIGEST_ALGORITHM);
74 int i;
75 for (i=0; i<SHA1_DIGEST_SIZE; i++)
76 printf("%02x", digest[i]);
77 Free(digest);
78 }
OLDNEW
« no previous file with comments | « host/include/host_misc.h ('k') | utility/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698