blob: 15657d148a31d8b4eefd79785c9d6d0676eff2ad [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_SPT_FP_H
8#define __TPM2_OBJECT_SPT_FP_H
9
Vadim Bendeburybde479a2015-05-29 22:48:02 -070010BOOL AreAttributesForParent(
11 OBJECT *parentObject // IN: parent handle
12);
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -070013TPM_RC CredentialToSecret(
14 TPM2B_ID_OBJECT *inIDObject, // IN: input credential blob
15 TPM2B_NAME *name, // IN: the name of the object
16 TPM2B_SEED *seed, // IN: an external seed.
17 TPM_HANDLE protector, // IN: The protector's handle
18 TPM2B_DIGEST *secret // OUT: secret information
19);
Vadim Bendeburyfffe7e72015-05-29 23:05:11 -070020TPM_RC DuplicateToSensitive(
21 TPM2B_PRIVATE *inPrivate, // IN: input private structure
22 TPM2B_NAME *name, // IN: the name of the object
23 TPM_HANDLE parentHandle, // IN: The parent's handle
24 TPM_ALG_ID nameAlg, // IN: hash algorithm in public area.
25 TPM2B_SEED *seed, // IN: an external seed may be provided.
26 // If external seed is provided with
27 // size of 0, no outer wrap is
28 // applied
29 TPMT_SYM_DEF_OBJECT *symDef, // IN: Symmetric key definition. If the
30 // symmetric key algorithm is NULL,
31 // no inner wrap is applied
32 TPM2B_DATA *innerSymKey, // IN: a symmetric key may be provided
33 // to decrypt the inner wrap of a
34 // duplication blob.
35 TPMT_SENSITIVE *sensitive // OUT: sensitive structure
36 );
Vadim Bendeburybde479a2015-05-29 22:48:02 -070037void FillInCreationData(
38 TPMI_DH_OBJECT parentHandle, // IN: handle of parent
39 TPMI_ALG_HASH nameHashAlg, // IN: name hash algorithm
40 TPML_PCR_SELECTION *creationPCR, // IN: PCR selection
41 TPM2B_DATA *outsideData, // IN: outside data
42 TPM2B_CREATION_DATA *outCreation, // OUT: creation data for output
43 TPM2B_DIGEST *creationDigest // OUT: creation digest
44);
Vadim Bendebury5bb7b9f2015-05-29 23:06:15 -070045TPM_RC PrivateToSensitive(
46 TPM2B_PRIVATE *inPrivate, // IN: input private structure
47 TPM2B_NAME *name, // IN: the name of the object
48 TPM_HANDLE parentHandle, // IN: The parent's handle
49 TPM_ALG_ID nameAlg, // IN: hash algorithm in public area. It is
50 // passed separately because we only pass
51 // name, rather than the whole public area
52 // of the object. This parameter is used in
53 // the following two cases: 1. primary
54 // objects. 2. duplication blob with inner
55 // wrap. In other cases, this parameter
56 // will be ignored
57 TPMT_SENSITIVE *sensitive // OUT: sensitive structure
58 );
Vadim Bendeburybde479a2015-05-29 22:48:02 -070059TPM_RC PublicAttributesValidation(
60 BOOL load, // IN: TRUE if load checks, FALSE if
61 // TPM2_Create()
62 TPMI_DH_OBJECT parentHandle, // IN: input parent handle
63 TPMT_PUBLIC *publicArea // IN: public area of the object
64);
Vadim Bendebury762a65d2015-05-29 23:07:01 -070065TPM_RC SchemeChecks(
66 BOOL load, // IN: TRUE if load checks, FALSE if
67 // TPM2_Create()
68 TPMI_DH_OBJECT parentHandle, // IN: input parent handle
69 TPMT_PUBLIC *publicArea // IN: public area of the object
70 );
Vadim Bendebury9d998c62015-05-29 23:07:44 -070071void SecretToCredential(
72 TPM2B_DIGEST *secret, // IN: secret information
73 TPM2B_NAME *name, // IN: the name of the object
74 TPM2B_SEED *seed, // IN: an external seed.
75 TPM_HANDLE protector, // IN: The protector's handle
76 TPM2B_ID_OBJECT *outIDObject // OUT: output credential
77 );
Vadim Bendebury30f6dee2015-05-29 22:51:10 -070078void SensitiveToDuplicate(
79 TPMT_SENSITIVE *sensitive, // IN: sensitive structure
80 TPM2B_NAME *name, // IN: the name of the object
81 TPM_HANDLE parentHandle, // IN: The new parent's handle
82 TPM_ALG_ID nameAlg, // IN: hash algorithm in public area. It
83 // is passed separately because we
84 // only pass name, rather than the
85 // whole public area of the object.
86 TPM2B_SEED *seed, // IN: the external seed. If external
87 // seed is provided with size of 0,
88 // no outer wrap should be applied
89 // to duplication blob.
90 TPMT_SYM_DEF_OBJECT *symDef, // IN: Symmetric key definition. If the
91 // symmetric key algorithm is NULL,
92 // no inner wrap should be applied.
93 TPM2B_DATA *innerSymKey, // IN/OUT: a symmetric key may be
94 // provided to encrypt the inner
95 // wrap of a duplication blob. May
96 // be generated here if needed.
97 TPM2B_PRIVATE *outPrivate // OUT: output private structure
98 );
Vadim Bendeburybde479a2015-05-29 22:48:02 -070099void SensitiveToPrivate(
100 TPMT_SENSITIVE *sensitive, // IN: sensitive structure
101 TPM2B_NAME *name, // IN: the name of the object
102 TPM_HANDLE parentHandle, // IN: The parent's handle
103 TPM_ALG_ID nameAlg, // IN: hash algorithm in public area. This
104 // parameter is used when parentHandle is
105 // NULL, in which case the object is
106 // temporary.
107 TPM2B_PRIVATE *outPrivate // OUT: output private structure
108);
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -0700109
110#endif // __TPM2_OBJECT_SPT_FP_H