1a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// Copyright 2015 The Chromium OS Authors. All rights reserved.
2a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// Use of this source code is governed by a BSD-style license that can be
3a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// found in the LICENSE file.
4950c1a546a4891d79ea2974e8e6a5d2d02aebf9bVadim Bendebury
5a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// THIS CODE IS GENERATED - DO NOT MODIFY!
6a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr
7776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury#ifndef TPM2_POLICYTICKET_FP_H_
8776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury#define TPM2_POLICYTICKET_FP_H_
9a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr
10a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr#include "tpm_generated.h"
11950c1a546a4891d79ea2974e8e6a5d2d02aebf9bVadim Bendebury
12950c1a546a4891d79ea2974e8e6a5d2d02aebf9bVadim Bendeburytypedef struct {
13a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr  TPMI_SH_POLICY policySession;
14a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr  TPM2B_TIMEOUT timeout;
15f788ffb5e5b4493cb4c1deaa12a97c80c2694b01Vadim Bendebury  TPM2B_DIGEST cpHashA;
16f788ffb5e5b4493cb4c1deaa12a97c80c2694b01Vadim Bendebury  TPM2B_NONCE policyRef;
17f788ffb5e5b4493cb4c1deaa12a97c80c2694b01Vadim Bendebury  TPM2B_NAME authName;
18a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr  TPMT_TK_AUTH ticket;
19950c1a546a4891d79ea2974e8e6a5d2d02aebf9bVadim Bendebury} PolicyTicket_In;
20950c1a546a4891d79ea2974e8e6a5d2d02aebf9bVadim Bendebury
21a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// Executes PolicyTicket with request handles and parameters from |in|.
22a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn BohrTPM_RC TPM2_PolicyTicket(PolicyTicket_In* in);
23a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr
24776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury// Initializes handle fields in |target| from |request_handles|. Unmarshals
25a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// parameter fields in |target| from |buffer|.
26a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn BohrTPM_RC PolicyTicket_In_Unmarshal(PolicyTicket_In* target,
27776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury                                 TPM_HANDLE request_handles[],
28a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr                                 BYTE** buffer,
29a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr                                 INT32* size);
30a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr
31776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury// Unmarshals any request parameters starting at |request_parameter_buffer|.
32a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// Executes command. Marshals any response handles and parameters to the
33776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury// global response buffer and computes |*response_handle_buffer_size| and
34776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury// |*response_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals
35a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// parameter_size indicating the size of the parameter area. parameter_size
36a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr// field is located between the handle area and parameter area.
37a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn BohrTPM_RC Exec_PolicyTicket(TPMI_ST_COMMAND_TAG tag,
38776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury                         BYTE** request_parameter_buffer,
39776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury                         INT32* request_parameter_buffer_size,
40776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury                         TPM_HANDLE request_handles[],
41776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury                         UINT32* response_handle_buffer_size,
42776e23689ddfb58cf6d6a111a3741a308e3fe60fVadim Bendebury                         UINT32* response_parameter_buffer_size);
43950c1a546a4891d79ea2974e8e6a5d2d02aebf9bVadim Bendebury
44a4ed3aa64664a1241ea982d685db744caaae3ffaJocelyn Bohr#endif  // TPM2_POLICYTICKET_FP_H
45