]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Remove mTrEEZeroGuid definition in DxeTpm2MeasureBootLib
authorHao Wu <hao.a.wu@intel.com>
Tue, 7 Jul 2015 03:03:49 +0000 (03:03 +0000)
committerhwu1225 <hwu1225@Edk2>
Tue, 7 Jul 2015 03:03:49 +0000 (03:03 +0000)
MdeModulePkg has defined gZeroGuid in 'Guid/ZeroGuid.h', therefore, the
mTrEEZeroGuid defined in DxeTpm2MeasureBootLib 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@17843 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.inf

index ed53b7e00346d9d3a93dd338588e11ca6cd4baa1..2f752196a91ed6a37dc6c85eeced51086c2a0461 100644 (file)
@@ -35,6 +35,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
@@ -51,7 +52,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                           mTrEEMeasureGptTableFlag = FALSE;\r
 // Flag to check GPT partition. It only need be measured once.\r
 //\r
 BOOLEAN                           mTrEEMeasureGptTableFlag = FALSE;\r
-EFI_GUID                          mTrEEZeroGuid = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};\r
 UINTN                             mTrEEMeasureGptCount = 0;\r
 VOID                              *mTrEEFileBuffer;\r
 UINTN                             mTrEEImageSize;\r
 UINTN                             mTrEEMeasureGptCount = 0;\r
 VOID                              *mTrEEFileBuffer;\r
 UINTN                             mTrEEImageSize;\r
@@ -201,7 +201,7 @@ TrEEMeasureGptTable (
   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, &mTrEEZeroGuid)) {\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
@@ -237,7 +237,7 @@ TrEEMeasureGptTable (
   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, &mTrEEZeroGuid)) {\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 c007d7cf5d962974aa31b387603c0e20ee6c907f..14bf190317be9c885f21f039d6fd6cf206cac1cc 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) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2013 - 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
   gEfiTrEEProtocolGuid                  ## SOMETIMES_CONSUMES\r
 \r
 [Protocols]\r
   gEfiTrEEProtocolGuid                  ## SOMETIMES_CONSUMES\r