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_PCR_EXTEND_COMMAND |
struct | TPM2_PCR_EXTEND_RESPONSE |
struct | TPM2_PCR_EVENT_COMMAND |
struct | TPM2_PCR_EVENT_RESPONSE |
struct | TPM2_PCR_READ_COMMAND |
struct | TPM2_PCR_READ_RESPONSE |
struct | TPM2_PCR_ALLOCATE_COMMAND |
struct | TPM2_PCR_ALLOCATE_RESPONSE |
Functions | |
EFI_STATUS EFIAPI | Tpm2PcrExtend (IN TPMI_DH_PCR PcrHandle, IN TPML_DIGEST_VALUES *Digests) |
EFI_STATUS EFIAPI | Tpm2PcrEvent (IN TPMI_DH_PCR PcrHandle, IN TPM2B_EVENT *EventData, OUT TPML_DIGEST_VALUES *Digests) |
EFI_STATUS EFIAPI | Tpm2PcrRead (IN TPML_PCR_SELECTION *PcrSelectionIn, OUT UINT32 *PcrUpdateCounter, OUT TPML_PCR_SELECTION *PcrSelectionOut, OUT TPML_DIGEST *PcrValues) |
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 | Tpm2PcrAllocateBanks (IN TPM2B_AUTH *PlatformAuth OPTIONAL, IN UINT32 SupportedPCRBanks, IN UINT32 PCRBanks) |
EFI_STATUS EFIAPI | Tpm2PcrReadForActiveBank (IN TPMI_DH_PCR PcrHandle, OUT TPML_DIGEST *HashList) |
Implement TPM2 Integrity related command.
Copyright (c) 2013 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Tpm2Integrity.c.
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 | ||
) |
This command is used to set the desired PCR allocation of PCR and algorithms.
[in] | AuthHandle | TPM_RH_PLATFORM+{PP} |
[in] | AuthSession | Auth Session context |
[in] | PcrAllocation | The requested allocation |
[out] | AllocationSuccess | YES if the allocation succeeded |
[out] | MaxPCR | maximum number of PCR that may be in a bank |
[out] | SizeNeeded | number of octets required to satisfy the request |
[out] | SizeAvailable | Number of octets available. Computed before the allocation |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 475 of file Tpm2Integrity.c.
EFI_STATUS EFIAPI Tpm2PcrAllocateBanks | ( | IN TPM2B_AUTH *PlatformAuth | OPTIONAL, |
IN UINT32 | SupportedPCRBanks, | ||
IN UINT32 | PCRBanks | ||
) |
Alloc PCR data.
[in] | PlatformAuth | platform auth value. NULL means no platform auth change. |
[in] | SupportedPCRBanks | Supported PCR banks |
[in] | PCRBanks | PCR banks |
EFI_SUCCESS | Operation completed successfully. |
Definition at line 598 of file Tpm2Integrity.c.
EFI_STATUS EFIAPI Tpm2PcrEvent | ( | IN TPMI_DH_PCR | PcrHandle, |
IN TPM2B_EVENT * | EventData, | ||
OUT TPML_DIGEST_VALUES * | Digests | ||
) |
This command is used to cause an update to the indicated PCR. The data in eventData is hashed using the hash algorithm associated with each bank in which the indicated PCR has been allocated. After the data is hashed, the digests list is returned. If the pcrHandle references an implemented PCR and not TPM_ALG_NULL, digests list is processed as in TPM2_PCR_Extend(). A TPM shall support an Event.size of zero through 1,024 inclusive.
[in] | PcrHandle | Handle of the PCR |
[in] | EventData | Event data in sized buffer |
[out] | Digests | List of digest |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | Unexpected device behavior. |
Definition at line 223 of file Tpm2Integrity.c.
EFI_STATUS EFIAPI Tpm2PcrExtend | ( | IN TPMI_DH_PCR | PcrHandle, |
IN TPML_DIGEST_VALUES * | Digests | ||
) |
This command is used to cause an update to the indicated PCR. The digests parameter contains one or more tagged digest value identified by an algorithm ID. For each digest, the PCR associated with pcrHandle is Extended into the bank identified by the tag (hashAlg).
[in] | PcrHandle | Handle of the PCR |
[in] | Digests | List of tagged digest values to be extended |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | Unexpected device behavior. |
Definition at line 92 of file Tpm2Integrity.c.
EFI_STATUS EFIAPI Tpm2PcrRead | ( | IN TPML_PCR_SELECTION * | PcrSelectionIn, |
OUT UINT32 * | PcrUpdateCounter, | ||
OUT TPML_PCR_SELECTION * | PcrSelectionOut, | ||
OUT TPML_DIGEST * | PcrValues | ||
) |
This command returns the values of all PCR specified in pcrSelect.
[in] | PcrSelectionIn | The selection of PCR to read. |
[out] | PcrUpdateCounter | The current value of the PCR update counter. |
[out] | PcrSelectionOut | The PCR in the returned list. |
[out] | PcrValues | The contents of the PCR indicated in pcrSelect. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 337 of file Tpm2Integrity.c.
EFI_STATUS EFIAPI Tpm2PcrReadForActiveBank | ( | IN TPMI_DH_PCR | PcrHandle, |
OUT TPML_DIGEST * | HashList | ||
) |
This function will query the TPM to determine which hashing algorithms and get the digests of all active and supported PCR banks of a specific PCR register.
[in] | PcrHandle | The index of the PCR register to be read. |
[out] | HashList | List of digests from PCR register being read. |
EFI_SUCCESS | The Pcr was read successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Definition at line 743 of file Tpm2Integrity.c.