SecurityPkg/TPM2: Extract GetSupportedAndActivePcrs to Tpm2CommandLib
This patch extracts function Tpm2GetCapabilitySupportedAndActivePcrs() from drivers and also update Tcg2ExecutePhysicalPresence() to call Tpm2GetCapabilitySupportedAndActivePcrs() instead of Tcg2Protocol->GetCapability to query the TPM to determine which hashing algorithms are supported. Cc: Chao B Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
This commit is contained in:
@@ -762,6 +762,24 @@ Tpm2GetCapabilityPcrs (
|
||||
OUT TPML_PCR_SELECTION *Pcrs
|
||||
);
|
||||
|
||||
/**
|
||||
This function will query the TPM to determine which hashing algorithms
|
||||
are supported and which PCR banks are currently active.
|
||||
|
||||
@param[out] TpmHashAlgorithmBitmap A bitmask containing the algorithms supported by the TPM.
|
||||
@param[out] ActivePcrBanks A bitmask containing the PCRs currently allocated.
|
||||
|
||||
@retval EFI_SUCCESS TPM was successfully queried and return values can be trusted.
|
||||
@retval Others An error occurred, likely in communication with the TPM.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
Tpm2GetCapabilitySupportedAndActivePcrs(
|
||||
OUT UINT32 *TpmHashAlgorithmBitmap,
|
||||
OUT UINT32 *ActivePcrBanks
|
||||
);
|
||||
|
||||
/**
|
||||
This command returns the information of TPM AlgorithmSet.
|
||||
|
||||
|
Reference in New Issue
Block a user