mirror of https://github.com/acidanthera/audk.git
SecurityPkg Tcg2Dxe: Get correct digest list size
Current code uses GetDigestListSize(DigestList) to get digest list size, that is incorrect. The code should get digest list size of digests copied into event2 log, those digests are compacted, so GetDigestListBinSize() should be used. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
parent
ab5b1f31c2
commit
a9f1b2e2d7
|
@ -974,6 +974,7 @@ TcgDxeLogHashEvent (
|
||||||
EFI_STATUS RetStatus;
|
EFI_STATUS RetStatus;
|
||||||
TCG_PCR_EVENT2 TcgPcrEvent2;
|
TCG_PCR_EVENT2 TcgPcrEvent2;
|
||||||
UINT8 *DigestBuffer;
|
UINT8 *DigestBuffer;
|
||||||
|
UINT32 *EventSizePtr;
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "SupportedEventLogs - 0x%08x\n", mTcgDxeData.BsCap.SupportedEventLogs));
|
DEBUG ((EFI_D_INFO, "SupportedEventLogs - 0x%08x\n", mTcgDxeData.BsCap.SupportedEventLogs));
|
||||||
|
|
||||||
|
@ -1010,9 +1011,8 @@ TcgDxeLogHashEvent (
|
||||||
TcgPcrEvent2.PCRIndex = NewEventHdr->PCRIndex;
|
TcgPcrEvent2.PCRIndex = NewEventHdr->PCRIndex;
|
||||||
TcgPcrEvent2.EventType = NewEventHdr->EventType;
|
TcgPcrEvent2.EventType = NewEventHdr->EventType;
|
||||||
DigestBuffer = (UINT8 *)&TcgPcrEvent2.Digest;
|
DigestBuffer = (UINT8 *)&TcgPcrEvent2.Digest;
|
||||||
DigestBuffer = CopyDigestListToBuffer (DigestBuffer, DigestList, mTcgDxeData.BsCap.ActivePcrBanks);
|
EventSizePtr = CopyDigestListToBuffer (DigestBuffer, DigestList, mTcgDxeData.BsCap.ActivePcrBanks);
|
||||||
CopyMem (DigestBuffer, &NewEventHdr->EventSize, sizeof(NewEventHdr->EventSize));
|
CopyMem (EventSizePtr, &NewEventHdr->EventSize, sizeof(NewEventHdr->EventSize));
|
||||||
DigestBuffer = DigestBuffer + sizeof(NewEventHdr->EventSize);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Enter critical region
|
// Enter critical region
|
||||||
|
@ -1021,7 +1021,7 @@ TcgDxeLogHashEvent (
|
||||||
Status = TcgDxeLogEvent (
|
Status = TcgDxeLogEvent (
|
||||||
mTcg2EventInfo[Index].LogFormat,
|
mTcg2EventInfo[Index].LogFormat,
|
||||||
&TcgPcrEvent2,
|
&TcgPcrEvent2,
|
||||||
sizeof(TcgPcrEvent2.PCRIndex) + sizeof(TcgPcrEvent2.EventType) + GetDigestListSize (DigestList) + sizeof(TcgPcrEvent2.EventSize),
|
sizeof(TcgPcrEvent2.PCRIndex) + sizeof(TcgPcrEvent2.EventType) + GetDigestListBinSize (DigestBuffer) + sizeof(TcgPcrEvent2.EventSize),
|
||||||
NewEventData,
|
NewEventData,
|
||||||
NewEventHdr->EventSize
|
NewEventHdr->EventSize
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue