TianoCore EDK2 master
Loading...
Searching...
No Matches
Tpm2Capability.c File Reference

Go to the source code of this file.

Data Structures

struct  TPM2_GET_CAPABILITY_COMMAND
 
struct  TPM2_GET_CAPABILITY_RESPONSE
 
struct  TPM2_TEST_PARMS_COMMAND
 
struct  TPM2_TEST_PARMS_RESPONSE
 

Macros

#define TPMA_CC_COMMANDINDEX_MASK   0x2000FFFF
 

Functions

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 Tpm2GetCapabilityFamily (OUT CHAR8 *Family)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityManufactureID (OUT UINT32 *ManufactureId)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityFirmwareVersion (OUT UINT32 *FirmwareVersion1, OUT UINT32 *FirmwareVersion2)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityMaxCommandResponseSize (OUT UINT32 *MaxCommandSize, OUT UINT32 *MaxResponseSize)
 
EFI_STATUS EFIAPI Tpm2GetCapabilitySupportedAlg (OUT TPML_ALG_PROPERTY *AlgList)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityLockoutCounter (OUT UINT32 *LockoutCounter)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityLockoutInterval (OUT UINT32 *LockoutInterval)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityInputBufferSize (OUT UINT32 *InputBufferSize)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityPcrs (OUT TPML_PCR_SELECTION *Pcrs)
 
EFI_STATUS EFIAPI Tpm2GetCapabilitySupportedAndActivePcrs (OUT UINT32 *TpmHashAlgorithmBitmap, OUT UINT32 *ActivePcrBanks)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityAlgorithmSet (OUT UINT32 *AlgorithmSet)
 
EFI_STATUS EFIAPI Tpm2GetCapabilityIsCommandImplemented (IN TPM_CC Command, OUT BOOLEAN *IsCmdImpl)
 
EFI_STATUS EFIAPI Tpm2TestParms (IN TPMT_PUBLIC_PARMS *Parameters)
 

Detailed Description

Implement TPM2 Capability related command.

Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Tpm2Capability.c.

Macro Definition Documentation

◆ TPMA_CC_COMMANDINDEX_MASK

#define TPMA_CC_COMMANDINDEX_MASK   0x2000FFFF

Definition at line 42 of file Tpm2Capability.c.

Function Documentation

◆ Tpm2GetCapability()

EFI_STATUS EFIAPI Tpm2GetCapability ( IN TPM_CAP  Capability,
IN UINT32  Property,
IN UINT32  PropertyCount,
OUT TPMI_YES_NO *  MoreData,
OUT TPMS_CAPABILITY_DATA CapabilityData 
)

This command returns various information regarding the TPM and its current state.

The capability parameter determines the category of data returned. The property parameter selects the first value of the selected category to be returned. If there is no property that corresponds to the value of property, the next higher value is returned, if it exists. The moreData parameter will have a value of YES if there are more values of the requested type that were not returned. If no next capability exists, the TPM will return a zero-length list and moreData will have a value of NO.

NOTE: To simplify this function, leave returned CapabilityData for caller to unpack since there are many capability categories and only few categories will be used in firmware. It means the caller need swap the byte order for the fields in CapabilityData.

Parameters
[in]CapabilityGroup selection; determines the format of the response.
[in]PropertyFurther definition of information.
[in]PropertyCountNumber of properties of the indicated type to return.
[out]MoreDataFlag to indicate if there are more values of this type.
[out]CapabilityDataThe capability data.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 71 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityAlgorithmSet()

EFI_STATUS EFIAPI Tpm2GetCapabilityAlgorithmSet ( OUT UINT32 *  AlgorithmSet)

This command returns the information of TPM AlgorithmSet.

This function parse the value got from TPM2_GetCapability and return the AlgorithmSet.

Parameters
[out]AlgorithmSetThe AlgorithmSet of TPM.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 635 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityFamily()

EFI_STATUS EFIAPI Tpm2GetCapabilityFamily ( OUT CHAR8 *  Family)

This command returns the information of TPM Family.

This function parse the value got from TPM2_GetCapability and return the Family.

Parameters
[out]FamilyThe Family of TPM. (a 4-octet character string)
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 143 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityFirmwareVersion()

EFI_STATUS EFIAPI Tpm2GetCapabilityFirmwareVersion ( OUT UINT32 *  FirmwareVersion1,
OUT UINT32 *  FirmwareVersion2 
)

This command returns the information of TPM FirmwareVersion.

This function parse the value got from TPM2_GetCapability and return the TPM FirmwareVersion.

Parameters
[out]FirmwareVersion1The FirmwareVersion1.
[out]FirmwareVersion2The FirmwareVersion2.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 216 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityInputBufferSize()

EFI_STATUS EFIAPI Tpm2GetCapabilityInputBufferSize ( OUT UINT32 *  InputBufferSize)

This command returns the information of TPM InputBufferSize.

This function parse the value got from TPM2_GetCapability and return the InputBufferSize.

Parameters
[out]InputBufferSizeThe InputBufferSize of TPM. the maximum size of a parameter (typically, a TPM2B_MAX_BUFFER)
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 438 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityIsCommandImplemented()

EFI_STATUS EFIAPI Tpm2GetCapabilityIsCommandImplemented ( IN TPM_CC  Command,
OUT BOOLEAN *  IsCmdImpl 
)

This function will query if the command is supported.

Parameters
[In]Command TPM_CC command starts from TPM_CC_FIRST.
[out]IsCmdImplThe command is supported or not.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 670 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityLockoutCounter()

EFI_STATUS EFIAPI Tpm2GetCapabilityLockoutCounter ( OUT UINT32 *  LockoutCounter)

This command returns the information of TPM LockoutCounter.

This function parse the value got from TPM2_GetCapability and return the LockoutCounter.

Parameters
[out]LockoutCounterThe LockoutCounter of TPM.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 365 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityLockoutInterval()

EFI_STATUS EFIAPI Tpm2GetCapabilityLockoutInterval ( OUT UINT32 *  LockoutInterval)

This command returns the information of TPM LockoutInterval.

This function parse the value got from TPM2_GetCapability and return the LockoutInterval.

Parameters
[out]LockoutIntervalThe LockoutInterval of TPM.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 401 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityManufactureID()

EFI_STATUS EFIAPI Tpm2GetCapabilityManufactureID ( OUT UINT32 *  ManufactureId)

This command returns the information of TPM manufacture ID.

This function parse the value got from TPM2_GetCapability and return the TPM manufacture ID.

Parameters
[out]ManufactureIdThe manufacture ID of TPM.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 179 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityMaxCommandResponseSize()

EFI_STATUS EFIAPI Tpm2GetCapabilityMaxCommandResponseSize ( OUT UINT32 *  MaxCommandSize,
OUT UINT32 *  MaxResponseSize 
)

This command returns the information of the maximum value for commandSize and responseSize in a command.

This function parse the value got from TPM2_GetCapability and return the max command size and response size

Parameters
[out]MaxCommandSizeThe maximum value for commandSize in a command.
[out]MaxResponseSizeThe maximum value for responseSize in a command.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 267 of file Tpm2Capability.c.

◆ Tpm2GetCapabilityPcrs()

EFI_STATUS EFIAPI Tpm2GetCapabilityPcrs ( OUT TPML_PCR_SELECTION Pcrs)

This command returns the information of TPM PCRs.

This function parse the value got from TPM2_GetCapability and return the PcrSelection.

Parameters
[out]PcrsThe Pcr Selection
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 474 of file Tpm2Capability.c.

◆ Tpm2GetCapabilitySupportedAlg()

EFI_STATUS EFIAPI Tpm2GetCapabilitySupportedAlg ( OUT TPML_ALG_PROPERTY AlgList)

This command returns Returns a list of TPMS_ALG_PROPERTIES. Each entry is an algorithm ID and a set of properties of the algorithm.

This function parse the value got from TPM2_GetCapability and return the list.

Parameters
[out]AlgListList of algorithm.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 317 of file Tpm2Capability.c.

◆ Tpm2GetCapabilitySupportedAndActivePcrs()

EFI_STATUS EFIAPI Tpm2GetCapabilitySupportedAndActivePcrs ( OUT UINT32 *  TpmHashAlgorithmBitmap,
OUT UINT32 *  ActivePcrBanks 
)

This function will query the TPM to determine which hashing algorithms are supported and which PCR banks are currently active.

Parameters
[out]TpmHashAlgorithmBitmapA bitmask containing the algorithms supported by the TPM.
[out]ActivePcrBanksA bitmask containing the PCRs currently allocated.
Return values
EFI_SUCCESSTPM was successfully queried and return values can be trusted.
OthersAn error occurred, likely in communication with the TPM.

Definition at line 527 of file Tpm2Capability.c.

◆ Tpm2TestParms()

EFI_STATUS EFIAPI Tpm2TestParms ( IN TPMT_PUBLIC_PARMS Parameters)

This command is used to check to see if specific combinations of algorithm parameters are supported.

Parameters
[in]ParametersAlgorithm parameters to be validated
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 707 of file Tpm2Capability.c.