9#ifndef _TPM2_COMMAND_LIB_H_
10#define _TPM2_COMMAND_LIB_H_
29 IN TPMI_ALG_HASH HashAlg,
30 OUT TPMI_DH_OBJECT *SequenceHandle
47 IN TPMI_DH_OBJECT SequenceHandle,
68 IN TPMI_DH_PCR PcrHandle,
69 IN TPMI_DH_OBJECT SequenceHandle,
87 IN TPMI_DH_OBJECT SequenceHandle,
103 IN TPM_SU StartupType
117 IN TPM_SU ShutdownType
134 IN TPMI_YES_NO FullTest
152 IN TPMI_RH_HIERARCHY_AUTH AuthHandle,
155 IN TPMI_ALG_HASH HashAlg
170 IN TPMI_RH_CLEAR AuthHandle,
188 IN TPMI_RH_CLEAR AuthHandle,
190 IN TPMI_YES_NO Disable
207 IN TPMI_RH_HIERARCHY_AUTH AuthHandle,
225 IN TPMI_RH_PLATFORM AuthHandle,
242 IN TPMI_RH_PLATFORM AuthHandle,
261 IN TPMI_RH_HIERARCHY AuthHandle,
263 IN TPMI_RH_HIERARCHY Hierarchy,
280 IN TPMI_RH_LOCKOUT LockHandle,
300 IN TPMI_RH_LOCKOUT LockHandle,
302 IN UINT32 NewMaxTries,
303 IN UINT32 NewRecoveryTime,
304 IN UINT32 LockoutRecovery
320 IN TPMI_RH_NV_INDEX NvIndex,
342 IN TPMI_RH_PROVISION AuthHandle,
362 IN TPMI_RH_PROVISION AuthHandle,
363 IN TPMI_RH_NV_INDEX NvIndex,
384 IN TPMI_RH_NV_AUTH AuthHandle,
385 IN TPMI_RH_NV_INDEX NvIndex,
408 IN TPMI_RH_NV_AUTH AuthHandle,
409 IN TPMI_RH_NV_INDEX NvIndex,
429 IN TPMI_RH_NV_AUTH AuthHandle,
430 IN TPMI_RH_NV_INDEX NvIndex,
448 IN TPMI_RH_NV_AUTH AuthHandle,
449 IN TPMI_RH_NV_INDEX NvIndex,
466 IN TPMI_RH_PROVISION AuthHandle,
485 IN TPMI_RH_NV_AUTH AuthHandle,
486 IN TPMI_RH_NV_INDEX NvIndex,
505 IN TPMI_DH_PCR PcrHandle,
527 IN TPMI_DH_PCR PcrHandle,
547 OUT UINT32 *PcrUpdateCounter,
569 IN TPMI_RH_PLATFORM AuthHandle,
572 OUT TPMI_YES_NO *AllocationSuccess,
574 OUT UINT32 *SizeNeeded,
575 OUT UINT32 *SizeAvailable
591 IN UINT32 SupportedPCRBanks,
623 IN TPM_CAP Capability,
625 IN UINT32 PropertyCount,
626 OUT TPMI_YES_NO *MoreData,
659 OUT UINT32 *ManufactureId
676 OUT UINT32 *FirmwareVersion1,
677 OUT UINT32 *FirmwareVersion2
694 OUT UINT32 *MaxCommandSize,
695 OUT UINT32 *MaxResponseSize
728 OUT UINT32 *LockoutCounter
744 OUT UINT32 *LockoutInterval
761 OUT UINT32 *InputBufferSize
794 OUT UINT32 *TpmHashAlgorithmBitmap,
795 OUT UINT32 *ActivePcrBanks
811 OUT UINT32 *AlgorithmSet
827 OUT BOOLEAN *IsCmdImpl
859 IN TPMI_RH_PLATFORM AuthHandle,
861 IN UINT32 AlgorithmSet
884 IN TPMI_DH_OBJECT TpmKey,
885 IN TPMI_DH_ENTITY Bind,
888 IN TPM_SE SessionType,
890 IN TPMI_ALG_HASH AuthHash,
891 OUT TPMI_SH_AUTH_SESSION *SessionHandle,
906 IN TPMI_DH_CONTEXT FlushHandle
930 IN TPMI_DH_ENTITY AuthHandle,
931 IN TPMI_SH_POLICY PolicySession,
956 IN TPMI_SH_POLICY PolicySession,
972 IN TPMI_SH_POLICY PolicySession,
989 IN TPMI_SH_POLICY PolicySession,
1007 IN TPMI_DH_OBJECT ObjectHandle,
1029 OUT UINT8 *AuthSessionOut
1043 IN UINT8 *AuthSessionIn,
1057 IN TPMI_ALG_HASH HashAlgo
1070 IN TPMI_ALG_HASH HashAlgo
1085 IN TPMI_ALG_HASH HashAlg,
1086 IN UINT32 HashAlgorithmMask
1101 IN OUT VOID *Buffer,
1103 IN UINT32 HashAlgorithmMask
1132 IN TPMI_ALG_HASH HashAlg,
1150 IN TPMI_DH_PCR PcrHandle,
EFI_STATUS EFIAPI Tpm2ChangeEPS(IN TPMI_RH_PLATFORM AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession)
UINT16 EFIAPI GetHashSizeFromAlgo(IN TPMI_ALG_HASH HashAlgo)
EFI_STATUS EFIAPI Tpm2DictionaryAttackParameters(IN TPMI_RH_LOCKOUT LockHandle, IN TPMS_AUTH_COMMAND *AuthSession, IN UINT32 NewMaxTries, IN UINT32 NewRecoveryTime, IN UINT32 LockoutRecovery)
EFI_STATUS EFIAPI Tpm2Clear(IN TPMI_RH_CLEAR AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL)
EFI_STATUS EFIAPI Tpm2HierarchyChangeAuth(IN TPMI_RH_HIERARCHY_AUTH AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession, IN TPM2B_AUTH *NewAuth)
UINT32 EFIAPI GetHashMaskFromAlgo(IN TPMI_ALG_HASH HashAlgo)
EFI_STATUS EFIAPI Tpm2NvDefineSpace(IN TPMI_RH_PROVISION AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL, IN TPM2B_AUTH *Auth, IN TPM2B_NV_PUBLIC *NvPublic)
BOOLEAN EFIAPI IsHashAlgSupportedInHashAlgorithmMask(IN TPMI_ALG_HASH HashAlg, IN UINT32 HashAlgorithmMask)
EFI_STATUS EFIAPI Tpm2NvGlobalWriteLock(IN TPMI_RH_PROVISION AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL)
EFI_STATUS EFIAPI Tpm2NvWriteLock(IN TPMI_RH_NV_AUTH AuthHandle, IN TPMI_RH_NV_INDEX NvIndex, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL)
EFI_STATUS EFIAPI Tpm2GetCapabilitySupportedAndActivePcrs(OUT UINT32 *TpmHashAlgorithmBitmap, OUT UINT32 *ActivePcrBanks)
EFI_STATUS EFIAPI Tpm2GetCapabilitySupportedAlg(OUT TPML_ALG_PROPERTY *AlgList)
EFI_STATUS EFIAPI Tpm2HierarchyControl(IN TPMI_RH_HIERARCHY AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession, IN TPMI_RH_HIERARCHY Hierarchy, IN TPMI_YES_NO State)
EFI_STATUS EFIAPI Tpm2PcrEvent(IN TPMI_DH_PCR PcrHandle, IN TPM2B_EVENT *EventData, OUT TPML_DIGEST_VALUES *Digests)
EFI_STATUS EFIAPI Tpm2GetCapabilityAlgorithmSet(OUT UINT32 *AlgorithmSet)
EFI_STATUS EFIAPI Tpm2ReadPublic(IN TPMI_DH_OBJECT ObjectHandle, OUT TPM2B_PUBLIC *OutPublic, OUT TPM2B_NAME *Name, OUT TPM2B_NAME *QualifiedName)
EFI_STATUS EFIAPI Tpm2SelfTest(IN TPMI_YES_NO FullTest)
EFI_STATUS EFIAPI Tpm2GetCapabilityIsCommandImplemented(IN TPM_CC Command, OUT BOOLEAN *IsCmdImpl)
EFI_STATUS EFIAPI Tpm2GetCapability(IN TPM_CAP Capability, IN UINT32 Property, IN UINT32 PropertyCount, OUT TPMI_YES_NO *MoreData, OUT TPMS_CAPABILITY_DATA *CapabilityData)
EFI_STATUS EFIAPI Tpm2PolicyOR(IN TPMI_SH_POLICY PolicySession, IN TPML_DIGEST *HashList)
UINT32 EFIAPI CopyAuthSessionResponse(IN UINT8 *AuthSessionIn, OUT TPMS_AUTH_RESPONSE *AuthSessionOut OPTIONAL)
EFI_STATUS EFIAPI Tpm2PolicyCommandCode(IN TPMI_SH_POLICY PolicySession, IN TPM_CC Code)
VOID *EFIAPI CopyDigestListToBuffer(IN OUT VOID *Buffer, IN TPML_DIGEST_VALUES *DigestList, IN UINT32 HashAlgorithmMask)
EFI_STATUS EFIAPI Tpm2HashSequenceStart(IN TPMI_ALG_HASH HashAlg, OUT TPMI_DH_OBJECT *SequenceHandle)
EFI_STATUS EFIAPI Tpm2SetAlgorithmSet(IN TPMI_RH_PLATFORM AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession, IN UINT32 AlgorithmSet)
UINT32 EFIAPI CopyAuthSessionCommand(IN TPMS_AUTH_COMMAND *AuthSessionIn OPTIONAL, OUT UINT8 *AuthSessionOut)
EFI_STATUS EFIAPI Tpm2DictionaryAttackLockReset(IN TPMI_RH_LOCKOUT LockHandle, IN TPMS_AUTH_COMMAND *AuthSession)
EFI_STATUS EFIAPI Tpm2GetCapabilityLockoutInterval(OUT UINT32 *LockoutInterval)
EFI_STATUS EFIAPI Tpm2GetCapabilityFamily(OUT CHAR8 *Family)
EFI_STATUS EFIAPI Tpm2PcrAllocate(IN TPMI_RH_PLATFORM AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession, IN TPML_PCR_SELECTION *PcrAllocation, OUT TPMI_YES_NO *AllocationSuccess, OUT UINT32 *MaxPCR, OUT UINT32 *SizeNeeded, OUT UINT32 *SizeAvailable)
EFI_STATUS EFIAPI Tpm2SetPrimaryPolicy(IN TPMI_RH_HIERARCHY_AUTH AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession, IN TPM2B_DIGEST *AuthPolicy, IN TPMI_ALG_HASH HashAlg)
EFI_STATUS EFIAPI Tpm2NvRead(IN TPMI_RH_NV_AUTH AuthHandle, IN TPMI_RH_NV_INDEX NvIndex, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL, IN UINT16 Size, IN UINT16 Offset, IN OUT TPM2B_MAX_BUFFER *OutData)
EFI_STATUS EFIAPI Tpm2GetCapabilityFirmwareVersion(OUT UINT32 *FirmwareVersion1, OUT UINT32 *FirmwareVersion2)
EFI_STATUS EFIAPI Tpm2GetCapabilityMaxCommandResponseSize(OUT UINT32 *MaxCommandSize, OUT UINT32 *MaxResponseSize)
EFI_STATUS EFIAPI Tpm2NvExtend(IN TPMI_RH_NV_AUTH AuthHandle, IN TPMI_RH_NV_INDEX NvIndex, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL, IN TPM2B_MAX_BUFFER *InData)
EFI_STATUS EFIAPI Tpm2NvReadLock(IN TPMI_RH_NV_AUTH AuthHandle, IN TPMI_RH_NV_INDEX NvIndex, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL)
EFI_STATUS EFIAPI Tpm2FlushContext(IN TPMI_DH_CONTEXT FlushHandle)
EFI_STATUS EFIAPI Tpm2GetCapabilityManufactureID(OUT UINT32 *ManufactureId)
EFI_STATUS EFIAPI Tpm2StartAuthSession(IN TPMI_DH_OBJECT TpmKey, IN TPMI_DH_ENTITY Bind, IN TPM2B_NONCE *NonceCaller, IN TPM2B_ENCRYPTED_SECRET *Salt, IN TPM_SE SessionType, IN TPMT_SYM_DEF *Symmetric, IN TPMI_ALG_HASH AuthHash, OUT TPMI_SH_AUTH_SESSION *SessionHandle, OUT TPM2B_NONCE *NonceTPM)
EFI_STATUS EFIAPI Tpm2PolicySecret(IN TPMI_DH_ENTITY AuthHandle, IN TPMI_SH_POLICY PolicySession, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL, IN TPM2B_NONCE *NonceTPM, IN TPM2B_DIGEST *CpHashA, IN TPM2B_NONCE *PolicyRef, IN INT32 Expiration, OUT TPM2B_TIMEOUT *Timeout, OUT TPMT_TK_AUTH *PolicyTicket)
EFI_STATUS EFIAPI Tpm2Startup(IN TPM_SU StartupType)
EFI_STATUS EFIAPI Tpm2TestParms(IN TPMT_PUBLIC_PARMS *Parameters)
EFI_STATUS EFIAPI Tpm2PcrAllocateBanks(IN TPM2B_AUTH *PlatformAuth OPTIONAL, IN UINT32 SupportedPCRBanks, IN UINT32 PCRBanks)
EFI_STATUS EFIAPI Tpm2ClearControl(IN TPMI_RH_CLEAR AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL, IN TPMI_YES_NO Disable)
EFI_STATUS EFIAPI Tpm2PolicyGetDigest(IN TPMI_SH_POLICY PolicySession, OUT TPM2B_DIGEST *PolicyHash)
EFI_STATUS EFIAPI Tpm2SequenceComplete(IN TPMI_DH_OBJECT SequenceHandle, IN TPM2B_MAX_BUFFER *Buffer, OUT TPM2B_DIGEST *Result)
EFI_STATUS EFIAPI Tpm2Shutdown(IN TPM_SU ShutdownType)
EFI_STATUS EFIAPI Tpm2PcrRead(IN TPML_PCR_SELECTION *PcrSelectionIn, OUT UINT32 *PcrUpdateCounter, OUT TPML_PCR_SELECTION *PcrSelectionOut, OUT TPML_DIGEST *PcrValues)
EFI_STATUS EFIAPI Tpm2EventSequenceComplete(IN TPMI_DH_PCR PcrHandle, IN TPMI_DH_OBJECT SequenceHandle, IN TPM2B_MAX_BUFFER *Buffer, OUT TPML_DIGEST_VALUES *Results)
EFI_STATUS EFIAPI Tpm2SequenceUpdate(IN TPMI_DH_OBJECT SequenceHandle, IN TPM2B_MAX_BUFFER *Buffer)
UINT32 EFIAPI GetDigestListSize(IN TPML_DIGEST_VALUES *DigestList)
EFI_STATUS EFIAPI Tpm2PcrExtend(IN TPMI_DH_PCR PcrHandle, IN TPML_DIGEST_VALUES *Digests)
EFI_STATUS EFIAPI Tpm2NvUndefineSpace(IN TPMI_RH_PROVISION AuthHandle, IN TPMI_RH_NV_INDEX NvIndex, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL)
EFI_STATUS EFIAPI Tpm2PcrReadForActiveBank(IN TPMI_DH_PCR PcrHandle, OUT TPML_DIGEST *HashList)
EFI_STATUS EFIAPI Tpm2GetCapabilityInputBufferSize(OUT UINT32 *InputBufferSize)
EFI_STATUS EFIAPI Tpm2NvReadPublic(IN TPMI_RH_NV_INDEX NvIndex, OUT TPM2B_NV_PUBLIC *NvPublic, OUT TPM2B_NAME *NvName)
EFI_STATUS EFIAPI Tpm2GetCapabilityPcrs(OUT TPML_PCR_SELECTION *Pcrs)
EFI_STATUS EFIAPI Tpm2NvWrite(IN TPMI_RH_NV_AUTH AuthHandle, IN TPMI_RH_NV_INDEX NvIndex, IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL, IN TPM2B_MAX_BUFFER *InData, IN UINT16 Offset)
EFI_STATUS EFIAPI Tpm2ChangePPS(IN TPMI_RH_PLATFORM AuthHandle, IN TPMS_AUTH_COMMAND *AuthSession)
EFI_STATUS EFIAPI GetDigestFromDigestList(IN TPMI_ALG_HASH HashAlg, IN TPML_DIGEST_VALUES *DigestList, OUT VOID *Digest)
EFI_STATUS EFIAPI Tpm2GetCapabilityLockoutCounter(OUT UINT32 *LockoutCounter)