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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 /* Deep free the contents of [fw]. */ | 55 /* Deep free the contents of [fw]. */ |
56 void FirmwareImageFree(FirmwareImage* fw); | 56 void FirmwareImageFree(FirmwareImage* fw); |
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]. */ |
| 65 int GetFirmwareHeaderLen(const FirmwareImage* image); |
| 66 |
64 /* Get firmware header binary blob from an [image]. | 67 /* Get firmware header binary blob from an [image]. |
65 * | 68 * |
66 * Caller owns the returned pointer and must Free() it. | 69 * Caller owns the returned pointer and must Free() it. |
67 */ | 70 */ |
68 uint8_t* GetFirmwareHeaderBlob(const FirmwareImage* image); | 71 uint8_t* GetFirmwareHeaderBlob(const FirmwareImage* image); |
69 | 72 |
70 /* Get firmware preamble binary blob from an [image]. | 73 /* Get firmware preamble binary blob from an [image]. |
71 * | 74 * |
72 * Caller owns the returned pointer and must Free() it. | 75 * Caller owns the returned pointer and must Free() it. |
73 */ | 76 */ |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 int AddFirmwareKeySignature(FirmwareImage* image, const char* root_key_file); | 183 int AddFirmwareKeySignature(FirmwareImage* image, const char* root_key_file); |
181 | 184 |
182 /* Add firmware and preamble signature to a firmware image [image] | 185 /* Add firmware and preamble signature to a firmware image [image] |
183 * using the private signing key in file [signing_key_file]. | 186 * using the private signing key in file [signing_key_file]. |
184 * | 187 * |
185 * Return 1 on success, 0 on failure. | 188 * Return 1 on success, 0 on failure. |
186 */ | 189 */ |
187 int AddFirmwareSignature(FirmwareImage* image, const char* signing_key_file); | 190 int AddFirmwareSignature(FirmwareImage* image, const char* signing_key_file); |
188 | 191 |
189 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ | 192 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ |
OLD | NEW |