TianoCore EDK2 master
|
#include <IndustryStandard/UefiTcgPlatform.h>
#include <Library/Tpm2CommandLib.h>
#include <Library/Tpm2DeviceLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
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 |
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.
#define TPMA_CC_COMMANDINDEX_MASK 0x2000FFFF |
Definition at line 42 of file Tpm2Capability.c.
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.
[in] | Capability | Group selection; determines the format of the response. |
[in] | Property | Further definition of information. |
[in] | PropertyCount | Number of properties of the indicated type to return. |
[out] | MoreData | Flag to indicate if there are more values of this type. |
[out] | CapabilityData | The capability data. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 71 of file Tpm2Capability.c.
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.
[out] | AlgorithmSet | The AlgorithmSet of TPM. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 635 of file Tpm2Capability.c.
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.
[out] | Family | The Family of TPM. (a 4-octet character string) |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 143 of file Tpm2Capability.c.
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.
[out] | FirmwareVersion1 | The FirmwareVersion1. |
[out] | FirmwareVersion2 | The FirmwareVersion2. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 216 of file Tpm2Capability.c.
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.
[out] | InputBufferSize | The InputBufferSize of TPM. the maximum size of a parameter (typically, a TPM2B_MAX_BUFFER) |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 438 of file Tpm2Capability.c.
EFI_STATUS EFIAPI Tpm2GetCapabilityIsCommandImplemented | ( | IN TPM_CC | Command, |
OUT BOOLEAN * | IsCmdImpl | ||
) |
This function will query if the command is supported.
[In] | Command TPM_CC command starts from TPM_CC_FIRST. | |
[out] | IsCmdImpl | The command is supported or not. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 670 of file Tpm2Capability.c.
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.
[out] | LockoutCounter | The LockoutCounter of TPM. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 365 of file Tpm2Capability.c.
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.
[out] | LockoutInterval | The LockoutInterval of TPM. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 401 of file Tpm2Capability.c.
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.
[out] | ManufactureId | The manufacture ID of TPM. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 179 of file Tpm2Capability.c.
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
[out] | MaxCommandSize | The maximum value for commandSize in a command. |
[out] | MaxResponseSize | The maximum value for responseSize in a command. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 267 of file Tpm2Capability.c.
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.
[out] | Pcrs | The Pcr Selection |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 474 of file Tpm2Capability.c.
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.
[out] | AlgList | List of algorithm. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 317 of file Tpm2Capability.c.
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.
[out] | TpmHashAlgorithmBitmap | A bitmask containing the algorithms supported by the TPM. |
[out] | ActivePcrBanks | A bitmask containing the PCRs currently allocated. |
EFI_SUCCESS | TPM was successfully queried and return values can be trusted. |
Others | An error occurred, likely in communication with the TPM. |
Definition at line 527 of file Tpm2Capability.c.
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.
[in] | Parameters | Algorithm parameters to be validated |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | Unexpected device behavior. |
Definition at line 707 of file Tpm2Capability.c.