| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 /* Read firmware data from file named [input_file]. | 58 /* Read firmware data from file named [input_file]. |
| 59 * | 59 * |
| 60 * Returns a filled up FirmwareImage structure on success, NULL on error. | 60 * Returns a filled up FirmwareImage structure on success, NULL on error. |
| 61 */ | 61 */ |
| 62 FirmwareImage* ReadFirmwareImage(const char* input_file); | 62 FirmwareImage* ReadFirmwareImage(const char* input_file); |
| 63 | 63 |
| 64 /* Get the length of the header for image [image]. */ | 64 /* Get the length of the header for image [image]. */ |
| 65 int GetFirmwareHeaderLen(const FirmwareImage* image); | 65 int GetFirmwareHeaderLen(const FirmwareImage* image); |
| 66 | 66 |
| 67 /* Calculate and store the firmware header checksum of [image] |
| 68 * in [header_checksum]. |
| 69 * |
| 70 * [header_checksum] must be a valid pointer to a buffer of |
| 71 * SHA512_DIGEST_SIZE. |
| 72 */ |
| 73 void CalculateFirmwareHeaderChecksum(const FirmwareImage *image, |
| 74 uint8_t* header_checksum); |
| 75 |
| 67 /* Get firmware header binary blob from an [image]. | 76 /* Get firmware header binary blob from an [image]. |
| 68 * | 77 * |
| 69 * Caller owns the returned pointer and must Free() it. | 78 * Caller owns the returned pointer and must Free() it. |
| 70 */ | 79 */ |
| 71 uint8_t* GetFirmwareHeaderBlob(const FirmwareImage* image); | 80 uint8_t* GetFirmwareHeaderBlob(const FirmwareImage* image); |
| 72 | 81 |
| 73 /* Get firmware preamble binary blob from an [image]. | 82 /* Get firmware preamble binary blob from an [image]. |
| 74 * | 83 * |
| 75 * Caller owns the returned pointer and must Free() it. | 84 * Caller owns the returned pointer and must Free() it. |
| 76 */ | 85 */ |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 int AddFirmwareKeySignature(FirmwareImage* image, const char* root_key_file); | 192 int AddFirmwareKeySignature(FirmwareImage* image, const char* root_key_file); |
| 184 | 193 |
| 185 /* Add firmware and preamble signature to a firmware image [image] | 194 /* Add firmware and preamble signature to a firmware image [image] |
| 186 * using the private signing key in file [signing_key_file]. | 195 * using the private signing key in file [signing_key_file]. |
| 187 * | 196 * |
| 188 * Return 1 on success, 0 on failure. | 197 * Return 1 on success, 0 on failure. |
| 189 */ | 198 */ |
| 190 int AddFirmwareSignature(FirmwareImage* image, const char* signing_key_file); | 199 int AddFirmwareSignature(FirmwareImage* image, const char* signing_key_file); |
| 191 | 200 |
| 192 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ | 201 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ |
| OLD | NEW |