diff --git a/OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c b/OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c index 5287cda4d0..8547c76d4c 100644 --- a/OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c +++ b/OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c @@ -806,6 +806,7 @@ TdGetEventLog ( @retval FALSE This is NOT a Tcg800155PlatformIdEvent. **/ +STATIC BOOLEAN Is800155Event ( IN VOID *NewEventHdr, @@ -814,18 +815,26 @@ Is800155Event ( IN UINT32 NewEventSize ) { - if ((((TCG_PCR_EVENT2_HDR *)NewEventHdr)->EventType == EV_NO_ACTION) && - (NewEventSize >= sizeof (TCG_Sp800_155_PlatformId_Event2)) && - ((CompareMem ( - NewEventData, - TCG_Sp800_155_PlatformId_Event2_SIGNATURE, - sizeof (TCG_Sp800_155_PlatformId_Event2_SIGNATURE) - 1 - ) == 0) || - (CompareMem ( - NewEventData, - TCG_Sp800_155_PlatformId_Event3_SIGNATURE, - sizeof (TCG_Sp800_155_PlatformId_Event3_SIGNATURE) - 1 - ) == 0))) + if (((TCG_PCR_EVENT2_HDR *)NewEventHdr)->EventType != EV_NO_ACTION) { + return FALSE; + } + + if ((NewEventSize >= sizeof (TCG_Sp800_155_PlatformId_Event2)) && + (CompareMem ( + NewEventData, + TCG_Sp800_155_PlatformId_Event2_SIGNATURE, + sizeof (TCG_Sp800_155_PlatformId_Event2_SIGNATURE) - 1 + ) == 0)) + { + return TRUE; + } + + if ((NewEventSize >= sizeof (TCG_Sp800_155_PlatformId_Event3)) && + (CompareMem ( + NewEventData, + TCG_Sp800_155_PlatformId_Event3_SIGNATURE, + sizeof (TCG_Sp800_155_PlatformId_Event3_SIGNATURE) - 1 + ) == 0)) { return TRUE; }