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 |
11 #include <inttypes.h> | 11 #include <inttypes.h> |
12 | 12 |
13 #include "rsa.h" | 13 #include "rsa.h" |
14 #include "sha.h" | 14 #include "sha.h" |
15 | 15 |
16 #define KERNEL_MAGIC "CHROMEOS" | 16 #define KERNEL_MAGIC "CHROMEOS" |
17 #define KERNEL_MAGIC_SIZE 8 | 17 #define KERNEL_MAGIC_SIZE 8 |
18 | 18 |
19 /* Kernel config file options according to the Chrome OS drive map design. */ | 19 /* Kernel config file options according to the Chrome OS drive map design. */ |
20 typedef struct kconfig_options { | 20 typedef struct kconfig_options { |
21 uint32_t version[2]; /* Configuration file version. */ | 21 uint32_t version[2]; /* Configuration file version. */ |
22 uint32_t kernel_len; /* Size of the kernel. */ | 22 uint64_t kernel_len; /* Size of the kernel. */ |
23 uint64_t kernel_load_addr; /* Load address in memory for the kernel image */ | 23 uint64_t kernel_load_addr; /* Load address in memory for the kernel image */ |
24 uint64_t kernel_entry_addr; /* Address to jump to after kernel is loaded. */ | 24 uint64_t kernel_entry_addr; /* Address to jump to after kernel is loaded. */ |
25 } kconfig_options; | 25 } kconfig_options; |
26 | 26 |
27 | 27 |
28 typedef struct KernelImage { | 28 typedef struct KernelImage { |
29 uint8_t magic[KERNEL_MAGIC_SIZE]; | 29 uint8_t magic[KERNEL_MAGIC_SIZE]; |
30 /* Key header */ | 30 /* Key header */ |
31 uint16_t header_version; /* Header version. */ | 31 uint16_t header_version; /* Header version. */ |
32 uint16_t header_len; /* Length of the header. */ | 32 uint16_t header_len; /* Length of the header. */ |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 /* Add a kernel and kernel config signature to a kernel image [image] | 204 /* Add a kernel and kernel config signature to a kernel image [image] |
205 * using the private signing key in file [kernel_sigining_key_file]. | 205 * using the private signing key in file [kernel_sigining_key_file]. |
206 * | 206 * |
207 * Return 1 on success, 0 on failure. | 207 * Return 1 on success, 0 on failure. |
208 */ | 208 */ |
209 int AddKernelSignature(KernelImage* image, | 209 int AddKernelSignature(KernelImage* image, |
210 const char* kernel_sigining_key_file); | 210 const char* kernel_sigining_key_file); |
211 | 211 |
212 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_H_ */ | 212 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_H_ */ |
OLD | NEW |