2 The library instance provides security service of TPM2 measure boot.
4 Caution: This file requires additional review when modified.
5 This library will have external input - PE/COFF image and GPT partition.
6 This external input must be validated carefully to avoid security issue like
7 buffer overflow, integer overflow.
9 DxeTpm2MeasureBootLibImageRead() function will make sure the PE/COFF image content
10 read is within the image buffer.
12 Tcg2MeasurePeImage() function will accept untrusted PE/COFF image and validate its
13 data structure within this image buffer before use.
15 Tcg2MeasureGptTable() function will receive untrusted GPT partition table, and parse
16 partition data carefully.
18 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
19 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
20 SPDX-License-Identifier: BSD-2-Clause-Patent
26 #include <Protocol/Tcg2Protocol.h>
27 #include <Protocol/BlockIo.h>
28 #include <Protocol/DiskIo.h>
29 #include <Protocol/DevicePathToText.h>
30 #include <Protocol/FirmwareVolumeBlock.h>
32 #include <Guid/MeasuredFvHob.h>
34 #include <Library/BaseLib.h>
35 #include <Library/DebugLib.h>
36 #include <Library/BaseMemoryLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/DevicePathLib.h>
39 #include <Library/UefiBootServicesTableLib.h>
40 #include <Library/BaseCryptLib.h>
41 #include <Library/PeCoffLib.h>
42 #include <Library/SecurityManagementLib.h>
43 #include <Library/HobLib.h>
46 // Flag to check GPT partition. It only need be measured once.
48 BOOLEAN mTcg2MeasureGptTableFlag
= FALSE
;
49 UINTN mTcg2MeasureGptCount
= 0;
50 VOID
*mTcg2FileBuffer
;
53 // Measured FV handle cache
55 EFI_HANDLE mTcg2CacheMeasuredHandle
= NULL
;
56 MEASURED_HOB_DATA
*mTcg2MeasuredHobData
= NULL
;
59 Reads contents of a PE/COFF image in memory buffer.
61 Caution: This function may receive untrusted input.
62 PE/COFF image is external input, so this function will make sure the PE/COFF image content
63 read is within the image buffer.
65 @param FileHandle Pointer to the file handle to read the PE/COFF image.
66 @param FileOffset Offset into the PE/COFF image to begin the read operation.
67 @param ReadSize On input, the size in bytes of the requested read operation.
68 On output, the number of bytes actually read.
69 @param Buffer Output buffer that contains the data read from the PE/COFF image.
71 @retval EFI_SUCCESS The specified portion of the PE/COFF image was read and the size
75 DxeTpm2MeasureBootLibImageRead (
78 IN OUT UINTN
*ReadSize
,
84 if (FileHandle
== NULL
|| ReadSize
== NULL
|| Buffer
== NULL
) {
85 return EFI_INVALID_PARAMETER
;
88 if (MAX_ADDRESS
- FileOffset
< *ReadSize
) {
89 return EFI_INVALID_PARAMETER
;
92 EndPosition
= FileOffset
+ *ReadSize
;
93 if (EndPosition
> mTcg2ImageSize
) {
94 *ReadSize
= (UINT32
)(mTcg2ImageSize
- FileOffset
);
97 if (FileOffset
>= mTcg2ImageSize
) {
101 CopyMem (Buffer
, (UINT8
*)((UINTN
) FileHandle
+ FileOffset
), *ReadSize
);
107 Measure GPT table data into TPM log.
109 Caution: This function may receive untrusted input.
110 The GPT partition table is external input, so this function should parse partition data carefully.
112 @param Tcg2Protocol Pointer to the located TCG2 protocol instance.
113 @param GptHandle Handle that GPT partition was installed.
115 @retval EFI_SUCCESS Successfully measure GPT table.
116 @retval EFI_UNSUPPORTED Not support GPT table on the given handle.
117 @retval EFI_DEVICE_ERROR Can't get GPT table because device error.
118 @retval EFI_OUT_OF_RESOURCES No enough resource to measure GPT table.
119 @retval other error value
123 Tcg2MeasureGptTable (
124 IN EFI_TCG2_PROTOCOL
*Tcg2Protocol
,
125 IN EFI_HANDLE GptHandle
129 EFI_BLOCK_IO_PROTOCOL
*BlockIo
;
130 EFI_DISK_IO_PROTOCOL
*DiskIo
;
131 EFI_PARTITION_TABLE_HEADER
*PrimaryHeader
;
132 EFI_PARTITION_ENTRY
*PartitionEntry
;
134 UINTN NumberOfPartition
;
136 EFI_TCG2_EVENT
*Tcg2Event
;
137 EFI_GPT_DATA
*GptData
;
140 if (mTcg2MeasureGptCount
> 0) {
144 Status
= gBS
->HandleProtocol (GptHandle
, &gEfiBlockIoProtocolGuid
, (VOID
**)&BlockIo
);
145 if (EFI_ERROR (Status
)) {
146 return EFI_UNSUPPORTED
;
148 Status
= gBS
->HandleProtocol (GptHandle
, &gEfiDiskIoProtocolGuid
, (VOID
**)&DiskIo
);
149 if (EFI_ERROR (Status
)) {
150 return EFI_UNSUPPORTED
;
153 // Read the EFI Partition Table Header
155 PrimaryHeader
= (EFI_PARTITION_TABLE_HEADER
*) AllocatePool (BlockIo
->Media
->BlockSize
);
156 if (PrimaryHeader
== NULL
) {
157 return EFI_OUT_OF_RESOURCES
;
159 Status
= DiskIo
->ReadDisk (
161 BlockIo
->Media
->MediaId
,
162 1 * BlockIo
->Media
->BlockSize
,
163 BlockIo
->Media
->BlockSize
,
164 (UINT8
*)PrimaryHeader
166 if (EFI_ERROR (Status
)) {
167 DEBUG ((DEBUG_ERROR
, "Failed to Read Partition Table Header!\n"));
168 FreePool (PrimaryHeader
);
169 return EFI_DEVICE_ERROR
;
172 // Read the partition entry.
174 EntryPtr
= (UINT8
*)AllocatePool (PrimaryHeader
->NumberOfPartitionEntries
* PrimaryHeader
->SizeOfPartitionEntry
);
175 if (EntryPtr
== NULL
) {
176 FreePool (PrimaryHeader
);
177 return EFI_OUT_OF_RESOURCES
;
179 Status
= DiskIo
->ReadDisk (
181 BlockIo
->Media
->MediaId
,
182 MultU64x32(PrimaryHeader
->PartitionEntryLBA
, BlockIo
->Media
->BlockSize
),
183 PrimaryHeader
->NumberOfPartitionEntries
* PrimaryHeader
->SizeOfPartitionEntry
,
186 if (EFI_ERROR (Status
)) {
187 FreePool (PrimaryHeader
);
189 return EFI_DEVICE_ERROR
;
193 // Count the valid partition
195 PartitionEntry
= (EFI_PARTITION_ENTRY
*)EntryPtr
;
196 NumberOfPartition
= 0;
197 for (Index
= 0; Index
< PrimaryHeader
->NumberOfPartitionEntries
; Index
++) {
198 if (!IsZeroGuid (&PartitionEntry
->PartitionTypeGUID
)) {
201 PartitionEntry
= (EFI_PARTITION_ENTRY
*)((UINT8
*)PartitionEntry
+ PrimaryHeader
->SizeOfPartitionEntry
);
205 // Prepare Data for Measurement
207 EventSize
= (UINT32
)(sizeof (EFI_GPT_DATA
) - sizeof (GptData
->Partitions
)
208 + NumberOfPartition
* PrimaryHeader
->SizeOfPartitionEntry
);
209 Tcg2Event
= (EFI_TCG2_EVENT
*) AllocateZeroPool (EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
));
210 if (Tcg2Event
== NULL
) {
211 FreePool (PrimaryHeader
);
213 return EFI_OUT_OF_RESOURCES
;
216 Tcg2Event
->Size
= EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
);
217 Tcg2Event
->Header
.HeaderSize
= sizeof(EFI_TCG2_EVENT_HEADER
);
218 Tcg2Event
->Header
.HeaderVersion
= EFI_TCG2_EVENT_HEADER_VERSION
;
219 Tcg2Event
->Header
.PCRIndex
= 5;
220 Tcg2Event
->Header
.EventType
= EV_EFI_GPT_EVENT
;
221 GptData
= (EFI_GPT_DATA
*) Tcg2Event
->Event
;
224 // Copy the EFI_PARTITION_TABLE_HEADER and NumberOfPartition
226 CopyMem ((UINT8
*)GptData
, (UINT8
*)PrimaryHeader
, sizeof (EFI_PARTITION_TABLE_HEADER
));
227 GptData
->NumberOfPartitions
= NumberOfPartition
;
229 // Copy the valid partition entry
231 PartitionEntry
= (EFI_PARTITION_ENTRY
*)EntryPtr
;
232 NumberOfPartition
= 0;
233 for (Index
= 0; Index
< PrimaryHeader
->NumberOfPartitionEntries
; Index
++) {
234 if (!IsZeroGuid (&PartitionEntry
->PartitionTypeGUID
)) {
236 (UINT8
*)&GptData
->Partitions
+ NumberOfPartition
* PrimaryHeader
->SizeOfPartitionEntry
,
237 (UINT8
*)PartitionEntry
,
238 PrimaryHeader
->SizeOfPartitionEntry
242 PartitionEntry
=(EFI_PARTITION_ENTRY
*)((UINT8
*)PartitionEntry
+ PrimaryHeader
->SizeOfPartitionEntry
);
246 // Measure the GPT data
248 Status
= Tcg2Protocol
->HashLogExtendEvent (
251 (EFI_PHYSICAL_ADDRESS
) (UINTN
) (VOID
*) GptData
,
255 if (!EFI_ERROR (Status
)) {
256 mTcg2MeasureGptCount
++;
259 FreePool (PrimaryHeader
);
261 FreePool (Tcg2Event
);
267 Measure PE image into TPM log based on the authenticode image hashing in
268 PE/COFF Specification 8.0 Appendix A.
270 Caution: This function may receive untrusted input.
271 PE/COFF image is external input, so this function will validate its data structure
272 within this image buffer before use.
274 @param[in] Tcg2Protocol Pointer to the located TCG2 protocol instance.
275 @param[in] ImageAddress Start address of image buffer.
276 @param[in] ImageSize Image size
277 @param[in] LinkTimeBase Address that the image is loaded into memory.
278 @param[in] ImageType Image subsystem type.
279 @param[in] FilePath File path is corresponding to the input image.
281 @retval EFI_SUCCESS Successfully measure image.
282 @retval EFI_OUT_OF_RESOURCES No enough resource to measure image.
283 @retval EFI_UNSUPPORTED ImageType is unsupported or PE image is mal-format.
284 @retval other error value
290 IN EFI_TCG2_PROTOCOL
*Tcg2Protocol
,
291 IN EFI_PHYSICAL_ADDRESS ImageAddress
,
293 IN UINTN LinkTimeBase
,
295 IN EFI_DEVICE_PATH_PROTOCOL
*FilePath
299 EFI_TCG2_EVENT
*Tcg2Event
;
300 EFI_IMAGE_LOAD_EVENT
*ImageLoad
;
304 Status
= EFI_UNSUPPORTED
;
306 FilePathSize
= (UINT32
) GetDevicePathSize (FilePath
);
309 // Determine destination PCR by BootPolicy
311 EventSize
= sizeof (*ImageLoad
) - sizeof (ImageLoad
->DevicePath
) + FilePathSize
;
312 Tcg2Event
= AllocateZeroPool (EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
));
313 if (Tcg2Event
== NULL
) {
314 return EFI_OUT_OF_RESOURCES
;
317 Tcg2Event
->Size
= EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
);
318 Tcg2Event
->Header
.HeaderSize
= sizeof(EFI_TCG2_EVENT_HEADER
);
319 Tcg2Event
->Header
.HeaderVersion
= EFI_TCG2_EVENT_HEADER_VERSION
;
320 ImageLoad
= (EFI_IMAGE_LOAD_EVENT
*) Tcg2Event
->Event
;
323 case EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION
:
324 Tcg2Event
->Header
.EventType
= EV_EFI_BOOT_SERVICES_APPLICATION
;
325 Tcg2Event
->Header
.PCRIndex
= 4;
327 case EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
:
328 Tcg2Event
->Header
.EventType
= EV_EFI_BOOT_SERVICES_DRIVER
;
329 Tcg2Event
->Header
.PCRIndex
= 2;
331 case EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
:
332 Tcg2Event
->Header
.EventType
= EV_EFI_RUNTIME_SERVICES_DRIVER
;
333 Tcg2Event
->Header
.PCRIndex
= 2;
338 "Tcg2MeasurePeImage: Unknown subsystem type %d",
344 ImageLoad
->ImageLocationInMemory
= ImageAddress
;
345 ImageLoad
->ImageLengthInMemory
= ImageSize
;
346 ImageLoad
->ImageLinkTimeAddress
= LinkTimeBase
;
347 ImageLoad
->LengthOfDevicePath
= FilePathSize
;
348 if ((FilePath
!= NULL
) && (FilePathSize
!= 0)) {
349 CopyMem (ImageLoad
->DevicePath
, FilePath
, FilePathSize
);
355 Status
= Tcg2Protocol
->HashLogExtendEvent (
362 if (Status
== EFI_VOLUME_FULL
) {
364 // Volume full here means the image is hashed and its result is extended to PCR.
365 // But the event log can't be saved since log area is full.
366 // Just return EFI_SUCCESS in order not to block the image load.
368 Status
= EFI_SUCCESS
;
372 FreePool (Tcg2Event
);
378 The security handler is used to abstract platform-specific policy
379 from the DXE core response to an attempt to use a file that returns a
380 given status for the authentication check from the section extraction protocol.
382 The possible responses in a given SAP implementation may include locking
383 flash upon failure to authenticate, attestation logging for all signed drivers,
384 and other exception operations. The File parameter allows for possible logging
385 within the SAP of the driver.
387 If the file specified by File with an authentication status specified by
388 AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
390 If the file specified by File with an authentication status specified by
391 AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
392 then EFI_ACCESS_DENIED is returned.
394 If the file specified by File with an authentication status specified by
395 AuthenticationStatus is not safe for the DXE Core to use right now, but it
396 might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
399 If check image specified by FileBuffer and File is NULL meanwhile, return EFI_ACCESS_DENIED.
401 @param[in] AuthenticationStatus This is the authentication status returned
402 from the securitymeasurement services for the
404 @param[in] File This is a pointer to the device path of the file that is
405 being dispatched. This will optionally be used for logging.
406 @param[in] FileBuffer File buffer matches the input file device path.
407 @param[in] FileSize Size of File buffer matches the input file device path.
408 @param[in] BootPolicy A boot policy that was used to call LoadImage() UEFI service.
410 @retval EFI_SUCCESS The file specified by DevicePath and non-NULL
411 FileBuffer did authenticate, and the platform policy dictates
412 that the DXE Foundation may use the file.
413 @retval other error value
417 DxeTpm2MeasureBootHandler (
418 IN UINT32 AuthenticationStatus
,
419 IN CONST EFI_DEVICE_PATH_PROTOCOL
*File
, OPTIONAL
422 IN BOOLEAN BootPolicy
425 EFI_TCG2_PROTOCOL
*Tcg2Protocol
;
427 EFI_TCG2_BOOT_SERVICE_CAPABILITY ProtocolCapability
;
428 EFI_DEVICE_PATH_PROTOCOL
*DevicePathNode
;
429 EFI_DEVICE_PATH_PROTOCOL
*OrigDevicePathNode
;
431 EFI_HANDLE TempHandle
;
432 BOOLEAN ApplicationRequired
;
433 PE_COFF_LOADER_IMAGE_CONTEXT ImageContext
;
434 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*FvbProtocol
;
435 EFI_PHYSICAL_ADDRESS FvAddress
;
438 Status
= gBS
->LocateProtocol (&gEfiTcg2ProtocolGuid
, NULL
, (VOID
**) &Tcg2Protocol
);
439 if (EFI_ERROR (Status
)) {
441 // Tcg2 protocol is not installed. So, TPM2 is not present.
442 // Don't do any measurement, and directly return EFI_SUCCESS.
444 DEBUG ((DEBUG_VERBOSE
, "DxeTpm2MeasureBootHandler - Tcg2 - %r\n", Status
));
448 ProtocolCapability
.Size
= (UINT8
) sizeof (ProtocolCapability
);
449 Status
= Tcg2Protocol
->GetCapability (
453 if (EFI_ERROR (Status
) || (!ProtocolCapability
.TPMPresentFlag
)) {
455 // TPM device doesn't work or activate.
457 DEBUG ((DEBUG_ERROR
, "DxeTpm2MeasureBootHandler (%r) - TPMPresentFlag - %x\n", Status
, ProtocolCapability
.TPMPresentFlag
));
462 // Copy File Device Path
464 OrigDevicePathNode
= DuplicateDevicePath (File
);
467 // 1. Check whether this device path support BlockIo protocol.
468 // Is so, this device path may be a GPT device path.
470 DevicePathNode
= OrigDevicePathNode
;
471 Status
= gBS
->LocateDevicePath (&gEfiBlockIoProtocolGuid
, &DevicePathNode
, &Handle
);
472 if (!EFI_ERROR (Status
) && !mTcg2MeasureGptTableFlag
) {
474 // Find the gpt partition on the given devicepath
476 DevicePathNode
= OrigDevicePathNode
;
477 ASSERT (DevicePathNode
!= NULL
);
478 while (!IsDevicePathEnd (DevicePathNode
)) {
480 // Find the Gpt partition
482 if (DevicePathType (DevicePathNode
) == MEDIA_DEVICE_PATH
&&
483 DevicePathSubType (DevicePathNode
) == MEDIA_HARDDRIVE_DP
) {
485 // Check whether it is a gpt partition or not
487 if (((HARDDRIVE_DEVICE_PATH
*) DevicePathNode
)->MBRType
== MBR_TYPE_EFI_PARTITION_TABLE_HEADER
&&
488 ((HARDDRIVE_DEVICE_PATH
*) DevicePathNode
)->SignatureType
== SIGNATURE_TYPE_GUID
) {
491 // Change the partition device path to its parent device path (disk) and get the handle.
493 DevicePathNode
->Type
= END_DEVICE_PATH_TYPE
;
494 DevicePathNode
->SubType
= END_ENTIRE_DEVICE_PATH_SUBTYPE
;
495 DevicePathNode
= OrigDevicePathNode
;
496 Status
= gBS
->LocateDevicePath (
497 &gEfiDiskIoProtocolGuid
,
501 if (!EFI_ERROR (Status
)) {
505 Status
= Tcg2MeasureGptTable (Tcg2Protocol
, Handle
);
506 DEBUG ((DEBUG_INFO
, "DxeTpm2MeasureBootHandler - Tcg2MeasureGptTable - %r\n", Status
));
507 if (!EFI_ERROR (Status
)) {
509 // GPT disk check done.
511 mTcg2MeasureGptTableFlag
= TRUE
;
514 FreePool (OrigDevicePathNode
);
515 OrigDevicePathNode
= DuplicateDevicePath (File
);
516 ASSERT (OrigDevicePathNode
!= NULL
);
520 DevicePathNode
= NextDevicePathNode (DevicePathNode
);
525 // 2. Measure PE image.
527 ApplicationRequired
= FALSE
;
530 // Check whether this device path support FVB protocol.
532 DevicePathNode
= OrigDevicePathNode
;
533 Status
= gBS
->LocateDevicePath (&gEfiFirmwareVolumeBlockProtocolGuid
, &DevicePathNode
, &Handle
);
534 if (!EFI_ERROR (Status
)) {
536 // Don't check FV image, and directly return EFI_SUCCESS.
537 // It can be extended to the specific FV authentication according to the different requirement.
539 if (IsDevicePathEnd (DevicePathNode
)) {
543 // The PE image from unmeasured Firmware volume need be measured
544 // The PE image from measured Firmware volume will be measured according to policy below.
545 // If it is driver, do not measure
546 // If it is application, still measure.
548 ApplicationRequired
= TRUE
;
550 if (mTcg2CacheMeasuredHandle
!= Handle
&& mTcg2MeasuredHobData
!= NULL
) {
552 // Search for Root FV of this PE image
556 Status
= gBS
->HandleProtocol(
558 &gEfiFirmwareVolumeBlockProtocolGuid
,
561 TempHandle
= FvbProtocol
->ParentHandle
;
562 } while (!EFI_ERROR(Status
) && FvbProtocol
->ParentHandle
!= NULL
);
565 // Search in measured FV Hob
567 Status
= FvbProtocol
->GetPhysicalAddress(FvbProtocol
, &FvAddress
);
568 if (EFI_ERROR(Status
)){
572 ApplicationRequired
= FALSE
;
574 for (Index
= 0; Index
< mTcg2MeasuredHobData
->Num
; Index
++) {
575 if(mTcg2MeasuredHobData
->MeasuredFvBuf
[Index
].BlobBase
== FvAddress
) {
577 // Cache measured FV for next measurement
579 mTcg2CacheMeasuredHandle
= Handle
;
580 ApplicationRequired
= TRUE
;
588 // File is not found.
590 if (FileBuffer
== NULL
) {
591 Status
= EFI_SECURITY_VIOLATION
;
595 mTcg2ImageSize
= FileSize
;
596 mTcg2FileBuffer
= FileBuffer
;
601 DevicePathNode
= OrigDevicePathNode
;
602 ZeroMem (&ImageContext
, sizeof (ImageContext
));
603 ImageContext
.Handle
= (VOID
*) FileBuffer
;
604 ImageContext
.ImageRead
= (PE_COFF_LOADER_READ_FILE
) DxeTpm2MeasureBootLibImageRead
;
607 // Get information about the image being loaded
609 Status
= PeCoffLoaderGetImageInfo (&ImageContext
);
610 if (EFI_ERROR (Status
)) {
612 // Check for invalid parameters.
615 Status
= EFI_ACCESS_DENIED
;
619 // The information can't be got from the invalid PeImage
625 // Measure only application if Application flag is set
626 // Measure drivers and applications if Application flag is not set
628 if ((!ApplicationRequired
) ||
629 (ApplicationRequired
&& ImageContext
.ImageType
== EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION
)) {
631 // Print the image path to be measured.
635 ToText
= ConvertDevicePathToText (
640 if (ToText
!= NULL
) {
641 DEBUG ((DEBUG_INFO
, "The measured image path is %s.\n", ToText
));
647 // Measure PE image into TPM log.
649 Status
= Tcg2MeasurePeImage (
651 (EFI_PHYSICAL_ADDRESS
) (UINTN
) FileBuffer
,
653 (UINTN
) ImageContext
.ImageAddress
,
654 ImageContext
.ImageType
,
657 DEBUG ((DEBUG_INFO
, "DxeTpm2MeasureBootHandler - Tcg2MeasurePeImage - %r\n", Status
));
661 // Done, free the allocated resource.
664 if (OrigDevicePathNode
!= NULL
) {
665 FreePool (OrigDevicePathNode
);
668 DEBUG ((DEBUG_INFO
, "DxeTpm2MeasureBootHandler - %r\n", Status
));
674 Register the security handler to provide TPM measure boot service.
676 @param ImageHandle ImageHandle of the loaded driver.
677 @param SystemTable Pointer to the EFI System Table.
679 @retval EFI_SUCCESS Register successfully.
680 @retval EFI_OUT_OF_RESOURCES No enough memory to register this handler.
684 DxeTpm2MeasureBootLibConstructor (
685 IN EFI_HANDLE ImageHandle
,
686 IN EFI_SYSTEM_TABLE
*SystemTable
689 EFI_HOB_GUID_TYPE
*GuidHob
;
693 GuidHob
= GetFirstGuidHob (&gMeasuredFvHobGuid
);
695 if (GuidHob
!= NULL
) {
696 mTcg2MeasuredHobData
= GET_GUID_HOB_DATA (GuidHob
);
699 return RegisterSecurity2Handler (
700 DxeTpm2MeasureBootHandler
,
701 EFI_AUTH_OPERATION_MEASURE_IMAGE
| EFI_AUTH_OPERATION_IMAGE_REQUIRED