]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Remove mZeroGuid definition in DxeTpmMeasureBootLib
authorHao Wu <hao.a.wu@intel.com>
Tue, 7 Jul 2015 03:04:18 +0000 (03:04 +0000)
committerhwu1225 <hwu1225@Edk2>
Tue, 7 Jul 2015 03:04:18 +0000 (03:04 +0000)
MdeModulePkg has defined gZeroGuid in 'Guid/ZeroGuid.h', therefore, the
mZeroGuid defined in DxeTpmMeasureBootLib is redundant.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17844 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c
SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf

index 466a74ef093feb93031eda4d27c6891b88338abd..cd48a1a9773a66251b524f6ce07a549f706716d2 100644 (file)
@@ -34,6 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/FirmwareVolumeBlock.h>\r
 \r
 #include <Guid/MeasuredFvHob.h>\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
 \r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -50,7 +51,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 // Flag to check GPT partition. It only need be measured once.\r
 //\r
 BOOLEAN                           mMeasureGptTableFlag = FALSE;\r
 // Flag to check GPT partition. It only need be measured once.\r
 //\r
 BOOLEAN                           mMeasureGptTableFlag = FALSE;\r
-EFI_GUID                          mZeroGuid = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};\r
 UINTN                             mMeasureGptCount = 0;\r
 VOID                              *mFileBuffer;\r
 UINTN                             mImageSize;\r
 UINTN                             mMeasureGptCount = 0;\r
 VOID                              *mFileBuffer;\r
 UINTN                             mImageSize;\r
@@ -202,7 +202,7 @@ TcgMeasureGptTable (
   PartitionEntry    = (EFI_PARTITION_ENTRY *)EntryPtr;\r
   NumberOfPartition = 0;\r
   for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {\r
   PartitionEntry    = (EFI_PARTITION_ENTRY *)EntryPtr;\r
   NumberOfPartition = 0;\r
   for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {\r
-    if (!CompareGuid (&PartitionEntry->PartitionTypeGUID, &mZeroGuid)) {\r
+    if (!CompareGuid (&PartitionEntry->PartitionTypeGUID, &gZeroGuid)) {\r
       NumberOfPartition++;  \r
     }\r
     PartitionEntry = (EFI_PARTITION_ENTRY *)((UINT8 *)PartitionEntry + PrimaryHeader->SizeOfPartitionEntry);\r
       NumberOfPartition++;  \r
     }\r
     PartitionEntry = (EFI_PARTITION_ENTRY *)((UINT8 *)PartitionEntry + PrimaryHeader->SizeOfPartitionEntry);\r
@@ -236,7 +236,7 @@ TcgMeasureGptTable (
   PartitionEntry    = (EFI_PARTITION_ENTRY*)EntryPtr;\r
   NumberOfPartition = 0;\r
   for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {\r
   PartitionEntry    = (EFI_PARTITION_ENTRY*)EntryPtr;\r
   NumberOfPartition = 0;\r
   for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {\r
-    if (!CompareGuid (&PartitionEntry->PartitionTypeGUID, &mZeroGuid)) {\r
+    if (!CompareGuid (&PartitionEntry->PartitionTypeGUID, &gZeroGuid)) {\r
       CopyMem (\r
         (UINT8 *)&GptData->Partitions + NumberOfPartition * PrimaryHeader->SizeOfPartitionEntry,\r
         (UINT8 *)PartitionEntry,\r
       CopyMem (\r
         (UINT8 *)&GptData->Partitions + NumberOfPartition * PrimaryHeader->SizeOfPartitionEntry,\r
         (UINT8 *)PartitionEntry,\r
index 57a0108e1d16ca6af550969d065c8f3a3eb1d70b..0d58eec9b52e0167cea6c0aa7154603a35a61f7a 100644 (file)
@@ -9,7 +9,7 @@
 #  This external input must be validated carefully to avoid security issues such \r
 #  as buffer overflow or integer overflow.\r
 #\r
 #  This external input must be validated carefully to avoid security issues such \r
 #  as buffer overflow or integer overflow.\r
 #\r
-# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2015, 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
 # 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
@@ -58,6 +58,7 @@
 \r
 [Guids]\r
   gMeasuredFvHobGuid                    ## SOMETIMES_CONSUMES ## HOB\r
 \r
 [Guids]\r
   gMeasuredFvHobGuid                    ## SOMETIMES_CONSUMES ## HOB\r
+  gZeroGuid                             ## SOMETIMES_CONSUMES ## GUID\r
 \r
 [Protocols]\r
   gEfiTcgProtocolGuid                   ## SOMETIMES_CONSUMES\r
 \r
 [Protocols]\r
   gEfiTcgProtocolGuid                   ## SOMETIMES_CONSUMES\r