]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
Downgrade one debug message level in DxeTpm2MeasureBootHandler from EFI_D_ERROR to...
[mirror_edk2.git] / SecurityPkg / Library / DxeTpm2MeasureBootLib / DxeTpm2MeasureBootLib.c
index 8482031e437ead45300c5bd2939906c3374a1d7d..a5d7fe5fa8f7a9e7bfdaf5e3cb257167b3939588 100644 (file)
@@ -15,7 +15,7 @@
   TrEEMeasureGptTable() function will receive untrusted GPT partition table, and parse\r
   partition data carefully.\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
@@ -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 <Guid/ZeroGuid.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
-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
@@ -201,7 +201,7 @@ TrEEMeasureGptTable (
   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
@@ -237,7 +237,7 @@ TrEEMeasureGptTable (
   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
@@ -447,7 +447,7 @@ DxeTpm2MeasureBootHandler (
     // TrEE protocol is not installed. So, TPM2 is not present.\r
     // Don't do any measurement, and directly return EFI_SUCCESS.\r
     //\r
-    DEBUG ((EFI_D_ERROR, "DxeTpm2MeasureBootHandler - TrEE - %r\n", Status));\r
+    DEBUG ((EFI_D_INFO, "DxeTpm2MeasureBootHandler - TrEE - %r\n", Status));\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -456,7 +456,7 @@ DxeTpm2MeasureBootHandler (
                            TreeProtocol, \r
                            &ProtocolCapability\r
                            );\r
-  if (EFI_ERROR (Status) || !ProtocolCapability.TrEEPresentFlag) {\r
+  if (EFI_ERROR (Status) || (!ProtocolCapability.TrEEPresentFlag)) {\r
     //\r
     // TPM device doesn't work or activate.\r
     //\r
@@ -509,7 +509,7 @@ DxeTpm2MeasureBootHandler (
             // Measure GPT disk.\r
             //\r
             Status = TrEEMeasureGptTable (TreeProtocol, Handle);\r
-            DEBUG ((EFI_D_ERROR, "DxeTpm2MeasureBootHandler - TrEEMeasureGptTable - %r\n", Status));\r
+            DEBUG ((EFI_D_INFO, "DxeTpm2MeasureBootHandler - TrEEMeasureGptTable - %r\n", Status));\r
             if (!EFI_ERROR (Status)) {\r
               //\r
               // GPT disk check done.\r
@@ -653,7 +653,7 @@ DxeTpm2MeasureBootHandler (
                ImageContext.ImageType, \r
                DevicePathNode\r
                );\r
-    DEBUG ((EFI_D_ERROR, "DxeTpm2MeasureBootHandler - TrEEMeasurePeImage - %r\n", Status));\r
+    DEBUG ((EFI_D_INFO, "DxeTpm2MeasureBootHandler - TrEEMeasurePeImage - %r\n", Status));\r
   }\r
 \r
   //\r
@@ -664,7 +664,7 @@ Finish:
     FreePool (OrigDevicePathNode);\r
   }\r
 \r
-  DEBUG ((EFI_D_ERROR, "DxeTpm2MeasureBootHandler - %r\n", Status));\r
+  DEBUG ((EFI_D_INFO, "DxeTpm2MeasureBootHandler - %r\n", Status));\r
 \r
   return Status;\r
 }\r