TcgMeasureGptTable() function will receive untrusted GPT partition table, and parse\r
partition data carefully.\r
\r
-Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
#include <Protocol/FirmwareVolumeBlock.h>\r
\r
#include <Guid/MeasuredFvHob.h>\r
-#include <Guid/ZeroGuid.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
BOOLEAN mMeasureGptTableFlag = FALSE;\r
UINTN mMeasureGptCount = 0;\r
VOID *mFileBuffer;\r
-UINTN mImageSize;\r
+UINTN mTpmImageSize;\r
//\r
// Measured FV handle cache\r
//\r
}\r
\r
EndPosition = FileOffset + *ReadSize;\r
- if (EndPosition > mImageSize) {\r
- *ReadSize = (UINT32)(mImageSize - FileOffset);\r
+ if (EndPosition > mTpmImageSize) {\r
+ *ReadSize = (UINT32)(mTpmImageSize - FileOffset);\r
}\r
\r
- if (FileOffset >= mImageSize) {\r
+ if (FileOffset >= mTpmImageSize) {\r
*ReadSize = 0;\r
}\r
\r
PartitionEntry = (EFI_PARTITION_ENTRY *)EntryPtr;\r
NumberOfPartition = 0;\r
for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {\r
- if (!CompareGuid (&PartitionEntry->PartitionTypeGUID, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&PartitionEntry->PartitionTypeGUID)) {\r
NumberOfPartition++; \r
}\r
PartitionEntry = (EFI_PARTITION_ENTRY *)((UINT8 *)PartitionEntry + PrimaryHeader->SizeOfPartitionEntry);\r
PartitionEntry = (EFI_PARTITION_ENTRY*)EntryPtr;\r
NumberOfPartition = 0;\r
for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {\r
- if (!CompareGuid (&PartitionEntry->PartitionTypeGUID, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&PartitionEntry->PartitionTypeGUID)) {\r
CopyMem (\r
(UINT8 *)&GptData->Partitions + NumberOfPartition * PrimaryHeader->SizeOfPartitionEntry,\r
(UINT8 *)PartitionEntry,\r
PE/COFF image is external input, so this function will validate its data structure\r
within this image buffer before use.\r
\r
+ Notes: PE/COFF image has been checked by BasePeCoffLib PeCoffLoaderGetImageInfo() in \r
+ its caller function DxeTpmMeasureBootHandler().\r
+\r
@param[in] TcgProtocol Pointer to the located TCG protocol instance.\r
@param[in] ImageAddress Start address of image buffer.\r
@param[in] ImageSize Image size\r
goto Finish;\r
}\r
\r
- mImageSize = FileSize;\r
+ mTpmImageSize = FileSize;\r
mFileBuffer = FileBuffer;\r
\r
//\r