| 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 kernel image. | 5 * Data structure and API definitions for a verified boot kernel image. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef VBOOT_REFERENCE_KERNEL_IMAGE_H_ | 8 #ifndef VBOOT_REFERENCE_KERNEL_IMAGE_H_ |
| 9 #define VBOOT_REFERENCE_KERNEL_IMAGE_H_ | 9 #define VBOOT_REFERENCE_KERNEL_IMAGE_H_ |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 /* Read kernel data from file named [input_file]. | 74 /* Read kernel data from file named [input_file]. |
| 75 * | 75 * |
| 76 * Returns a filled up KernelImage on success, NULL on error. | 76 * Returns a filled up KernelImage on success, NULL on error. |
| 77 */ | 77 */ |
| 78 KernelImage* ReadKernelImage(const char* input_file); | 78 KernelImage* ReadKernelImage(const char* input_file); |
| 79 | 79 |
| 80 /* Get the length of the header for kernel image [image]. */ | 80 /* Get the length of the header for kernel image [image]. */ |
| 81 int GetKernelHeaderLen(const KernelImage* image); | 81 int GetKernelHeaderLen(const KernelImage* image); |
| 82 | 82 |
| 83 /* Calculate and store the kernel header checksum of [image] |
| 84 * in [header_checksum]. |
| 85 * |
| 86 * [header_checksum] must be a valid pointer to a buffer of |
| 87 * SHA512_DIGEST_SIZE. |
| 88 */ |
| 89 void CalculateKernelHeaderChecksum(const KernelImage* image, |
| 90 uint8_t* header_checksum); |
| 91 |
| 83 /* Get kernel header binary blob from an [image]. | 92 /* Get kernel header binary blob from an [image]. |
| 84 * | 93 * |
| 85 * Caller owns the returned pointer and must Free() it. | 94 * Caller owns the returned pointer and must Free() it. |
| 86 */ | 95 */ |
| 87 uint8_t* GetKernelHeaderBlob(const KernelImage* image); | 96 uint8_t* GetKernelHeaderBlob(const KernelImage* image); |
| 88 | 97 |
| 89 /* Get kernel config binary blob from an [image]. | 98 /* Get kernel config binary blob from an [image]. |
| 90 * | 99 * |
| 91 * Caller owns the returned pointer and must Free() it. | 100 * Caller owns the returned pointer and must Free() it. |
| 92 */ | 101 */ |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 215 |
| 207 /* Add a kernel and kernel config signature to a kernel image [image] | 216 /* Add a kernel and kernel config signature to a kernel image [image] |
| 208 * using the private signing key in file [kernel_sigining_key_file]. | 217 * using the private signing key in file [kernel_sigining_key_file]. |
| 209 * | 218 * |
| 210 * Return 1 on success, 0 on failure. | 219 * Return 1 on success, 0 on failure. |
| 211 */ | 220 */ |
| 212 int AddKernelSignature(KernelImage* image, | 221 int AddKernelSignature(KernelImage* image, |
| 213 const char* kernel_sigining_key_file); | 222 const char* kernel_sigining_key_file); |
| 214 | 223 |
| 215 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_H_ */ | 224 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_H_ */ |
| OLD | NEW |