From f5e34e37e018034bc8ce7a2fb9ecb176d948b143 Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Wed, 14 Sep 2016 10:45:19 +0800 Subject: SecurityPkg/TPM2: Move CopyDigestListToBuffer() to Tpm2CommandLib This patch just moves function CopyDigestListToBuffer() from drivers to library with HashAlgorithmMask parameter added to make the interface more applicable. The related function IsHashAlgSupportedInHashAlgorithmMask() is also moved from drivers to library as internal function. Cc: Chao B Zhang Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao Signed-off-by: Star Zeng Reviewed-by: Chao Zhang --- SecurityPkg/Include/Library/Tpm2CommandLib.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'SecurityPkg/Include') diff --git a/SecurityPkg/Include/Library/Tpm2CommandLib.h b/SecurityPkg/Include/Library/Tpm2CommandLib.h index 563cfc26e3..825ffc37a4 100644 --- a/SecurityPkg/Include/Library/Tpm2CommandLib.h +++ b/SecurityPkg/Include/Library/Tpm2CommandLib.h @@ -988,6 +988,23 @@ GetHashSizeFromAlgo ( IN TPMI_ALG_HASH HashAlgo ); +/** + Copy TPML_DIGEST_VALUES into a buffer + + @param[in,out] Buffer Buffer to hold TPML_DIGEST_VALUES. + @param[in] DigestList TPML_DIGEST_VALUES to be copied. + @param[in] HashAlgorithmMask HASH bits corresponding to the desired digests to copy. + + @return The end of buffer to hold TPML_DIGEST_VALUES. +**/ +VOID * +EFIAPI +CopyDigestListToBuffer( + IN OUT VOID *Buffer, + IN TPML_DIGEST_VALUES *DigestList, + IN UINT32 HashAlgorithmMask + ); + /** Get TPML_DIGEST_VALUES data size. -- cgit v1.2.3