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

Side by Side Diff: utility/vbutil_keyblock.c

Issue 2812034: Adding --repack and --headeronly options to vbutil_kernel (Closed) Base URL: ssh://git@chromiumos-git//vboot_reference.git
Patch Set: oops. Created 10 years, 5 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
« no previous file with comments | « 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (algorithm >= kNumAlgorithms) { 86 if (algorithm >= kNumAlgorithms) {
87 fprintf(stderr, "Invalid algorithm\n"); 87 fprintf(stderr, "Invalid algorithm\n");
88 return 1; 88 return 1;
89 } 89 }
90 90
91 data_key = PublicKeyRead(datapubkey); 91 data_key = PublicKeyRead(datapubkey);
92 if (!data_key) { 92 if (!data_key) {
93 fprintf(stderr, "vbutil_keyblock: Error reading data key.\n"); 93 fprintf(stderr, "vbutil_keyblock: Error reading data key.\n");
94 return 1; 94 return 1;
95 } 95 }
96 signing_key = PrivateKeyRead(signprivate, algorithm); 96 signing_key = PrivateKeyReadPem(signprivate, algorithm);
97 if (!signing_key) { 97 if (!signing_key) {
98 fprintf(stderr, "vbutil_keyblock: Error reading signing key.\n"); 98 fprintf(stderr, "vbutil_keyblock: Error reading signing key.\n");
99 return 1; 99 return 1;
100 } 100 }
101 101
102 block = KeyBlockCreate(data_key, signing_key, flags); 102 block = KeyBlockCreate(data_key, signing_key, flags);
103 Free(data_key); 103 Free(data_key);
104 Free(signing_key); 104 Free(signing_key);
105 105
106 if (0 != KeyBlockWrite(outfile, block)) { 106 if (0 != KeyBlockWrite(outfile, block)) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 switch(mode) { 224 switch(mode) {
225 case OPT_MODE_PACK: 225 case OPT_MODE_PACK:
226 return Pack(filename, datapubkey, signprivate, algorithm, flags); 226 return Pack(filename, datapubkey, signprivate, algorithm, flags);
227 case OPT_MODE_UNPACK: 227 case OPT_MODE_UNPACK:
228 return Unpack(filename, datapubkey, signpubkey); 228 return Unpack(filename, datapubkey, signpubkey);
229 default: 229 default:
230 printf("Must specify a mode.\n"); 230 printf("Must specify a mode.\n");
231 return PrintHelp(); 231 return PrintHelp();
232 } 232 }
233 } 233 }
OLDNEW
« no previous file with comments | « utility/vbutil_kernel.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698