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: utility/vbutil_keyblock.c

Issue 3126013: Fix KeyBlockVerify() to take an explicit param for whether to use hash only. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Fix one last typo Created 10 years, 4 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
« firmware/lib/vboot_common.c ('K') | « utility/vbutil_kernel.c ('k') | no next file » | 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 * Verified boot key block utility 5 * Verified boot key block utility
6 */ 6 */
7 7
8 #include <getopt.h> 8 #include <getopt.h>
9 #include <inttypes.h> /* For PRIu64 */ 9 #include <inttypes.h> /* For PRIu64 */
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (!signpubkey) { 131 if (!signpubkey) {
132 fprintf(stderr, 132 fprintf(stderr,
133 "vbutil_keyblock: keyblock requires public key to verify\n"); 133 "vbutil_keyblock: keyblock requires public key to verify\n");
134 return 1; 134 return 1;
135 } 135 }
136 sign_key = PublicKeyRead(signpubkey); 136 sign_key = PublicKeyRead(signpubkey);
137 if (!sign_key) { 137 if (!sign_key) {
138 fprintf(stderr, "vbutil_keyblock: Error reading signpubkey.\n"); 138 fprintf(stderr, "vbutil_keyblock: Error reading signpubkey.\n");
139 return 1; 139 return 1;
140 } 140 }
141 if (0 != KeyBlockVerify(block, block->key_block_size, sign_key)) { 141 if (0 != KeyBlockVerify(block, block->key_block_size, sign_key, 0)) {
142 fprintf(stderr, "vbutil_keyblock: Error verifying key block.\n"); 142 fprintf(stderr, "vbutil_keyblock: Error verifying key block.\n");
143 return 1; 143 return 1;
144 } 144 }
145 printf("Signature algorithm: %" PRIu64 " %s\n", sign_key->algorithm, 145 printf("Signature algorithm: %" PRIu64 " %s\n", sign_key->algorithm,
146 (sign_key->algorithm < kNumAlgorithms ? 146 (sign_key->algorithm < kNumAlgorithms ?
147 algo_strings[sign_key->algorithm] : "(invalid)")); 147 algo_strings[sign_key->algorithm] : "(invalid)"));
148 Free(sign_key); 148 Free(sign_key);
149 } else { 149 } else {
150 printf("Signature Algorithm: <none>\n"); 150 printf("Signature Algorithm: <none>\n");
151 } 151 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 switch(mode) { 232 switch(mode) {
233 case OPT_MODE_PACK: 233 case OPT_MODE_PACK:
234 return Pack(filename, datapubkey, signprivate, flags); 234 return Pack(filename, datapubkey, signprivate, flags);
235 case OPT_MODE_UNPACK: 235 case OPT_MODE_UNPACK:
236 return Unpack(filename, datapubkey, signpubkey); 236 return Unpack(filename, datapubkey, signpubkey);
237 default: 237 default:
238 printf("Must specify a mode.\n"); 238 printf("Must specify a mode.\n");
239 return PrintHelp(progname); 239 return PrintHelp(progname);
240 } 240 }
241 } 241 }
OLDNEW
« firmware/lib/vboot_common.c ('K') | « utility/vbutil_kernel.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698