| 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 * High-level firmware API for loading and verifying rewritable firmware. | 5 * High-level firmware API for loading and verifying rewritable firmware. |
| 6 * (Firmware Portion) | 6 * (Firmware Portion) |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ | 9 #ifndef VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ |
| 10 #define VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ | 10 #define VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 /* Update the data hash for the current firmware image, extending it | 38 /* Update the data hash for the current firmware image, extending it |
| 39 * by [size] bytes stored in [*data]. This function must only be | 39 * by [size] bytes stored in [*data]. This function must only be |
| 40 * called inside GetFirmwareBody(). */ | 40 * called inside GetFirmwareBody(). */ |
| 41 void UpdateFirmwareBodyHash(uint8_t* data, uint64_t size); | 41 void UpdateFirmwareBodyHash(uint8_t* data, uint64_t size); |
| 42 | 42 |
| 43 | 43 |
| 44 typedef struct LoadFirmwareParams { | 44 typedef struct LoadFirmwareParams { |
| 45 /* Inputs to LoadFirmware() */ | 45 /* Inputs to LoadFirmware() */ |
| 46 void *firmware_root_key_blob; /* Key used to sign firmware header */ | 46 void *firmware_root_key_blob; /* Key used to sign firmware header */ |
| 47 void *verification_block_0; /* Key block + preamble for firmware 0 */ | 47 void *verification_block_0; /* Key block + preamble for firmware 0 */ |
| 48 void *verification_block_1; /* Key block + preamble for firmware 1 */ | 48 void *verification_block_1; /* Key block + preamble for firmware 1 */ |
| 49 uint64_t verification_size_0; /* Verification block 0 size in bytes */ |
| 50 uint64_t verification_size_1; /* Verification block 1 size in bytes */ |
| 49 | 51 |
| 50 /* Outputs from LoadFirmware(); valid only if LoadFirmware() returns | 52 /* Outputs from LoadFirmware(); valid only if LoadFirmware() returns |
| 51 * LOAD_FIRMWARE_SUCCESS. */ | 53 * LOAD_FIRMWARE_SUCCESS. */ |
| 52 uint64_t firmware_index; /* Firmware index to run. */ | 54 uint64_t firmware_index; /* Firmware index to run. */ |
| 53 void *kernel_sign_key_blob; /* Key to use when loading kernel. | 55 void *kernel_sign_key_blob; /* Key to use when loading kernel. |
| 54 * Pass this data to LoadKernel() in | 56 * Pass this data to LoadKernel() in |
| 55 * LoadKernelParams.header_sign_key_blob. | 57 * LoadKernelParams.header_sign_key_blob. |
| 56 * Key data may be copied/relocated | 58 * Key data may be copied/relocated |
| 57 * if necessary. */ | 59 * if necessary. */ |
| 58 uint64_t kernel_sign_key_size; /* Size of kernel signing key blob, | 60 uint64_t kernel_sign_key_size; /* Size of kernel signing key blob, |
| 59 * in bytes. */ | 61 * in bytes. */ |
| 60 } LoadFirmwareParams; | 62 } LoadFirmwareParams; |
| 61 | 63 |
| 62 | 64 |
| 63 /* Attempts to load the rewritable firmware. | 65 /* Attempts to load the rewritable firmware. |
| 64 * | 66 * |
| 65 * Returns LOAD_FIRMWARE_SUCCESS if successful, error code on failure. */ | 67 * Returns LOAD_FIRMWARE_SUCCESS if successful, error code on failure. */ |
| 66 int LoadFirmware(LoadFirmwareParams* params); | 68 int LoadFirmware(LoadFirmwareParams* params); |
| 67 | 69 |
| 68 | 70 |
| 69 #endif /* VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ */ | 71 #endif /* VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ */ |
| OLD | NEW |