Use UEFI_VARIABLE_DATA data structure according to TCG PC-Client PFP Spec
00.21.
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf
Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
- Measure TrEE required variable.\r
+ Measure TCG required variable.\r
-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2017, 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
#include <PiDxe.h>\r
#include <Guid/ImageAuthentication.h>\r
#include <IndustryStandard/UefiTcgPlatform.h>\r
#include <PiDxe.h>\r
#include <Guid/ImageAuthentication.h>\r
#include <IndustryStandard/UefiTcgPlatform.h>\r
-#include <Protocol/TrEEProtocol.h>\r
\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
{\r
EFI_STATUS Status;\r
UINTN VarNameLength;\r
{\r
EFI_STATUS Status;\r
UINTN VarNameLength;\r
- EFI_VARIABLE_DATA_TREE *VarLog;\r
+ UEFI_VARIABLE_DATA *VarLog;\r
UINT32 VarLogSize;\r
\r
//\r
UINT32 VarLogSize;\r
\r
//\r
- // The EFI_VARIABLE_DATA_TREE.VariableData value shall be the EFI_SIGNATURE_DATA value\r
+ // The UEFI_VARIABLE_DATA.VariableData value shall be the EFI_SIGNATURE_DATA value\r
// from the EFI_SIGNATURE_LIST that contained the authority that was used to validate the image\r
//\r
VarNameLength = StrLen (VarName);\r
VarLogSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize\r
- sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData));\r
\r
// from the EFI_SIGNATURE_LIST that contained the authority that was used to validate the image\r
//\r
VarNameLength = StrLen (VarName);\r
VarLogSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize\r
- sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData));\r
\r
- VarLog = (EFI_VARIABLE_DATA_TREE *) AllocateZeroPool (VarLogSize);\r
+ VarLog = (UEFI_VARIABLE_DATA *) AllocateZeroPool (VarLogSize);\r
if (VarLog == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
if (VarLog == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
EFI_STATUS Status;\r
TCG_PCR_EVENT_HDR TcgEvent;\r
UINTN VarNameLength;\r
EFI_STATUS Status;\r
TCG_PCR_EVENT_HDR TcgEvent;\r
UINTN VarNameLength;\r
- EFI_VARIABLE_DATA_TREE *VarLog;\r
+ UEFI_VARIABLE_DATA *VarLog;\r
\r
DEBUG ((EFI_D_INFO, "Tcg2Dxe: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)PCRIndex, (UINTN)EventType));\r
DEBUG ((EFI_D_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid));\r
\r
DEBUG ((EFI_D_INFO, "Tcg2Dxe: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)PCRIndex, (UINTN)EventType));\r
DEBUG ((EFI_D_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid));\r
TcgEvent.EventSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize\r
- sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData));\r
\r
TcgEvent.EventSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize\r
- sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData));\r
\r
- VarLog = (EFI_VARIABLE_DATA_TREE *)AllocatePool (TcgEvent.EventSize);\r
+ VarLog = (UEFI_VARIABLE_DATA *)AllocatePool (TcgEvent.EventSize);\r
if (VarLog == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
if (VarLog == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
if (EventType == EV_EFI_VARIABLE_DRIVER_CONFIG) {\r
//\r
\r
if (EventType == EV_EFI_VARIABLE_DRIVER_CONFIG) {\r
//\r
- // Digest is the event data (EFI_VARIABLE_DATA)\r
+ // Digest is the event data (UEFI_VARIABLE_DATA)\r
//\r
Status = TcgDxeHashLogExtendEvent (\r
0,\r
//\r
Status = TcgDxeHashLogExtendEvent (\r
0,\r