blob: 37756b876bc62224d4dbdebb6b9d52b0c9fc156e [file] [log] [blame]
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -07001/*
2 * Copyright 2015 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifndef __TPM2_OBJECT_FP_H
8#define __TPM2_OBJECT_FP_H
9
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070010BOOL AreAttributesForParent(OBJECT *parentObject // IN: parent handle
Vadim Bendeburybbd79002015-05-31 14:44:07 -070011 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070012TPMI_YES_NO ObjectCapGetLoaded(TPMI_DH_OBJECT handle, // IN: start handle
13 UINT32 count, // IN: count of returned handles
14 TPML_HANDLE *handleList // OUT: list of handle
15 );
16UINT32 ObjectCapGetTransientAvail(void);
17void ObjectCleanupEvict(void);
18void ObjectComputeName(TPMT_PUBLIC *publicArea, // IN: public area of an object
19 TPM2B_NAME *name // OUT: name of the object
Vadim Bendebury889ec832015-05-26 17:11:06 -070020 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070021void ObjectComputeQualifiedName(
22 TPM2B_NAME *parentQN, // IN: parent's qualified name
23 TPM_ALG_ID nameAlg, // IN: name hash
24 TPM2B_NAME *name, // IN: name of the object
25 TPM2B_NAME *qualifiedName // OUT: qualified name of the object
26 );
27TPM_RC ObjectContextLoad(
28 OBJECT *object, // IN: object structure from saved context
29 TPMI_DH_OBJECT *handle // OUT: object handle
30 );
31TPM_RC ObjectCreateEventSequence(
32 TPM2B_AUTH *auth, // IN: authValue
33 TPMI_DH_OBJECT *newHandle // OUT: sequence object handle
34 );
35TPM_RC ObjectCreateHMACSequence(
36 TPMI_ALG_HASH hashAlg, // IN: hash algorithm
37 TPM_HANDLE handle, // IN: the handle associated with sequence object
38 TPM2B_AUTH *auth, // IN: authValue
39 TPMI_DH_OBJECT *newHandle // OUT: HMAC sequence object handle
40 );
41TPM_RC ObjectCreateHashSequence(
42 TPMI_ALG_HASH hashAlg, // IN: hash algorithm
43 TPM2B_AUTH *auth, // IN: authValue
44 TPMI_DH_OBJECT *newHandle // OUT: sequence object handle
45 );
46TPMI_RH_HIERARCHY ObjectDataGetHierarchy(OBJECT *object // IN :object
47 );
48BOOL ObjectDataIsStorage(
49 TPMT_PUBLIC *publicArea // IN: public area of the object
50 );
51OBJECT *ObjectGet(TPMI_DH_OBJECT handle // IN: handle of the object
52 );
53TPMI_RH_HIERARCHY ObjectGetHierarchy(TPMI_DH_OBJECT handle // IN :object handle
54 );
55TPMI_ALG_HASH ObjectGetNameAlg(
56 TPMI_DH_OBJECT handle // IN: handle of the object
57 );
58TPM_RC ObjectLoadEvict(TPM_HANDLE *handle, // IN:OUT: evict object handle. If
59 // success, it will be replace by
60 // the loaded object handle
61 TPM_CC commandCode // IN: the command being processed
62 );
63void ObjectFlush(TPMI_DH_OBJECT handle // IN: handle to be freed
64 );
Vadim Bendebury59727bd2015-05-28 14:58:08 -070065void ObjectFlushHierarchy(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070066 TPMI_RH_HIERARCHY hierarchy // IN: hierarchy to be flush
67 );
68OBJECT *ObjectGet(TPMI_DH_OBJECT handle // IN: handle of the object
69 );
70UINT16 ObjectGetName(TPMI_DH_OBJECT handle, // IN: handle of the object
71 NAME *name // OUT: name of the object
Vadim Bendebury889ec832015-05-26 17:11:06 -070072 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070073void ObjectGetQualifiedName(
74 TPMI_DH_OBJECT handle, // IN: handle of the object
75 TPM2B_NAME *qualifiedName // OUT: qualified name of the object
76 );
77BOOL ObjectIsPresent(TPMI_DH_OBJECT handle // IN: handle to be checked
78 );
79BOOL ObjectIsSequence(OBJECT *object // IN: handle to be checked
Vadim Bendebury3743ac12015-05-29 22:44:14 -070080 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070081BOOL ObjectIsStorage(TPMI_DH_OBJECT handle // IN: object handle
82 );
Vadim Bendeburydf6896c2015-05-29 22:48:49 -070083TPM_RC ObjectLoad(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070084 TPMI_RH_HIERARCHY hierarchy, // IN: hierarchy to which the object belongs
85 TPMT_PUBLIC *publicArea, // IN: public area
86 TPMT_SENSITIVE *sensitive, // IN: sensitive area (may be null)
87 TPM2B_NAME *name, // IN: object's name (may be null)
88 TPM_HANDLE parentHandle, // IN: handle of parent
89 BOOL skipChecks, // IN: flag to indicate if it is OK to skip consistency
90 // checks.
91 TPMI_DH_OBJECT *handle // OUT: object handle
92 );
93void ObjectStartup(void);
94void ObjectTerminateEvent(void);
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -070095
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070096#endif // __TPM2_OBJECT_FP_H