| 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 * API definitions for a verified boot firmware image. | 5 * API definitions for a verified boot firmware image. |
| 6 * (Userland Portion) | 6 * (Userland Portion) |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ | 9 #ifndef VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ |
| 10 #define VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ | 10 #define VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 /* Get a verified firmware binary blob from an [image] and fill its | 50 /* Get a verified firmware binary blob from an [image] and fill its |
| 51 * length into blob_len. | 51 * length into blob_len. |
| 52 * | 52 * |
| 53 * Caller owns the returned pointer and must Free() it. | 53 * Caller owns the returned pointer and must Free() it. |
| 54 */ | 54 */ |
| 55 uint8_t* GetFirmwareBlob(const FirmwareImage* image, uint64_t* blob_len); | 55 uint8_t* GetFirmwareBlob(const FirmwareImage* image, uint64_t* blob_len); |
| 56 | 56 |
| 57 /* Write firmware data from [image] into a file named [input_file]. | 57 /* Write firmware data from [image] into a file named [input_file]. |
| 58 * | 58 * |
| 59 * If [is_just_vblock] is 1, only the verification block (excluding the |
| 60 * actual firmware_data) is written. |
| 59 * Return 1 on success, 0 on failure. | 61 * Return 1 on success, 0 on failure. |
| 60 */ | 62 */ |
| 61 int WriteFirmwareImage(const char* input_file, | 63 int WriteFirmwareImage(const char* input_file, |
| 62 const FirmwareImage* image); | 64 const FirmwareImage* image, |
| 65 int is_only_vblock); |
| 63 | 66 |
| 64 /* Pretty print the contents of [image]. Only headers and metadata information | 67 /* Pretty print the contents of [image]. Only headers and metadata information |
| 65 * is printed. | 68 * is printed. |
| 66 */ | 69 */ |
| 67 void PrintFirmwareImage(const FirmwareImage* image); | 70 void PrintFirmwareImage(const FirmwareImage* image); |
| 68 | 71 |
| 69 /* Performs a chained verify of the firmware [image]. | 72 /* Performs a chained verify of the firmware [image]. |
| 70 * | 73 * |
| 71 * Returns 0 on success, error code on failure. | 74 * Returns 0 on success, error code on failure. |
| 72 */ | 75 */ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 84 int AddFirmwareKeySignature(FirmwareImage* image, const char* root_key_file); | 87 int AddFirmwareKeySignature(FirmwareImage* image, const char* root_key_file); |
| 85 | 88 |
| 86 /* Add firmware and preamble signature to a firmware image [image] | 89 /* Add firmware and preamble signature to a firmware image [image] |
| 87 * using the private signing key in file [signing_key_file]. | 90 * using the private signing key in file [signing_key_file]. |
| 88 * | 91 * |
| 89 * Return 1 on success, 0 on failure. | 92 * Return 1 on success, 0 on failure. |
| 90 */ | 93 */ |
| 91 int AddFirmwareSignature(FirmwareImage* image, const char* signing_key_file); | 94 int AddFirmwareSignature(FirmwareImage* image, const char* signing_key_file); |
| 92 | 95 |
| 93 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ | 96 #endif /* VBOOT_REFERENCE_FIRMWARE_IMAGE_H_ */ |
| OLD | NEW |