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_NV_CERTIFY_FP_H_
8 #define TPM2_NV_CERTIFY_FP_H_
9 
10 #include "tpm_generated.h"
11 
12 typedef struct {
13   TPMI_DH_OBJECT signHandle;
14   TPMI_RH_NV_AUTH authHandle;
15   TPMI_RH_NV_INDEX nvIndex;
16   TPM2B_DATA qualifyingData;
17   TPMT_SIG_SCHEME inScheme;
18   UINT16 size;
19   UINT16 offset;
20 } NV_Certify_In;
21 
22 typedef struct {
23   TPM2B_ATTEST certifyInfo;
24   TPMT_SIGNATURE signature;
25 } NV_Certify_Out;
26 
27 // Executes NV_Certify with request handles and parameters from
28 // |in| and computes response handles and parameters to |out|.
29 TPM_RC TPM2_NV_Certify(NV_Certify_In* in, NV_Certify_Out* out);
30 
31 // Initializes handle fields in |target| from |request_handles|. Unmarshals
32 // parameter fields in |target| from |buffer|.
33 TPM_RC NV_Certify_In_Unmarshal(NV_Certify_In* target,
34                                TPM_HANDLE request_handles[],
35                                BYTE** buffer,
36                                INT32* size);
37 
38 // Marshals response handles and parameters from |source| to |buffer|. Computes
39 // and marshals the size of the parameter area (parameter_size) if |tag| ==
40 // TPM_ST_SESSIONS. Returns size of (parameter area + handle area) in bytes.
41 // Return value does not include parameter_size field.
42 UINT16 NV_Certify_Out_Marshal(NV_Certify_Out* source,
43                               TPMI_ST_COMMAND_TAG tag,
44                               BYTE** buffer,
45                               INT32* size);
46 
47 // Unmarshals any request parameters starting at |request_parameter_buffer|.
48 // Executes command. Marshals any response handles and parameters to the
49 // global response buffer and computes |*response_handle_buffer_size| and
50 // |*response_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals
51 // parameter_size indicating the size of the parameter area. parameter_size
52 // field is located between the handle area and parameter area.
53 TPM_RC Exec_NV_Certify(TPMI_ST_COMMAND_TAG tag,
54                        BYTE** request_parameter_buffer,
55                        INT32* request_parameter_buffer_size,
56                        TPM_HANDLE request_handles[],
57                        UINT32* response_handle_buffer_size,
58                        UINT32* response_parameter_buffer_size);
59 
60 #endif  // TPM2_NV_CERTIFY_FP_H
61