1// 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.
4
5// THIS CODE IS GENERATED - DO NOT MODIFY!
6
7#ifndef TPM2_MAKECREDENTIAL_FP_H_
8#define TPM2_MAKECREDENTIAL_FP_H_
9
10#include "tpm_generated.h"
11
12typedef struct {
13  TPMI_DH_OBJECT handle;
14  TPM2B_DIGEST credential;
15  TPM2B_NAME objectName;
16} MakeCredential_In;
17
18typedef struct {
19  TPM2B_ID_OBJECT credentialBlob;
20  TPM2B_ENCRYPTED_SECRET secret;
21} MakeCredential_Out;
22
23// Executes MakeCredential with request handles and parameters from
24// |in| and computes response handles and parameters to |out|.
25TPM_RC TPM2_MakeCredential(MakeCredential_In* in, MakeCredential_Out* out);
26
27// Initializes handle fields in |target| from |request_handles|. Unmarshals
28// parameter fields in |target| from |buffer|.
29TPM_RC MakeCredential_In_Unmarshal(MakeCredential_In* target,
30                                   TPM_HANDLE request_handles[],
31                                   BYTE** buffer,
32                                   INT32* size);
33
34// Marshals response handles and parameters from |source| to |buffer|. Computes
35// and marshals the size of the parameter area (parameter_size) if |tag| ==
36// TPM_ST_SESSIONS. Returns size of (parameter area + handle area) in bytes.
37// Return value does not include parameter_size field.
38UINT16 MakeCredential_Out_Marshal(MakeCredential_Out* source,
39                                  TPMI_ST_COMMAND_TAG tag,
40                                  BYTE** buffer,
41                                  INT32* size);
42
43// Unmarshals any request parameters starting at |request_parameter_buffer|.
44// Executes command. Marshals any response handles and parameters to the
45// global response buffer and computes |*response_handle_buffer_size| and
46// |*response_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals
47// parameter_size indicating the size of the parameter area. parameter_size
48// field is located between the handle area and parameter area.
49TPM_RC Exec_MakeCredential(TPMI_ST_COMMAND_TAG tag,
50                           BYTE** request_parameter_buffer,
51                           INT32* request_parameter_buffer_size,
52                           TPM_HANDLE request_handles[],
53                           UINT32* response_handle_buffer_size,
54                           UINT32* response_parameter_buffer_size);
55
56#endif  // TPM2_MAKECREDENTIAL_FP_H
57