OLD | NEW |
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 firmware utility | 5 * Verified boot firmware 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 /* Read firmware volume */ | 194 /* Read firmware volume */ |
195 fv_data = ReadFile(fv_file, &fv_size); | 195 fv_data = ReadFile(fv_file, &fv_size); |
196 if (!fv_data) { | 196 if (!fv_data) { |
197 error("Error reading firmware volume\n"); | 197 error("Error reading firmware volume\n"); |
198 return 1; | 198 return 1; |
199 } | 199 } |
200 | 200 |
201 /* Verify key block */ | 201 /* Verify key block */ |
202 key_block = (VbKeyBlockHeader*)blob; | 202 key_block = (VbKeyBlockHeader*)blob; |
203 if (0 != KeyBlockVerify(key_block, blob_size, sign_key)) { | 203 if (0 != KeyBlockVerify(key_block, blob_size, sign_key, 0)) { |
204 error("Error verifying key block.\n"); | 204 error("Error verifying key block.\n"); |
205 return 1; | 205 return 1; |
206 } | 206 } |
207 Free(sign_key); | 207 Free(sign_key); |
208 now += key_block->key_block_size; | 208 now += key_block->key_block_size; |
209 | 209 |
210 printf("Key block:\n"); | 210 printf("Key block:\n"); |
211 data_key = &key_block->data_key; | 211 data_key = &key_block->data_key; |
212 printf(" Size: %" PRIu64 "\n", key_block->key_block_size); | 212 printf(" Size: %" PRIu64 "\n", key_block->key_block_size); |
213 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm, | 213 printf(" Data key algorithm: %" PRIu64 " %s\n", data_key->algorithm, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 case OPT_MODE_VBLOCK: | 321 case OPT_MODE_VBLOCK: |
322 return Vblock(filename, key_block_file, signprivate, version, fv_file, | 322 return Vblock(filename, key_block_file, signprivate, version, fv_file, |
323 kernelkey_file); | 323 kernelkey_file); |
324 case OPT_MODE_VERIFY: | 324 case OPT_MODE_VERIFY: |
325 return Verify(filename, signpubkey, fv_file); | 325 return Verify(filename, signpubkey, fv_file); |
326 default: | 326 default: |
327 printf("Must specify a mode.\n"); | 327 printf("Must specify a mode.\n"); |
328 return PrintHelp(); | 328 return PrintHelp(); |
329 } | 329 } |
330 } | 330 } |
OLD | NEW |