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 - 2016, Intel Corporation. All rights reserved.<BR>
19 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
20 This program and the accompanying materials
21 are licensed and made available under the terms and conditions of the BSD License
22 which accompanies this distribution. The full text of the license may be found at
23 http://opensource.org/licenses/bsd-license.php
25 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
26 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
32 #include <Protocol/Tcg2Protocol.h>
33 #include <Protocol/BlockIo.h>
34 #include <Protocol/DiskIo.h>
35 #include <Protocol/DevicePathToText.h>
36 #include <Protocol/FirmwareVolumeBlock.h>
38 #include <Guid/MeasuredFvHob.h>
40 #include <Library/BaseLib.h>
41 #include <Library/DebugLib.h>
42 #include <Library/BaseMemoryLib.h>
43 #include <Library/MemoryAllocationLib.h>
44 #include <Library/DevicePathLib.h>
45 #include <Library/UefiBootServicesTableLib.h>
46 #include <Library/BaseCryptLib.h>
47 #include <Library/PeCoffLib.h>
48 #include <Library/SecurityManagementLib.h>
49 #include <Library/HobLib.h>
52 // Flag to check GPT partition. It only need be measured once.
54 BOOLEAN mTcg2MeasureGptTableFlag
= FALSE
;
55 UINTN mTcg2MeasureGptCount
= 0;
56 VOID
*mTcg2FileBuffer
;
59 // Measured FV handle cache
61 EFI_HANDLE mTcg2CacheMeasuredHandle
= NULL
;
62 MEASURED_HOB_DATA
*mTcg2MeasuredHobData
= NULL
;
65 Reads contents of a PE/COFF image in memory buffer.
67 Caution: This function may receive untrusted input.
68 PE/COFF image is external input, so this function will make sure the PE/COFF image content
69 read is within the image buffer.
71 @param FileHandle Pointer to the file handle to read the PE/COFF image.
72 @param FileOffset Offset into the PE/COFF image to begin the read operation.
73 @param ReadSize On input, the size in bytes of the requested read operation.
74 On output, the number of bytes actually read.
75 @param Buffer Output buffer that contains the data read from the PE/COFF image.
77 @retval EFI_SUCCESS The specified portion of the PE/COFF image was read and the size
81 DxeTpm2MeasureBootLibImageRead (
84 IN OUT UINTN
*ReadSize
,
90 if (FileHandle
== NULL
|| ReadSize
== NULL
|| Buffer
== NULL
) {
91 return EFI_INVALID_PARAMETER
;
94 if (MAX_ADDRESS
- FileOffset
< *ReadSize
) {
95 return EFI_INVALID_PARAMETER
;
98 EndPosition
= FileOffset
+ *ReadSize
;
99 if (EndPosition
> mTcg2ImageSize
) {
100 *ReadSize
= (UINT32
)(mTcg2ImageSize
- FileOffset
);
103 if (FileOffset
>= mTcg2ImageSize
) {
107 CopyMem (Buffer
, (UINT8
*)((UINTN
) FileHandle
+ FileOffset
), *ReadSize
);
113 Measure GPT table data into TPM log.
115 Caution: This function may receive untrusted input.
116 The GPT partition table is external input, so this function should parse partition data carefully.
118 @param Tcg2Protocol Pointer to the located TCG2 protocol instance.
119 @param GptHandle Handle that GPT partition was installed.
121 @retval EFI_SUCCESS Successfully measure GPT table.
122 @retval EFI_UNSUPPORTED Not support GPT table on the given handle.
123 @retval EFI_DEVICE_ERROR Can't get GPT table because device error.
124 @retval EFI_OUT_OF_RESOURCES No enough resource to measure GPT table.
125 @retval other error value
129 Tcg2MeasureGptTable (
130 IN EFI_TCG2_PROTOCOL
*Tcg2Protocol
,
131 IN EFI_HANDLE GptHandle
135 EFI_BLOCK_IO_PROTOCOL
*BlockIo
;
136 EFI_DISK_IO_PROTOCOL
*DiskIo
;
137 EFI_PARTITION_TABLE_HEADER
*PrimaryHeader
;
138 EFI_PARTITION_ENTRY
*PartitionEntry
;
140 UINTN NumberOfPartition
;
142 EFI_TCG2_EVENT
*Tcg2Event
;
143 EFI_GPT_DATA
*GptData
;
146 if (mTcg2MeasureGptCount
> 0) {
150 Status
= gBS
->HandleProtocol (GptHandle
, &gEfiBlockIoProtocolGuid
, (VOID
**)&BlockIo
);
151 if (EFI_ERROR (Status
)) {
152 return EFI_UNSUPPORTED
;
154 Status
= gBS
->HandleProtocol (GptHandle
, &gEfiDiskIoProtocolGuid
, (VOID
**)&DiskIo
);
155 if (EFI_ERROR (Status
)) {
156 return EFI_UNSUPPORTED
;
159 // Read the EFI Partition Table Header
161 PrimaryHeader
= (EFI_PARTITION_TABLE_HEADER
*) AllocatePool (BlockIo
->Media
->BlockSize
);
162 if (PrimaryHeader
== NULL
) {
163 return EFI_OUT_OF_RESOURCES
;
165 Status
= DiskIo
->ReadDisk (
167 BlockIo
->Media
->MediaId
,
168 1 * BlockIo
->Media
->BlockSize
,
169 BlockIo
->Media
->BlockSize
,
170 (UINT8
*)PrimaryHeader
172 if (EFI_ERROR (Status
)) {
173 DEBUG ((EFI_D_ERROR
, "Failed to Read Partition Table Header!\n"));
174 FreePool (PrimaryHeader
);
175 return EFI_DEVICE_ERROR
;
178 // Read the partition entry.
180 EntryPtr
= (UINT8
*)AllocatePool (PrimaryHeader
->NumberOfPartitionEntries
* PrimaryHeader
->SizeOfPartitionEntry
);
181 if (EntryPtr
== NULL
) {
182 FreePool (PrimaryHeader
);
183 return EFI_OUT_OF_RESOURCES
;
185 Status
= DiskIo
->ReadDisk (
187 BlockIo
->Media
->MediaId
,
188 MultU64x32(PrimaryHeader
->PartitionEntryLBA
, BlockIo
->Media
->BlockSize
),
189 PrimaryHeader
->NumberOfPartitionEntries
* PrimaryHeader
->SizeOfPartitionEntry
,
192 if (EFI_ERROR (Status
)) {
193 FreePool (PrimaryHeader
);
195 return EFI_DEVICE_ERROR
;
199 // Count the valid partition
201 PartitionEntry
= (EFI_PARTITION_ENTRY
*)EntryPtr
;
202 NumberOfPartition
= 0;
203 for (Index
= 0; Index
< PrimaryHeader
->NumberOfPartitionEntries
; Index
++) {
204 if (!IsZeroGuid (&PartitionEntry
->PartitionTypeGUID
)) {
207 PartitionEntry
= (EFI_PARTITION_ENTRY
*)((UINT8
*)PartitionEntry
+ PrimaryHeader
->SizeOfPartitionEntry
);
211 // Prepare Data for Measurement
213 EventSize
= (UINT32
)(sizeof (EFI_GPT_DATA
) - sizeof (GptData
->Partitions
)
214 + NumberOfPartition
* PrimaryHeader
->SizeOfPartitionEntry
);
215 Tcg2Event
= (EFI_TCG2_EVENT
*) AllocateZeroPool (EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
));
216 if (Tcg2Event
== NULL
) {
217 FreePool (PrimaryHeader
);
219 return EFI_OUT_OF_RESOURCES
;
222 Tcg2Event
->Size
= EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
);
223 Tcg2Event
->Header
.HeaderSize
= sizeof(EFI_TCG2_EVENT_HEADER
);
224 Tcg2Event
->Header
.HeaderVersion
= EFI_TCG2_EVENT_HEADER_VERSION
;
225 Tcg2Event
->Header
.PCRIndex
= 5;
226 Tcg2Event
->Header
.EventType
= EV_EFI_GPT_EVENT
;
227 GptData
= (EFI_GPT_DATA
*) Tcg2Event
->Event
;
230 // Copy the EFI_PARTITION_TABLE_HEADER and NumberOfPartition
232 CopyMem ((UINT8
*)GptData
, (UINT8
*)PrimaryHeader
, sizeof (EFI_PARTITION_TABLE_HEADER
));
233 GptData
->NumberOfPartitions
= NumberOfPartition
;
235 // Copy the valid partition entry
237 PartitionEntry
= (EFI_PARTITION_ENTRY
*)EntryPtr
;
238 NumberOfPartition
= 0;
239 for (Index
= 0; Index
< PrimaryHeader
->NumberOfPartitionEntries
; Index
++) {
240 if (!IsZeroGuid (&PartitionEntry
->PartitionTypeGUID
)) {
242 (UINT8
*)&GptData
->Partitions
+ NumberOfPartition
* PrimaryHeader
->SizeOfPartitionEntry
,
243 (UINT8
*)PartitionEntry
,
244 PrimaryHeader
->SizeOfPartitionEntry
248 PartitionEntry
=(EFI_PARTITION_ENTRY
*)((UINT8
*)PartitionEntry
+ PrimaryHeader
->SizeOfPartitionEntry
);
252 // Measure the GPT data
254 Status
= Tcg2Protocol
->HashLogExtendEvent (
257 (EFI_PHYSICAL_ADDRESS
) (UINTN
) (VOID
*) GptData
,
261 if (!EFI_ERROR (Status
)) {
262 mTcg2MeasureGptCount
++;
265 FreePool (PrimaryHeader
);
267 FreePool (Tcg2Event
);
273 Measure PE image into TPM log based on the authenticode image hashing in
274 PE/COFF Specification 8.0 Appendix A.
276 Caution: This function may receive untrusted input.
277 PE/COFF image is external input, so this function will validate its data structure
278 within this image buffer before use.
280 @param[in] Tcg2Protocol Pointer to the located TCG2 protocol instance.
281 @param[in] ImageAddress Start address of image buffer.
282 @param[in] ImageSize Image size
283 @param[in] LinkTimeBase Address that the image is loaded into memory.
284 @param[in] ImageType Image subsystem type.
285 @param[in] FilePath File path is corresponding to the input image.
287 @retval EFI_SUCCESS Successfully measure image.
288 @retval EFI_OUT_OF_RESOURCES No enough resource to measure image.
289 @retval EFI_UNSUPPORTED ImageType is unsupported or PE image is mal-format.
290 @retval other error value
296 IN EFI_TCG2_PROTOCOL
*Tcg2Protocol
,
297 IN EFI_PHYSICAL_ADDRESS ImageAddress
,
299 IN UINTN LinkTimeBase
,
301 IN EFI_DEVICE_PATH_PROTOCOL
*FilePath
305 EFI_TCG2_EVENT
*Tcg2Event
;
306 EFI_IMAGE_LOAD_EVENT
*ImageLoad
;
310 Status
= EFI_UNSUPPORTED
;
312 FilePathSize
= (UINT32
) GetDevicePathSize (FilePath
);
315 // Determine destination PCR by BootPolicy
317 EventSize
= sizeof (*ImageLoad
) - sizeof (ImageLoad
->DevicePath
) + FilePathSize
;
318 Tcg2Event
= AllocateZeroPool (EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
));
319 if (Tcg2Event
== NULL
) {
320 return EFI_OUT_OF_RESOURCES
;
323 Tcg2Event
->Size
= EventSize
+ sizeof (EFI_TCG2_EVENT
) - sizeof(Tcg2Event
->Event
);
324 Tcg2Event
->Header
.HeaderSize
= sizeof(EFI_TCG2_EVENT_HEADER
);
325 Tcg2Event
->Header
.HeaderVersion
= EFI_TCG2_EVENT_HEADER_VERSION
;
326 ImageLoad
= (EFI_IMAGE_LOAD_EVENT
*) Tcg2Event
->Event
;
329 case EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION
:
330 Tcg2Event
->Header
.EventType
= EV_EFI_BOOT_SERVICES_APPLICATION
;
331 Tcg2Event
->Header
.PCRIndex
= 4;
333 case EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
:
334 Tcg2Event
->Header
.EventType
= EV_EFI_BOOT_SERVICES_DRIVER
;
335 Tcg2Event
->Header
.PCRIndex
= 2;
337 case EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
:
338 Tcg2Event
->Header
.EventType
= EV_EFI_RUNTIME_SERVICES_DRIVER
;
339 Tcg2Event
->Header
.PCRIndex
= 2;
344 "Tcg2MeasurePeImage: Unknown subsystem type %d",
350 ImageLoad
->ImageLocationInMemory
= ImageAddress
;
351 ImageLoad
->ImageLengthInMemory
= ImageSize
;
352 ImageLoad
->ImageLinkTimeAddress
= LinkTimeBase
;
353 ImageLoad
->LengthOfDevicePath
= FilePathSize
;
354 if ((FilePath
!= NULL
) && (FilePathSize
!= 0)) {
355 CopyMem (ImageLoad
->DevicePath
, FilePath
, FilePathSize
);
361 Status
= Tcg2Protocol
->HashLogExtendEvent (
368 if (Status
== EFI_VOLUME_FULL
) {
370 // Volume full here means the image is hashed and its result is extended to PCR.
371 // But the event log cann't be saved since log area is full.
372 // Just return EFI_SUCCESS in order not to block the image load.
374 Status
= EFI_SUCCESS
;
378 FreePool (Tcg2Event
);
384 The security handler is used to abstract platform-specific policy
385 from the DXE core response to an attempt to use a file that returns a
386 given status for the authentication check from the section extraction protocol.
388 The possible responses in a given SAP implementation may include locking
389 flash upon failure to authenticate, attestation logging for all signed drivers,
390 and other exception operations. The File parameter allows for possible logging
391 within the SAP of the driver.
393 If File is NULL, then EFI_INVALID_PARAMETER is returned.
395 If the file specified by File with an authentication status specified by
396 AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
398 If the file specified by File with an authentication status specified by
399 AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
400 then EFI_ACCESS_DENIED is returned.
402 If the file specified by File with an authentication status specified by
403 AuthenticationStatus is not safe for the DXE Core to use right now, but it
404 might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
407 @param[in] AuthenticationStatus This is the authentication status returned
408 from the securitymeasurement services for the
410 @param[in] File This is a pointer to the device path of the file that is
411 being dispatched. This will optionally be used for logging.
412 @param[in] FileBuffer File buffer matches the input file device path.
413 @param[in] FileSize Size of File buffer matches the input file device path.
414 @param[in] BootPolicy A boot policy that was used to call LoadImage() UEFI service.
416 @retval EFI_SUCCESS The file specified by DevicePath and non-NULL
417 FileBuffer did authenticate, and the platform policy dictates
418 that the DXE Foundation may use the file.
419 @retval other error value
423 DxeTpm2MeasureBootHandler (
424 IN UINT32 AuthenticationStatus
,
425 IN CONST EFI_DEVICE_PATH_PROTOCOL
*File
,
428 IN BOOLEAN BootPolicy
431 EFI_TCG2_PROTOCOL
*Tcg2Protocol
;
433 EFI_TCG2_BOOT_SERVICE_CAPABILITY ProtocolCapability
;
434 EFI_DEVICE_PATH_PROTOCOL
*DevicePathNode
;
435 EFI_DEVICE_PATH_PROTOCOL
*OrigDevicePathNode
;
437 EFI_HANDLE TempHandle
;
438 BOOLEAN ApplicationRequired
;
439 PE_COFF_LOADER_IMAGE_CONTEXT ImageContext
;
440 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*FvbProtocol
;
441 EFI_PHYSICAL_ADDRESS FvAddress
;
444 Status
= gBS
->LocateProtocol (&gEfiTcg2ProtocolGuid
, NULL
, (VOID
**) &Tcg2Protocol
);
445 if (EFI_ERROR (Status
)) {
447 // Tcg2 protocol is not installed. So, TPM2 is not present.
448 // Don't do any measurement, and directly return EFI_SUCCESS.
450 DEBUG ((EFI_D_VERBOSE
, "DxeTpm2MeasureBootHandler - Tcg2 - %r\n", Status
));
454 ProtocolCapability
.Size
= (UINT8
) sizeof (ProtocolCapability
);
455 Status
= Tcg2Protocol
->GetCapability (
459 if (EFI_ERROR (Status
) || (!ProtocolCapability
.TPMPresentFlag
)) {
461 // TPM device doesn't work or activate.
463 DEBUG ((EFI_D_ERROR
, "DxeTpm2MeasureBootHandler (%r) - TPMPresentFlag - %x\n", Status
, ProtocolCapability
.TPMPresentFlag
));
468 // Copy File Device Path
470 OrigDevicePathNode
= DuplicateDevicePath (File
);
473 // 1. Check whether this device path support BlockIo protocol.
474 // Is so, this device path may be a GPT device path.
476 DevicePathNode
= OrigDevicePathNode
;
477 Status
= gBS
->LocateDevicePath (&gEfiBlockIoProtocolGuid
, &DevicePathNode
, &Handle
);
478 if (!EFI_ERROR (Status
) && !mTcg2MeasureGptTableFlag
) {
480 // Find the gpt partion on the given devicepath
482 DevicePathNode
= OrigDevicePathNode
;
483 ASSERT (DevicePathNode
!= NULL
);
484 while (!IsDevicePathEnd (DevicePathNode
)) {
486 // Find the Gpt partition
488 if (DevicePathType (DevicePathNode
) == MEDIA_DEVICE_PATH
&&
489 DevicePathSubType (DevicePathNode
) == MEDIA_HARDDRIVE_DP
) {
491 // Check whether it is a gpt partition or not
493 if (((HARDDRIVE_DEVICE_PATH
*) DevicePathNode
)->MBRType
== MBR_TYPE_EFI_PARTITION_TABLE_HEADER
&&
494 ((HARDDRIVE_DEVICE_PATH
*) DevicePathNode
)->SignatureType
== SIGNATURE_TYPE_GUID
) {
497 // Change the partition device path to its parent device path (disk) and get the handle.
499 DevicePathNode
->Type
= END_DEVICE_PATH_TYPE
;
500 DevicePathNode
->SubType
= END_ENTIRE_DEVICE_PATH_SUBTYPE
;
501 DevicePathNode
= OrigDevicePathNode
;
502 Status
= gBS
->LocateDevicePath (
503 &gEfiDiskIoProtocolGuid
,
507 if (!EFI_ERROR (Status
)) {
511 Status
= Tcg2MeasureGptTable (Tcg2Protocol
, Handle
);
512 DEBUG ((EFI_D_INFO
, "DxeTpm2MeasureBootHandler - Tcg2MeasureGptTable - %r\n", Status
));
513 if (!EFI_ERROR (Status
)) {
515 // GPT disk check done.
517 mTcg2MeasureGptTableFlag
= TRUE
;
520 FreePool (OrigDevicePathNode
);
521 OrigDevicePathNode
= DuplicateDevicePath (File
);
522 ASSERT (OrigDevicePathNode
!= NULL
);
526 DevicePathNode
= NextDevicePathNode (DevicePathNode
);
531 // 2. Measure PE image.
533 ApplicationRequired
= FALSE
;
536 // Check whether this device path support FVB protocol.
538 DevicePathNode
= OrigDevicePathNode
;
539 Status
= gBS
->LocateDevicePath (&gEfiFirmwareVolumeBlockProtocolGuid
, &DevicePathNode
, &Handle
);
540 if (!EFI_ERROR (Status
)) {
542 // Don't check FV image, and directly return EFI_SUCCESS.
543 // It can be extended to the specific FV authentication according to the different requirement.
545 if (IsDevicePathEnd (DevicePathNode
)) {
549 // The PE image from unmeasured Firmware volume need be measured
550 // The PE image from measured Firmware volume will be mearsured according to policy below.
551 // If it is driver, do not measure
552 // If it is application, still measure.
554 ApplicationRequired
= TRUE
;
556 if (mTcg2CacheMeasuredHandle
!= Handle
&& mTcg2MeasuredHobData
!= NULL
) {
558 // Search for Root FV of this PE image
562 Status
= gBS
->HandleProtocol(
564 &gEfiFirmwareVolumeBlockProtocolGuid
,
567 TempHandle
= FvbProtocol
->ParentHandle
;
568 } while (!EFI_ERROR(Status
) && FvbProtocol
->ParentHandle
!= NULL
);
571 // Search in measured FV Hob
573 Status
= FvbProtocol
->GetPhysicalAddress(FvbProtocol
, &FvAddress
);
574 if (EFI_ERROR(Status
)){
578 ApplicationRequired
= FALSE
;
580 for (Index
= 0; Index
< mTcg2MeasuredHobData
->Num
; Index
++) {
581 if(mTcg2MeasuredHobData
->MeasuredFvBuf
[Index
].BlobBase
== FvAddress
) {
583 // Cache measured FV for next measurement
585 mTcg2CacheMeasuredHandle
= Handle
;
586 ApplicationRequired
= TRUE
;
594 // File is not found.
596 if (FileBuffer
== NULL
) {
597 Status
= EFI_SECURITY_VIOLATION
;
601 mTcg2ImageSize
= FileSize
;
602 mTcg2FileBuffer
= FileBuffer
;
607 DevicePathNode
= OrigDevicePathNode
;
608 ZeroMem (&ImageContext
, sizeof (ImageContext
));
609 ImageContext
.Handle
= (VOID
*) FileBuffer
;
610 ImageContext
.ImageRead
= (PE_COFF_LOADER_READ_FILE
) DxeTpm2MeasureBootLibImageRead
;
613 // Get information about the image being loaded
615 Status
= PeCoffLoaderGetImageInfo (&ImageContext
);
616 if (EFI_ERROR (Status
)) {
618 // The information can't be got from the invalid PeImage
624 // Measure only application if Application flag is set
625 // Measure drivers and applications if Application flag is not set
627 if ((!ApplicationRequired
) ||
628 (ApplicationRequired
&& ImageContext
.ImageType
== EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION
)) {
630 // Print the image path to be measured.
634 ToText
= ConvertDevicePathToText (
639 if (ToText
!= NULL
) {
640 DEBUG ((DEBUG_INFO
, "The measured image path is %s.\n", ToText
));
646 // Measure PE image into TPM log.
648 Status
= Tcg2MeasurePeImage (
650 (EFI_PHYSICAL_ADDRESS
) (UINTN
) FileBuffer
,
652 (UINTN
) ImageContext
.ImageAddress
,
653 ImageContext
.ImageType
,
656 DEBUG ((EFI_D_INFO
, "DxeTpm2MeasureBootHandler - Tcg2MeasurePeImage - %r\n", Status
));
660 // Done, free the allocated resource.
663 if (OrigDevicePathNode
!= NULL
) {
664 FreePool (OrigDevicePathNode
);
667 DEBUG ((EFI_D_INFO
, "DxeTpm2MeasureBootHandler - %r\n", Status
));
673 Register the security handler to provide TPM measure boot service.
675 @param ImageHandle ImageHandle of the loaded driver.
676 @param SystemTable Pointer to the EFI System Table.
678 @retval EFI_SUCCESS Register successfully.
679 @retval EFI_OUT_OF_RESOURCES No enough memory to register this handler.
683 DxeTpm2MeasureBootLibConstructor (
684 IN EFI_HANDLE ImageHandle
,
685 IN EFI_SYSTEM_TABLE
*SystemTable
688 EFI_HOB_GUID_TYPE
*GuidHob
;
692 GuidHob
= GetFirstGuidHob (&gMeasuredFvHobGuid
);
694 if (GuidHob
!= NULL
) {
695 mTcg2MeasuredHobData
= GET_GUID_HOB_DATA (GuidHob
);
698 return RegisterSecurity2Handler (
699 DxeTpm2MeasureBootHandler
,
700 EFI_AUTH_OPERATION_MEASURE_IMAGE
| EFI_AUTH_OPERATION_IMAGE_REQUIRED