Randall Spangler | d183644 | 2010-06-10 09:59:04 -0700 | [diff] [blame] | 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 |
| 3 | * found in the LICENSE file. |
| 4 | * |
| 5 | * Host-side functions for verified boot. |
| 6 | */ |
| 7 | |
| 8 | #ifndef VBOOT_REFERENCE_HOST_COMMON_H_ |
| 9 | #define VBOOT_REFERENCE_HOST_COMMON_H_ |
| 10 | |
Randall Spangler | d183644 | 2010-06-10 09:59:04 -0700 | [diff] [blame] | 11 | #include "cryptolib.h" |
| 12 | #include "host_key.h" |
Randall Spangler | 729b872 | 2010-06-11 11:16:20 -0700 | [diff] [blame] | 13 | #include "host_keyblock.h" |
Randall Spangler | d55c645 | 2010-06-10 12:43:51 -0700 | [diff] [blame] | 14 | #include "host_misc.h" |
Randall Spangler | d183644 | 2010-06-10 09:59:04 -0700 | [diff] [blame] | 15 | #include "host_signature.h" |
| 16 | #include "utility.h" |
| 17 | #include "vboot_struct.h" |
| 18 | |
| 19 | |
Randall Spangler | d183644 | 2010-06-10 09:59:04 -0700 | [diff] [blame] | 20 | /* Creates a firmware preamble, signed with [signing_key]. |
| 21 | * Caller owns the returned pointer, and must free it with Free(). |
| 22 | * |
| 23 | * Returns NULL if error. */ |
| 24 | VbFirmwarePreambleHeader* CreateFirmwarePreamble( |
| 25 | uint64_t firmware_version, |
| 26 | const VbPublicKey* kernel_subkey, |
| 27 | const VbSignature* body_signature, |
| 28 | const VbPrivateKey* signing_key); |
| 29 | |
| 30 | |
| 31 | /* Creates a kernel preamble, signed with [signing_key]. |
| 32 | * Caller owns the returned pointer, and must free it with Free(). |
| 33 | * |
| 34 | * Returns NULL if error. */ |
| 35 | VbKernelPreambleHeader* CreateKernelPreamble( |
| 36 | uint64_t kernel_version, |
| 37 | uint64_t body_load_address, |
| 38 | uint64_t bootloader_address, |
| 39 | uint64_t bootloader_size, |
| 40 | const VbSignature* body_signature, |
Randall Spangler | d55c645 | 2010-06-10 12:43:51 -0700 | [diff] [blame] | 41 | uint64_t desired_size, |
Randall Spangler | d183644 | 2010-06-10 09:59:04 -0700 | [diff] [blame] | 42 | const VbPrivateKey* signing_key); |
| 43 | |
| 44 | #endif /* VBOOT_REFERENCE_HOST_COMMON_H_ */ |