OLD | NEW |
1 /* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 * Routines for verifying a firmware image's signature. | 5 * Routines for verifying a firmware image's signature. |
6 */ | 6 */ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 | 9 |
10 #include "fmap.h" | 10 #include "fmap.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 /* Convert status returned by LoadFirmware to string. Return NULL on error. */ | 219 /* Convert status returned by LoadFirmware to string. Return NULL on error. */ |
220 const char* status_string(int status) { | 220 const char* status_string(int status) { |
221 switch (status) { | 221 switch (status) { |
222 case LOAD_FIRMWARE_SUCCESS: | 222 case LOAD_FIRMWARE_SUCCESS: |
223 return "LOAD_FIRMWARE_SUCCESS"; | 223 return "LOAD_FIRMWARE_SUCCESS"; |
224 case LOAD_FIRMWARE_RECOVERY: | 224 case LOAD_FIRMWARE_RECOVERY: |
225 return "LOAD_FIRMWARE_RECOVERY"; | 225 return "LOAD_FIRMWARE_RECOVERY"; |
226 case LOAD_FIRMWARE_REBOOT: | 226 case LOAD_FIRMWARE_REBOOT: |
227 return "LOAD_FIRMWARE_REBOOT"; | 227 return "LOAD_FIRMWARE_REBOOT"; |
228 case LOAD_FIRMWARE_RECOVERY_TPM: | |
229 return "LOAD_FIRMWARE_RECOVERY_TPM"; | |
230 default: | 228 default: |
231 return NULL; | 229 return NULL; |
232 } | 230 } |
233 } | 231 } |
234 | 232 |
235 int main(int argc, char* argv[]) { | 233 int main(int argc, char* argv[]) { |
236 int retval = 0; | 234 int retval = 0; |
237 const void* base_of_rom; | 235 const void* base_of_rom; |
238 const void* fmap; | 236 const void* fmap; |
239 uint64_t rom_size; | 237 uint64_t rom_size; |
(...skipping 16 matching lines...) Expand all Loading... |
256 printf("opened %s\n", image_path); | 254 printf("opened %s\n", image_path); |
257 | 255 |
258 fmap = FmapFind((char*) base_of_rom, rom_size); | 256 fmap = FmapFind((char*) base_of_rom, rom_size); |
259 | 257 |
260 retval = DriveLoadFirmware(base_of_rom, fmap); | 258 retval = DriveLoadFirmware(base_of_rom, fmap); |
261 | 259 |
262 Free((void*) base_of_rom); | 260 Free((void*) base_of_rom); |
263 | 261 |
264 return retval; | 262 return retval; |
265 } | 263 } |
OLD | NEW |