blob: 7ff17def84c7190f4ec10bfed9f749ccefd4da16 [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);
45TPM_RC PublicAttributesValidation(
46 BOOL load, // IN: TRUE if load checks, FALSE if
47 // TPM2_Create()
48 TPMI_DH_OBJECT parentHandle, // IN: input parent handle
49 TPMT_PUBLIC *publicArea // IN: public area of the object
50);
Vadim Bendebury30f6dee2015-05-29 22:51:10 -070051void SensitiveToDuplicate(
52 TPMT_SENSITIVE *sensitive, // IN: sensitive structure
53 TPM2B_NAME *name, // IN: the name of the object
54 TPM_HANDLE parentHandle, // IN: The new parent's handle
55 TPM_ALG_ID nameAlg, // IN: hash algorithm in public area. It
56 // is passed separately because we
57 // only pass name, rather than the
58 // whole public area of the object.
59 TPM2B_SEED *seed, // IN: the external seed. If external
60 // seed is provided with size of 0,
61 // no outer wrap should be applied
62 // to duplication blob.
63 TPMT_SYM_DEF_OBJECT *symDef, // IN: Symmetric key definition. If the
64 // symmetric key algorithm is NULL,
65 // no inner wrap should be applied.
66 TPM2B_DATA *innerSymKey, // IN/OUT: a symmetric key may be
67 // provided to encrypt the inner
68 // wrap of a duplication blob. May
69 // be generated here if needed.
70 TPM2B_PRIVATE *outPrivate // OUT: output private structure
71 );
Vadim Bendeburybde479a2015-05-29 22:48:02 -070072void SensitiveToPrivate(
73 TPMT_SENSITIVE *sensitive, // IN: sensitive structure
74 TPM2B_NAME *name, // IN: the name of the object
75 TPM_HANDLE parentHandle, // IN: The parent's handle
76 TPM_ALG_ID nameAlg, // IN: hash algorithm in public area. This
77 // parameter is used when parentHandle is
78 // NULL, in which case the object is
79 // temporary.
80 TPM2B_PRIVATE *outPrivate // OUT: output private structure
81);
Vadim Bendeburyc4b77e02015-05-27 15:29:50 -070082
83#endif // __TPM2_OBJECT_SPT_FP_H