blob: 250cecec4b3dc251cdd36c0729d6a9b9981fa6f8 [file] [log] [blame]
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -07001// Copyright 2015 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.
Vadim Bendeburye8a8a1c2015-06-01 19:06:32 -07004
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -07005// THIS CODE IS GENERATED - DO NOT MODIFY!
6
Vadim Bendebury776e2362015-09-04 16:14:53 -07007#ifndef TPM2_UNSEAL_FP_H_
8#define TPM2_UNSEAL_FP_H_
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -07009
10#include "tpm_generated.h"
Vadim Bendeburye8a8a1c2015-06-01 19:06:32 -070011
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070012typedef struct { TPMI_DH_OBJECT itemHandle; } Unseal_In;
Vadim Bendeburye8a8a1c2015-06-01 19:06:32 -070013
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070014typedef struct { TPM2B_SENSITIVE_DATA outData; } Unseal_Out;
Vadim Bendeburye8a8a1c2015-06-01 19:06:32 -070015
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070016// Executes Unseal with request handles and parameters from
17// |in| and computes response handles and parameters to |out|.
18TPM_RC TPM2_Unseal(Unseal_In* in, Unseal_Out* out);
Vadim Bendeburye8a8a1c2015-06-01 19:06:32 -070019
Vadim Bendebury776e2362015-09-04 16:14:53 -070020// Initializes handle fields in |target| from |request_handles|. Unmarshals
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070021// parameter fields in |target| from |buffer|.
22TPM_RC Unseal_In_Unmarshal(Unseal_In* target,
Vadim Bendebury776e2362015-09-04 16:14:53 -070023 TPM_HANDLE request_handles[],
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070024 BYTE** buffer,
25 INT32* size);
26
27// Marshals response handles and parameters from |source| to |buffer|. Computes
28// and marshals the size of the parameter area (parameter_size) if |tag| ==
29// TPM_ST_SESSIONS. Returns size of (parameter area + handle area) in bytes.
Vadim Bendebury776e2362015-09-04 16:14:53 -070030// Return value does not include parameter_size field.
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070031UINT16 Unseal_Out_Marshal(Unseal_Out* source,
32 TPMI_ST_COMMAND_TAG tag,
33 BYTE** buffer,
34 INT32* size);
35
Vadim Bendebury776e2362015-09-04 16:14:53 -070036// Unmarshals any request parameters starting at |request_parameter_buffer|.
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070037// Executes command. Marshals any response handles and parameters to the
Vadim Bendebury776e2362015-09-04 16:14:53 -070038// global response buffer and computes |*response_handle_buffer_size| and
39// |*response_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070040// parameter_size indicating the size of the parameter area. parameter_size
41// field is located between the handle area and parameter area.
42TPM_RC Exec_Unseal(TPMI_ST_COMMAND_TAG tag,
Vadim Bendebury776e2362015-09-04 16:14:53 -070043 BYTE** request_parameter_buffer,
44 INT32* request_parameter_buffer_size,
45 TPM_HANDLE request_handles[],
46 UINT32* response_handle_buffer_size,
47 UINT32* response_parameter_buffer_size);
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070048
49#endif // TPM2_UNSEAL_FP_H