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_SESSION_FP_H 8 #define __TPM2_SESSION_FP_H 9 10 UINT32 SessionCapGetActiveAvail(void); 11 UINT32 SessionCapGetActiveNumber(void); 12 TPMI_YES_NO SessionCapGetLoaded(TPMI_SH_POLICY handle, // IN: start handle 13 UINT32 count, // IN: count of returned handle 14 TPML_HANDLE *handleList // OUT: list of handle 15 ); 16 UINT32 SessionCapGetLoadedAvail(void); 17 UINT32 SessionCapGetLoadedNumber(void); 18 TPMI_YES_NO SessionCapGetSaved(TPMI_SH_HMAC handle, // IN: start handle 19 UINT32 count, // IN: count of returned handle 20 TPML_HANDLE *handleList // OUT: list of handle 21 ); 22 void SessionComputeBoundEntity( 23 TPMI_DH_ENTITY entityHandle, // IN: handle of entity 24 TPM2B_NAME *bind // OUT: binding value 25 ); 26 TPM_RC SessionContextLoad( 27 SESSION *session, // IN: session structure from saved context 28 TPM_HANDLE *handle // IN/OUT: session handle 29 ); 30 TPM_RC SessionContextSave(TPM_HANDLE handle, // IN: session handle 31 CONTEXT_COUNTER *contextID // OUT: assigned contextID 32 ); 33 TPM_RC SessionCreate(TPM_SE sessionType, // IN: the session type 34 TPMI_ALG_HASH authHash, // IN: the hash algorithm 35 TPM2B_NONCE *nonceCaller, // IN: initial nonceCaller 36 TPMT_SYM_DEF *symmetric, // IN: the symmetric algorithm 37 TPMI_DH_ENTITY bind, // IN: the bind object 38 TPM2B_DATA *seed, // IN: seed data 39 TPM_HANDLE *sessionHandle // OUT: the session handle 40 ); 41 void SessionFlush(TPM_HANDLE handle // IN: loaded or saved session handle 42 ); 43 SESSION *SessionGet(TPM_HANDLE handle // IN: session handle 44 ); 45 void SessionInitPolicyData(SESSION *session // IN: session handle 46 ); 47 BOOL SessionIsLoaded(TPM_HANDLE handle // IN: session handle 48 ); 49 BOOL SessionIsSaved(TPM_HANDLE handle // IN: session handle 50 ); 51 BOOL SessionPCRValueIsCurrent(TPMI_SH_POLICY handle // IN: session handle 52 ); 53 void SessionResetPolicyData(SESSION *session // IN: the session to reset 54 ); 55 void SessionStartup(STARTUP_TYPE type); 56 57 #endif // __TPM2_SESSION_FP_H 58