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

Side by Side Diff: src/platform/vboot_reference/utils/firmware_image_fw.c

Issue 1574005: VBoot Reference: Refactor Part 2 - Crypto Libraries (Closed)
Patch Set: . Created 10 years, 8 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
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 * Functions for verifying a verified boot firmware image. 5 * Functions for verifying a verified boot firmware image.
6 * (Firmware Portion) 6 * (Firmware Portion)
7 */ 7 */
8 8
9 #include "firmware_image_fw.h" 9 #include "firmware_image_fw.h"
10 10
11 #include "padding.h" 11 #include "cryptolib.h"
12 #include "rollback_index.h" 12 #include "rollback_index.h"
13 #include "rsa_utility.h"
14 #include "sha_utility.h"
15 #include "utility.h" 13 #include "utility.h"
16 14
17 /* Macro to determine the size of a field structure in the FirmwareImage 15 /* Macro to determine the size of a field structure in the FirmwareImage
18 * structure. */ 16 * structure. */
19 #define FIELD_LEN(field) (sizeof(((FirmwareImage*)0)->field)) 17 #define FIELD_LEN(field) (sizeof(((FirmwareImage*)0)->field))
20 18
21 char* kVerifyFirmwareErrors[VERIFY_FIRMWARE_MAX] = { 19 char* kVerifyFirmwareErrors[VERIFY_FIRMWARE_MAX] = {
22 "Success.", 20 "Success.",
23 "Invalid Image.", 21 "Invalid Image.",
24 "Root Key Signature Failed.", 22 "Root Key Signature Failed.",
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 * attempted. 312 * attempted.
315 * If FirmwareB is not a rollback, then we attempt to do the verification. 313 * If FirmwareB is not a rollback, then we attempt to do the verification.
316 */ 314 */
317 if (stored_lversion <= firmwareB_lversion && 315 if (stored_lversion <= firmwareB_lversion &&
318 (VERIFY_FIRMWARE_SUCCESS == VerifyFirmware(root_key_blob, firmwareB))) 316 (VERIFY_FIRMWARE_SUCCESS == VerifyFirmware(root_key_blob, firmwareB)))
319 return BOOT_FIRMWARE_B_CONTINUE; 317 return BOOT_FIRMWARE_B_CONTINUE;
320 } 318 }
321 /* D'oh: No bootable firmware. */ 319 /* D'oh: No bootable firmware. */
322 return BOOT_FIRMWARE_RECOVERY_CONTINUE; 320 return BOOT_FIRMWARE_RECOVERY_CONTINUE;
323 } 321 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/utils/firmware_image.c ('k') | src/platform/vboot_reference/utils/firmware_utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698