X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=SecurityPkg%2FTcg%2FTrEEDxe%2FTrEEDxe.c;h=fb69fa1860e86320786c62f2c6606b09dc6bd03e;hb=d4b9b2c32cb38c8aefed52de12368ba644dfb0b5;hp=a30cd5161d40210ac297124bd13be644c5b52ad1;hpb=87f66b63d409fde7d2ea018b65a63986ba413f1f;p=mirror_edk2.git diff --git a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c index a30cd5161d..fb69fa1860 100644 --- a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c +++ b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c @@ -179,6 +179,8 @@ EFI_HANDLE mImageHandle; PE/COFF image is external input, so this function will validate its data structure within this image buffer before use. + Notes: PE/COFF image is checked by BasePeCoffLib PeCoffLoaderGetImageInfo(). + @param[in] PCRIndex TPM PCR index @param[in] ImageAddress Start address of image buffer. @param[in] ImageSize Image size @@ -622,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. @@ -684,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