Vadim Bendebury | c4b77e0 | 2015-05-27 15:29:50 -0700 | [diff] [blame] | 1 | /* |
| 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 Bendebury | bde479a | 2015-05-29 22:48:02 -0700 | [diff] [blame] | 10 | BOOL AreAttributesForParent( |
| 11 | OBJECT *parentObject // IN: parent handle |
| 12 | ); |
Vadim Bendebury | c4b77e0 | 2015-05-27 15:29:50 -0700 | [diff] [blame] | 13 | TPM_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 Bendebury | fffe7e7 | 2015-05-29 23:05:11 -0700 | [diff] [blame] | 20 | TPM_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 Bendebury | bde479a | 2015-05-29 22:48:02 -0700 | [diff] [blame] | 37 | void 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 Bendebury | 5bb7b9f | 2015-05-29 23:06:15 -0700 | [diff] [blame] | 45 | TPM_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 Bendebury | bde479a | 2015-05-29 22:48:02 -0700 | [diff] [blame] | 59 | TPM_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 Bendebury | 762a65d | 2015-05-29 23:07:01 -0700 | [diff] [blame] | 65 | TPM_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 Bendebury | 9d998c6 | 2015-05-29 23:07:44 -0700 | [diff] [blame] | 71 | void 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 Bendebury | 30f6dee | 2015-05-29 22:51:10 -0700 | [diff] [blame] | 78 | void 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 Bendebury | bde479a | 2015-05-29 22:48:02 -0700 | [diff] [blame] | 99 | void 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 Bendebury | c4b77e0 | 2015-05-27 15:29:50 -0700 | [diff] [blame] | 109 | |
| 110 | #endif // __TPM2_OBJECT_SPT_FP_H |