1/* Copyright (c) 2014 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 firmware preamble
6 */
7
8#ifndef VBOOT_REFERENCE_HOST_FW_PREAMBLE2_H_
9#define VBOOT_REFERENCE_HOST_FW_PREAMBLE2_H_
10
11#include "vb2_struct.h"
12
13struct vb2_private_key;
14
15/**
16 * Create and sign a firmware preamble.
17 *
18 * @param fp_ptr	On success, points to a newly allocated preamble buffer.
19 *			Caller is responsible for calling free() on this.
20 * @param signing_key	Key to sign the preamble with
21 * @param hash_list	Component hashes to include in the keyblock
22 * @param hash_count	Number of component hashes
23 * @param fw_version	Firmware version
24 * @param flags		Flags for preamble
25 * @param desc		Description for preamble, or NULL if none
26 * @return VB2_SUCCESS, or non-zero error code if failure.
27 */
28int vb2_fw_preamble_create(struct vb2_fw_preamble **fp_ptr,
29			   const struct vb2_private_key *signing_key,
30			   const struct vb2_signature **hash_list,
31			   uint32_t hash_count,
32			   uint32_t fw_version,
33			   uint32_t flags,
34			   const char *desc);
35
36#endif  /* VBOOT_REFERENCE_HOST_FW_PREAMBLE2_H_ */
37