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

Side by Side Diff: src/platform/vboot_reference/vboot_firmware/include/firmware_image_fw.h

Issue 2589001: Add a kernel subkey signing algorithm key and algorithm fields to firmware preamble. (Closed) Base URL: ssh://git@gitrw.chromium.org/chromiumos
Patch Set: 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
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 * Data structure and API definitions for a verified boot firmware image. 5 * Data structure and API definitions for a verified boot firmware image.
6 * (Firmware Portion) 6 * (Firmware Portion)
7 */ 7 */
8 8
9 #ifndef VBOOT_REFERENCE_FIRMWARE_IMAGE_FW_H_ 9 #ifndef VBOOT_REFERENCE_FIRMWARE_IMAGE_FW_H_
10 #define VBOOT_REFERENCE_FIRMWARE_IMAGE_FW_H_ 10 #define VBOOT_REFERENCE_FIRMWARE_IMAGE_FW_H_
(...skipping 18 matching lines...) Expand all
29 uint16_t firmware_key_version; /* Key Version# for preventing rollbacks. */ 29 uint16_t firmware_key_version; /* Key Version# for preventing rollbacks. */
30 uint8_t* firmware_sign_key; /* Pre-processed public half of signing key. */ 30 uint8_t* firmware_sign_key; /* Pre-processed public half of signing key. */
31 uint8_t header_checksum[SHA512_DIGEST_SIZE]; /* SHA-512 hash of the header.*/ 31 uint8_t header_checksum[SHA512_DIGEST_SIZE]; /* SHA-512 hash of the header.*/
32 32
33 uint8_t firmware_key_signature[RSA8192NUMBYTES]; /* Signature of the header 33 uint8_t firmware_key_signature[RSA8192NUMBYTES]; /* Signature of the header
34 * above. */ 34 * above. */
35 35
36 /* Firmware Preamble. */ 36 /* Firmware Preamble. */
37 uint16_t firmware_version; /* Firmware Version# for preventing rollbacks.*/ 37 uint16_t firmware_version; /* Firmware Version# for preventing rollbacks.*/
38 uint64_t firmware_len; /* Length of the rest of the R/W firmware data. */ 38 uint64_t firmware_len; /* Length of the rest of the R/W firmware data. */
39 uint16_t kernel_subkey_sign_algorithm; /* Signature algorithm used for
40 * signing the kernel subkey. */
41 uint8_t* kernel_subkey_sign_key; /* Pre-processed public half of the kernel
42 * subkey signing key. */
39 uint8_t preamble[FIRMWARE_PREAMBLE_SIZE]; /* Remaining preamble data.*/ 43 uint8_t preamble[FIRMWARE_PREAMBLE_SIZE]; /* Remaining preamble data.*/
40 44
41 uint8_t* preamble_signature; /* Signature over the preamble. */ 45 uint8_t* preamble_signature; /* Signature over the preamble. */
42 46
43 /* The firmware signature comes first as it may allow us to parallelize 47 /* The firmware signature comes first as it may allow us to parallelize
44 * the firmware data fetch and RSA public operation. 48 * the firmware data fetch and RSA public operation.
45 */ 49 */
46 uint8_t* firmware_signature; /* Signature on the Preamble + 50 uint8_t* firmware_signature; /* Signature on the Preamble +
47 [firmware_data]. */ 51 [firmware_data]. */
48 uint8_t* firmware_data; /* Rest of firmware data */ 52 uint8_t* firmware_data; /* Rest of firmware data */
49 53
50 } FirmwareImage; 54 } FirmwareImage;
51 55
52 56
53 /* Error Codes for VerifyFirmware* family of functions. */ 57 /* Error Codes for VerifyFirmware* family of functions. */
54 #define VERIFY_FIRMWARE_SUCCESS 0 58 #define VERIFY_FIRMWARE_SUCCESS 0
55 #define VERIFY_FIRMWARE_INVALID_IMAGE 1 59 #define VERIFY_FIRMWARE_INVALID_IMAGE 1
56 #define VERIFY_FIRMWARE_ROOT_SIGNATURE_FAILED 2 60 #define VERIFY_FIRMWARE_ROOT_SIGNATURE_FAILED 2
57 #define VERIFY_FIRMWARE_INVALID_ALGORITHM 3 61 #define VERIFY_FIRMWARE_INVALID_ALGORITHM 3
58 #define VERIFY_FIRMWARE_PREAMBLE_SIGNATURE_FAILED 4 62 #define VERIFY_FIRMWARE_PREAMBLE_SIGNATURE_FAILED 4
59 #define VERIFY_FIRMWARE_SIGNATURE_FAILED 5 63 #define VERIFY_FIRMWARE_SIGNATURE_FAILED 5
60 #define VERIFY_FIRMWARE_WRONG_MAGIC 6 64 #define VERIFY_FIRMWARE_WRONG_MAGIC 6
61 #define VERIFY_FIRMWARE_WRONG_HEADER_CHECKSUM 7 65 #define VERIFY_FIRMWARE_WRONG_HEADER_CHECKSUM 7
62 #define VERIFY_FIRMWARE_KEY_ROLLBACK 8 66 #define VERIFY_FIRMWARE_KEY_ROLLBACK 8
63 #define VERIFY_FIRMWARE_VERSION_ROLLBACK 9 67 #define VERIFY_FIRMWARE_VERSION_ROLLBACK 9
64 #define VERIFY_FIRMWARE_MAX 10 /* Total number of error codes. */ 68 #define VERIFY_FIRMWARE_MAX 10 /* Total number of error codes. */
65 69
66 extern char* kVerifyFirmwareErrors[VERIFY_FIRMWARE_MAX]; 70 extern char* kVerifyFirmwareErrors[VERIFY_FIRMWARE_MAX];
67 71
72 /* Returns the length of the verified boot firmware preamble based on
73 * kernel subkey signing algorithm [algorithm]. */
74 uint64_t GetFirmwarePreambleLen(int algorithm);
75
68 /* Checks for the sanity of the firmware header pointed by [header_blob]. 76 /* Checks for the sanity of the firmware header pointed by [header_blob].
69 * 77 *
70 * On success, put signature algorithm in [algorithm], header length 78 * On success, put signature algorithm in [algorithm], header length
71 * in [header_len], and return 0. 79 * in [header_len], and return 0.
72 * Else, return error code on failure. 80 * Else, return error code on failure.
73 */ 81 */
74 int VerifyFirmwareHeader(const uint8_t* root_key_blob, 82 int VerifyFirmwareHeader(const uint8_t* root_key_blob,
75 const uint8_t* header_blob, 83 const uint8_t* header_blob,
76 int* algorithm, 84 int* algorithm,
77 int* header_len); 85 int* header_len);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 * BOOT_FIRMWARE_B_CONTINUE Boot from Firmware B 144 * BOOT_FIRMWARE_B_CONTINUE Boot from Firmware B
137 * BOOT_FIRMWARE_RECOVERY_CONTINUE Jump to recovery mode 145 * BOOT_FIRMWARE_RECOVERY_CONTINUE Jump to recovery mode
138 */ 146 */
139 int VerifyFirmwareDriver_f(uint8_t* root_key_blob, 147 int VerifyFirmwareDriver_f(uint8_t* root_key_blob,
140 uint8_t* verification_headerA, 148 uint8_t* verification_headerA,
141 uint8_t* firmwareA, 149 uint8_t* firmwareA,
142 uint8_t* verification_headerB, 150 uint8_t* verification_headerB,
143 uint8_t* firmwareB); 151 uint8_t* firmwareB);
144 152
145 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_FW_H_ */ 153 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_FW_H_ */
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/tests/test_common.c ('k') | src/platform/vboot_reference/vboot_firmware/lib/firmware_image_fw.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698