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

Side by Side Diff: utility/vbutil_kernel.c

Issue 2729021: Clean up of key block functions (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: More key block cleanup Created 10 years, 6 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 | « tests/vboot_common3_tests.c ('k') | utility/vbutil_keyblock.c » ('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 * Verified boot kernel utility 5 * Verified boot kernel 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 <stddef.h> 10 #include <stddef.h>
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 /* Read blob */ 320 /* Read blob */
321 blob = ReadFile(infile, &blob_size); 321 blob = ReadFile(infile, &blob_size);
322 if (!blob) { 322 if (!blob) {
323 error("Error reading input file\n"); 323 error("Error reading input file\n");
324 return 1; 324 return 1;
325 } 325 }
326 326
327 /* Verify key block */ 327 /* Verify key block */
328 key_block = (VbKeyBlockHeader*)blob; 328 key_block = (VbKeyBlockHeader*)blob;
329 if (0 != VerifyKeyBlock(key_block, blob_size, sign_key)) { 329 if (0 != KeyBlockVerify(key_block, blob_size, sign_key)) {
330 error("Error verifying key block.\n"); 330 error("Error verifying key block.\n");
331 return 1; 331 return 1;
332 } 332 }
333 Free(sign_key); 333 Free(sign_key);
334 now += key_block->key_block_size; 334 now += key_block->key_block_size;
335 335
336 printf("Key block:\n"); 336 printf("Key block:\n");
337 data_key = &key_block->data_key; 337 data_key = &key_block->data_key;
338 printf(" Size: %" PRIu64 "\n", key_block->key_block_size); 338 printf(" Size: %" PRIu64 "\n", key_block->key_block_size);
339 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm, 339 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 case OPT_MODE_PACK: 456 case OPT_MODE_PACK:
457 return Pack(filename, key_block_file, signprivate, version, vmlinuz, 457 return Pack(filename, key_block_file, signprivate, version, vmlinuz,
458 bootloader, config_file, pad); 458 bootloader, config_file, pad);
459 case OPT_MODE_VERIFY: 459 case OPT_MODE_VERIFY:
460 return Verify(filename, signpubkey); 460 return Verify(filename, signpubkey);
461 default: 461 default:
462 printf("Must specify a mode.\n"); 462 printf("Must specify a mode.\n");
463 return PrintHelp(); 463 return PrintHelp();
464 } 464 }
465 } 465 }
OLDNEW
« no previous file with comments | « tests/vboot_common3_tests.c ('k') | utility/vbutil_keyblock.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698