From: Zhang, Chao B Date: Tue, 24 Jan 2017 07:31:23 +0000 (+0800) Subject: SecurityPkg: Tcg2Dxe: Use UEFI_VARIABLE_DATA X-Git-Tag: edk2-stable201903~4688 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9d77acf1566fae033ae2dad0ddc8d8565f1c6f4a SecurityPkg: Tcg2Dxe: Use UEFI_VARIABLE_DATA 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 Cc: Yao Jiewen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang Reviewed-by: Star Zeng Reviewed-by: Yao Jiewen --- diff --git a/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c b/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c index 1dc29895f3..6b98747d4a 100644 --- a/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c +++ b/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c @@ -1,7 +1,7 @@ /** @file - Measure TrEE required variable. + Measure TCG required variable. -Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -15,7 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include @@ -230,18 +229,18 @@ MeasureVariable ( { EFI_STATUS Status; UINTN VarNameLength; - EFI_VARIABLE_DATA_TREE *VarLog; + UEFI_VARIABLE_DATA *VarLog; UINT32 VarLogSize; // - // The EFI_VARIABLE_DATA_TREE.VariableData value shall be the EFI_SIGNATURE_DATA value + // The UEFI_VARIABLE_DATA.VariableData value shall be the EFI_SIGNATURE_DATA value // from the EFI_SIGNATURE_LIST that contained the authority that was used to validate the image // VarNameLength = StrLen (VarName); VarLogSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize - sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData)); - VarLog = (EFI_VARIABLE_DATA_TREE *) AllocateZeroPool (VarLogSize); + VarLog = (UEFI_VARIABLE_DATA *) AllocateZeroPool (VarLogSize); if (VarLog == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c index 6ea3631b02..9aa16dc659 100644 --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c @@ -1787,7 +1787,7 @@ MeasureVariable ( EFI_STATUS Status; TCG_PCR_EVENT_HDR TcgEvent; UINTN VarNameLength; - EFI_VARIABLE_DATA_TREE *VarLog; + UEFI_VARIABLE_DATA *VarLog; DEBUG ((EFI_D_INFO, "Tcg2Dxe: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)PCRIndex, (UINTN)EventType)); DEBUG ((EFI_D_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid)); @@ -1799,7 +1799,7 @@ MeasureVariable ( TcgEvent.EventSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize - sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData)); - VarLog = (EFI_VARIABLE_DATA_TREE *)AllocatePool (TcgEvent.EventSize); + VarLog = (UEFI_VARIABLE_DATA *)AllocatePool (TcgEvent.EventSize); if (VarLog == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1822,7 +1822,7 @@ MeasureVariable ( if (EventType == EV_EFI_VARIABLE_DRIVER_CONFIG) { // - // Digest is the event data (EFI_VARIABLE_DATA) + // Digest is the event data (UEFI_VARIABLE_DATA) // Status = TcgDxeHashLogExtendEvent ( 0,