62 Status =
gBS->LocateProtocol (&gEfiTcgProtocolGuid,
NULL, (VOID **)&TcgProtocol);
63 if (EFI_ERROR (Status)) {
68 if (TcgEvent ==
NULL) {
69 return EFI_OUT_OF_RESOURCES;
77 Status = TcgProtocol->HashLogExtendEvent (
115 IN UINT64 HashDataLen
125 Status =
gBS->LocateProtocol (&gEfiTcg2ProtocolGuid,
NULL, (VOID **)&Tcg2Protocol);
126 if (EFI_ERROR (Status)) {
131 if (Tcg2Event ==
NULL) {
132 return EFI_OUT_OF_RESOURCES;
135 Tcg2Event->Size = (UINT32)LogLen +
sizeof (
EFI_TCG2_EVENT) -
sizeof (Tcg2Event->Event);
137 Tcg2Event->Header.HeaderVersion = EFI_TCG2_EVENT_HEADER_VERSION;
138 Tcg2Event->Header.PCRIndex = PcrIndex;
139 Tcg2Event->Header.EventType = EventType;
140 CopyMem (&Tcg2Event->Event[0], EventLog, LogLen);
142 Status = Tcg2Protocol->HashLogExtendEvent (
181 IN UINT64 HashDataLen
186 EFI_CC_MR_INDEX MrIndex;
188 if (CcProtocol ==
NULL) {
189 return EFI_INVALID_PARAMETER;
192 Status = CcProtocol->MapPcrToMrIndex (CcProtocol, PcrIndex, &MrIndex);
193 if (EFI_ERROR (Status)) {
198 if (EfiCcEvent ==
NULL) {
199 return EFI_OUT_OF_RESOURCES;
202 EfiCcEvent->Size = (UINT32)LogLen +
sizeof (
EFI_CC_EVENT) -
sizeof (EfiCcEvent->Event);
204 EfiCcEvent->Header.HeaderVersion = EFI_CC_EVENT_HEADER_VERSION;
205 EfiCcEvent->Header.MrIndex = MrIndex;
206 EfiCcEvent->Header.EventType = EventType;
207 CopyMem (&EfiCcEvent->Event[0], EventLog, LogLen);
209 Status = CcProtocol->HashLogExtendEvent (
244 IN UINT64 HashDataLen
250 Status =
gBS->LocateProtocol (&gEfiCcMeasurementProtocolGuid,
NULL, (VOID **)&CcProtocol);
251 if (!EFI_ERROR (Status)) {
277 if (EFI_ERROR (Status)) {
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
STATIC EFI_STATUS CcMeasureAndLogData(IN EFI_CC_MEASUREMENT_PROTOCOL *CcProtocol, IN UINT32 PcrIndex, IN UINT32 EventType, IN VOID *EventLog, IN UINT32 LogLen, IN VOID *HashData, IN UINT64 HashDataLen)
EFI_STATUS EFIAPI TpmMeasureAndLogData(IN UINT32 PcrIndex, IN UINT32 EventType, IN VOID *EventLog, IN UINT32 LogLen, IN VOID *HashData, IN UINT64 HashDataLen)
STATIC EFI_STATUS Tpm20MeasureAndLogData(IN UINT32 PcrIndex, IN UINT32 EventType, IN VOID *EventLog, IN UINT32 LogLen, IN VOID *HashData, IN UINT64 HashDataLen)
STATIC EFI_STATUS Tpm12MeasureAndLogData(IN UINT32 PcrIndex, IN UINT32 EventType, IN VOID *EventLog, IN UINT32 LogLen, IN VOID *HashData, IN UINT64 HashDataLen)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define TPM_ALG_SHA
The SHA1 algorithm.
UINT64 EFI_PHYSICAL_ADDRESS
UINT8 Event[1]
The event data.
UINT32 EventSize
Size of the event data.
TCG_EVENTTYPE EventType
TCG EFI event type.
TCG_PCRINDEX PCRIndex
PCRIndex event extended to.