summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
39cde03)
Instead of comparing a GUID with gZeroGuid via the CompareGuid API, the
commit uses the IsZeroGuid API to check if the given GUID is a zero GUID.
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Tcg2MeasureGptTable() function will receive untrusted GPT partition table, and parse\r
partition data carefully.\r
\r
Tcg2MeasureGptTable() function will receive untrusted GPT partition table, and parse\r
partition data carefully.\r
\r
-Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
#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
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, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&PartitionEntry->PartitionTypeGUID)) {\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
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, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&PartitionEntry->PartitionTypeGUID)) {\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
# 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 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2013 - 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
# 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
\r
[Guids]\r
gMeasuredFvHobGuid ## SOMETIMES_CONSUMES ## HOB\r
\r
[Guids]\r
gMeasuredFvHobGuid ## SOMETIMES_CONSUMES ## HOB\r
- gZeroGuid ## SOMETIMES_CONSUMES ## GUID\r
\r
[Protocols]\r
gEfiTcg2ProtocolGuid ## SOMETIMES_CONSUMES\r
\r
[Protocols]\r
gEfiTcg2ProtocolGuid ## SOMETIMES_CONSUMES\r
#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
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, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&PartitionEntry->PartitionTypeGUID)) {\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
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, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&PartitionEntry->PartitionTypeGUID)) {\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
# 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 - 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
# 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
\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