Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -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_PCR_FP_H |
| 8 | #define __TPM2_PCR_FP_H |
| 9 | |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 10 | TPM_RC PCRAllocate(TPML_PCR_SELECTION *allocate, // IN: required allocation |
| 11 | UINT32 *maxPCR, // OUT: Maximum number of PCR |
| 12 | UINT32 *sizeNeeded, // OUT: required space |
| 13 | UINT32 *sizeAvailable // OUT: available space |
| 14 | ); |
| 15 | BOOL PCRBelongsAuthGroup(TPMI_DH_PCR handle, // IN: handle of PCR |
| 16 | UINT32 *groupIndex // OUT: group index if PCR belongs |
| 17 | // a group that allows authValue. |
| 18 | // If PCR does not belong to an |
| 19 | // auth group, the value in this |
| 20 | // parameter is invalid |
| 21 | ); |
| 22 | BOOL PCRBelongsPolicyGroup(TPMI_DH_PCR handle, // IN: handle of PCR |
| 23 | UINT32 *groupIndex // OUT: group index if PCR |
| 24 | // belongs a group that allows |
| 25 | // policy. If PCR does not belong |
| 26 | // to a policy group, the value |
| 27 | // in this parameter is invalid |
| 28 | ); |
Vadim Bendebury | bbd7900 | 2015-05-31 14:44:07 -0700 | [diff] [blame] | 29 | TPMI_YES_NO PCRCapGetAllocation( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 30 | UINT32 count, // IN: count of return |
| 31 | TPML_PCR_SELECTION *pcrSelection // OUT: PCR allocation list |
| 32 | ); |
| 33 | void PCRChanged(TPM_HANDLE pcrHandle // IN: the handle of the PCR that changed. |
| 34 | ); |
Vadim Bendebury | fe7bde4 | 2015-06-01 10:55:46 -0700 | [diff] [blame] | 35 | void PCRComputeCurrentDigest( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 36 | TPMI_ALG_HASH hashAlg, // IN: hash algorithm to compute digest |
| 37 | TPML_PCR_SELECTION * |
| 38 | selection, // IN/OUT: PCR selection (filtered on output) |
| 39 | TPM2B_DIGEST *digest // OUT: digest |
| 40 | ); |
| 41 | TPMI_ALG_HASH PCRGetAuthPolicy(TPMI_DH_PCR handle, // IN: PCR handle |
| 42 | TPM2B_DIGEST *policy // OUT: policy of PCR |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 43 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 44 | TPMI_YES_NO PCRCapGetHandles(TPMI_DH_PCR handle, // IN: start handle |
| 45 | UINT32 count, // IN: count of returned handle |
| 46 | TPML_HANDLE *handleList // OUT: list of handle |
| 47 | ); |
Vadim Bendebury | bbd7900 | 2015-05-31 14:44:07 -0700 | [diff] [blame] | 48 | TPMI_YES_NO PCRCapGetProperties( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 49 | TPM_PT_PCR property, // IN: the starting PCR property |
| 50 | UINT32 count, // IN: count of returned propertie |
| 51 | TPML_TAGGED_PCR_PROPERTY *select // OUT: PCR select |
| 52 | ); |
| 53 | void PCRGetAuthValue(TPMI_DH_PCR handle, // IN: PCR handle |
| 54 | TPM2B_AUTH *auth // OUT: authValue of PCR |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 55 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 56 | void PCRExtend(TPMI_DH_PCR handle, // IN: PCR handle to be extended |
| 57 | TPMI_ALG_HASH hash, // IN: hash algorithm of PCR |
| 58 | UINT32 size, // IN: size of data to be extended |
| 59 | BYTE *data // IN: data to be extended |
Vadim Bendebury | b0d692f | 2015-05-29 22:54:52 -0700 | [diff] [blame] | 60 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 61 | void PCRResetDynamics(void); |
Vadim Bendebury | 2a791af | 2015-06-01 19:17:51 -0700 | [diff] [blame] | 62 | void PcrDrtm( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 63 | const TPMI_DH_PCR pcrHandle, // IN: the index of the PCR to be modified |
| 64 | const TPMI_ALG_HASH hash, // IN: the bank identifier |
| 65 | const TPM2B_DIGEST *digest // IN: the digest to modify the PCR |
| 66 | ); |
| 67 | BOOL PcrIsAllocated(UINT32 pcr, // IN: The number of the PCR |
| 68 | TPMI_ALG_HASH hashAlg // IN: The PCR algorithm |
| 69 | ); |
| 70 | BOOL PCRIsExtendAllowed(TPMI_DH_PCR handle // IN: PCR handle to be extended |
Vadim Bendebury | b0d692f | 2015-05-29 22:54:52 -0700 | [diff] [blame] | 71 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 72 | BOOL PCRIsResetAllowed(TPMI_DH_PCR handle // IN: PCR handle to be extended |
| 73 | ); |
| 74 | BOOL PCRIsStateSaved(TPMI_DH_PCR handle // IN: PCR handle to be extended |
Vadim Bendebury | b0d692f | 2015-05-29 22:54:52 -0700 | [diff] [blame] | 75 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 76 | BOOL PCRPolicyIsAvailable(TPMI_DH_PCR handle // IN: PCR handle |
| 77 | ); |
Vadim Bendebury | 3a6b9cb | 2015-06-01 12:02:26 -0700 | [diff] [blame] | 78 | void PCRRead( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 79 | TPML_PCR_SELECTION * |
| 80 | selection, // IN/OUT: PCR selection (filtered on output) |
| 81 | TPML_DIGEST *digest, // OUT: digest |
| 82 | UINT32 *pcrCounter // OUT: the current value of PCR generation number |
| 83 | ); |
| 84 | void PCRSetValue(TPM_HANDLE handle, // IN: the handle of the PCR to set |
| 85 | INT8 initialValue // IN: the value to set |
| 86 | ); |
| 87 | void PCRSimStart(void); |
| 88 | void PCRStartup(STARTUP_TYPE type, // IN: startup type |
| 89 | BYTE locality // IN: startup locality |
| 90 | ); |
| 91 | void PCRStateSave(TPM_SU type // IN: startup type |
| 92 | ); |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 93 | |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 94 | #endif // __TPM2_PCR_FP_H |