blob: a16f7441c7d152c6a68f4e8fcfb6d1e0811cc026 [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 Bendeburyc4b77e02015-05-27 15:29:50 -07004
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -07005// THIS CODE IS GENERATED - DO NOT MODIFY!
6
7#ifndef TPM2_ACTIVATECREDENTIAL_FP_H
8#define TPM2_ACTIVATECREDENTIAL_FP_H
9
10#include "tpm_generated.h"
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -070011
12typedef struct {
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070013 TPMI_DH_OBJECT activateHandle;
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070014 TPMI_DH_OBJECT keyHandle;
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070015 TPM2B_ID_OBJECT credentialBlob;
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070016 TPM2B_ENCRYPTED_SECRET secret;
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -070017} ActivateCredential_In;
18
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070019typedef struct { TPM2B_DIGEST certInfo; } ActivateCredential_Out;
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -070020
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070021// Executes ActivateCredential with request handles and parameters from
22// |in| and computes response handles and parameters to |out|.
23TPM_RC TPM2_ActivateCredential(ActivateCredential_In* in,
24 ActivateCredential_Out* out);
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -070025
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070026// Initializes handle fields in |target| from |req_handles|. Unmarshals
27// parameter fields in |target| from |buffer|.
28TPM_RC ActivateCredential_In_Unmarshal(ActivateCredential_In* target,
29 TPM_HANDLE req_handles[],
30 BYTE** buffer,
31 INT32* size);
32
33// Marshals response handles and parameters from |source| to |buffer|. Computes
34// and marshals the size of the parameter area (parameter_size) if |tag| ==
35// TPM_ST_SESSIONS. Returns size of (parameter area + handle area) in bytes.
36// Does not include parameter_size field.
37UINT16 ActivateCredential_Out_Marshal(ActivateCredential_Out* source,
38 TPMI_ST_COMMAND_TAG tag,
39 BYTE** buffer,
40 INT32* size);
41
42// Unmarshals any request parameters starting at |req_parameter_buffer|.
43// Executes command. Marshals any response handles and parameters to the
44// global response buffer and computes |*res_handle_buffer_size| and
45// |*res_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals
46// parameter_size indicating the size of the parameter area. parameter_size
47// field is located between the handle area and parameter area.
48TPM_RC Exec_ActivateCredential(TPMI_ST_COMMAND_TAG tag,
49 BYTE** req_parameter_buffer,
50 INT32* req_parameter_buffer_size,
51 TPM_HANDLE req_handles[],
52 UINT32* res_handle_buffer_size,
53 UINT32* res_parameter_buffer_size);
54
55#endif // TPM2_ACTIVATECREDENTIAL_FP_H