From d4b9b2c32cb38c8aefed52de12368ba644dfb0b5 Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Tue, 13 Sep 2016 19:05:08 +0800 Subject: SecurityPkg/TPM2: Move GetDigestFromDigestList() to Tpm2CommandLib This patch just moves function Tpm2GetDigestFromDigestList() from drivers to library as GetDigestFromDigestList() and no functionality change. 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/Tcg/TrEEDxe/TrEEDxe.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c') diff --git a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c index ecafc12efe..fb69fa1860 100644 --- a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c +++ b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c @@ -624,41 +624,6 @@ TcgDxeLogEvent ( return Status; } -/** - This function get digest from digest list. - - @param HashAlg digest algorithm - @param DigestList digest list - @param Digest digest - - @retval EFI_SUCCESS Sha1Digest is found and returned. - @retval EFI_NOT_FOUND Sha1Digest is not found. -**/ -EFI_STATUS -Tpm2GetDigestFromDigestList ( - IN TPMI_ALG_HASH HashAlg, - IN TPML_DIGEST_VALUES *DigestList, - IN VOID *Digest - ) -{ - UINTN Index; - UINT16 DigestSize; - - DigestSize = GetHashSizeFromAlgo (HashAlg); - for (Index = 0; Index < DigestList->count; Index++) { - if (DigestList->digests[Index].hashAlg == HashAlg) { - CopyMem ( - Digest, - &DigestList->digests[Index].digest, - DigestSize - ); - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} - /** Add a new entry to the Event Log. @@ -686,7 +651,7 @@ TcgDxeLogHashEvent ( DEBUG ((EFI_D_INFO, " LogFormat - 0x%08x\n", mTreeEventInfo[Index].LogFormat)); switch (mTreeEventInfo[Index].LogFormat) { case TREE_EVENT_LOG_FORMAT_TCG_1_2: - Status = Tpm2GetDigestFromDigestList (TPM_ALG_SHA1, DigestList, &NewEventHdr->Digest); + Status = GetDigestFromDigestList (TPM_ALG_SHA1, DigestList, &NewEventHdr->Digest); if (!EFI_ERROR (Status)) { // // Enter critical region -- cgit v1.2.3