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 * Data structure and API definitions for a verified boot firmware image. | 5 * Data structure and API definitions for a verified boot firmware image. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ | 8 #ifndef VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ |
9 #define VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ | 9 #define VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 /* Checks the preamble signature on firmware preamble pointed by | 135 /* Checks the preamble signature on firmware preamble pointed by |
136 * [preamble_blob] using the signing key [sign_key]. | 136 * [preamble_blob] using the signing key [sign_key]. |
137 * | 137 * |
138 * On success, put firmware length into [firmware_len], and return 0. | 138 * On success, put firmware length into [firmware_len], and return 0. |
139 * Else, return error code on failure. | 139 * Else, return error code on failure. |
140 */ | 140 */ |
141 int VerifyFirmwarePreamble(RSAPublicKey* sign_key, | 141 int VerifyFirmwarePreamble(RSAPublicKey* sign_key, |
142 const uint8_t* preamble_blob, | 142 const uint8_t* preamble_blob, |
143 int algorithm, | 143 int algorithm, |
144 int* firmware_len); | 144 uint64_t* firmware_len); |
145 | 145 |
146 /* Checks the signature on the preamble + firmware data at | 146 /* Checks the signature on the preamble + firmware data at |
147 * [preamble_start] and [firmware_data_start]. | 147 * [preamble_start] and [firmware_data_start]. |
148 * The length of the actual firmware data is firmware_len and it is assumed to | 148 * The length of the actual firmware data is firmware_len and it is assumed to |
149 * be prepended with the signature whose size depends on the signature_algorithm | 149 * be prepended with the signature whose size depends on the signature_algorithm |
150 * [algorithm]. This signature also covers the preamble data (but not the | 150 * [algorithm]. This signature also covers the preamble data (but not the |
151 * preamble signature itself). | 151 * preamble signature itself). |
152 * | 152 * |
153 * Return 0 on success, error code on failure. | 153 * Return 0 on success, error code on failure. |
154 */ | 154 */ |
155 int VerifyFirmwareData(RSAPublicKey* sign_key, | 155 int VerifyFirmwareData(RSAPublicKey* sign_key, |
156 const uint8_t* preamble_start, | 156 const uint8_t* preamble_start, |
157 const uint8_t* firmware_data_start, | 157 const uint8_t* firmware_data_start, |
158 int firmware_len, | 158 uint64_t firmware_len, |
159 int algorithm); | 159 int algorithm); |
160 | 160 |
161 /* Performs a chained verify of the firmware blob [firmware_blob]. | 161 /* Performs a chained verify of the firmware blob [firmware_blob]. |
162 * | 162 * |
163 * Returns 0 on success, error code on failure. | 163 * Returns 0 on success, error code on failure. |
164 * | 164 * |
165 * NOTE: The length of the firmware blob is derived from reading the fields | 165 * NOTE: The length of the firmware blob is derived from reading the fields |
166 * in the first few bytes of the buffer. This might look risky but in firmware | 166 * in the first few bytes of the buffer. This might look risky but in firmware |
167 * land, the start address of the firmware_blob will always be fixed depending | 167 * land, the start address of the firmware_blob will always be fixed depending |
168 * on the memory map on the particular platform. In addition, the signature on | 168 * on the memory map on the particular platform. In addition, the signature on |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 * Returns the code path to follow. It is one of: | 211 * Returns the code path to follow. It is one of: |
212 * BOOT_FIRMWARE_A_CONTINUE Boot from Firmware A | 212 * BOOT_FIRMWARE_A_CONTINUE Boot from Firmware A |
213 * BOOT_FIRMWARE_B_CONTINUE Boot from Firmware B | 213 * BOOT_FIRMWARE_B_CONTINUE Boot from Firmware B |
214 * BOOT_FIRMWARE_RECOVERY_CONTINUE Jump to recovery mode | 214 * BOOT_FIRMWARE_RECOVERY_CONTINUE Jump to recovery mode |
215 */ | 215 */ |
216 int VerifyFirmwareDriver_f(uint8_t* root_key_blob, | 216 int VerifyFirmwareDriver_f(uint8_t* root_key_blob, |
217 uint8_t* firmwareA, | 217 uint8_t* firmwareA, |
218 uint8_t* firmwareB); | 218 uint8_t* firmwareB); |
219 | 219 |
220 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ | 220 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ |
OLD | NEW |