blob: d8a2b0926496ccf2b707f0dc3a45c897af379642 [file] [log] [blame]
Randall Spanglerd1836442010-06-10 09:59:04 -07001/* 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 Spanglerd1836442010-06-10 09:59:04 -070011#include "cryptolib.h"
12#include "host_key.h"
Randall Spangler729b8722010-06-11 11:16:20 -070013#include "host_keyblock.h"
Randall Spanglerd55c6452010-06-10 12:43:51 -070014#include "host_misc.h"
Randall Spanglerd1836442010-06-10 09:59:04 -070015#include "host_signature.h"
16#include "utility.h"
17#include "vboot_struct.h"
18
19
Randall Spanglerd1836442010-06-10 09:59:04 -070020/* 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. */
24VbFirmwarePreambleHeader* 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. */
35VbKernelPreambleHeader* 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 Spanglerd55c6452010-06-10 12:43:51 -070041 uint64_t desired_size,
Randall Spanglerd1836442010-06-10 09:59:04 -070042 const VbPrivateKey* signing_key);
43
44#endif /* VBOOT_REFERENCE_HOST_COMMON_H_ */