summaryrefslogtreecommitdiff
path: root/SecurityPkg/Include
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2016-09-14 16:28:12 +0800
committerStar Zeng <star.zeng@intel.com>2016-09-21 18:20:20 +0800
commit07cdba18cd974d818556d752facfbf35a8d0f012 (patch)
treef53d4f401040ab6b3da86b049f3e31a7da9aef01 /SecurityPkg/Include
parentf5e34e37e018034bc8ce7a2fb9ecb176d948b143 (diff)
downloadedk2-platforms-07cdba18cd974d818556d752facfbf35a8d0f012.tar.xz
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>
Diffstat (limited to 'SecurityPkg/Include')
-rw-r--r--SecurityPkg/Include/Library/Tpm2CommandLib.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/SecurityPkg/Include/Library/Tpm2CommandLib.h b/SecurityPkg/Include/Library/Tpm2CommandLib.h
index 825ffc37a4..9a1dd8d8ac 100644
--- a/SecurityPkg/Include/Library/Tpm2CommandLib.h
+++ b/SecurityPkg/Include/Library/Tpm2CommandLib.h
@@ -763,6 +763,24 @@ Tpm2GetCapabilityPcrs (
);
/**
+ 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.
This function parse the value got from TPM2_GetCapability and return the AlgorithmSet.