From 368110120b8266f70924dd15a6d09afcb58767b7 Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Wed, 15 Jul 2015 02:13:22 +0000 Subject: [PATCH] SecurityPkg: Correct BootOrder/Boot#### measurement behavior Correct the variable measurement behavior to include whole EFI_VARIABLE_DATA structure. It is for the latest spec compliance Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang Reviewed-by: Qin Long git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17980 6f19259b-4bc3-4df7-8a09-765794883524 --- SecurityPkg/Tcg/TcgDxe/TcgDxe.c | 4 ++-- SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c | 28 ++++++++-------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c index f15e94353c..4b9afe34a4 100644 --- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c +++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c @@ -959,8 +959,8 @@ MeasureVariable ( Status = TcgDxeHashLogExtendEventI ( &mTcgDxeData, - (UINT8*)VarData, - VarSize, + (UINT8*)VarLog, + TcgEvent.EventSize, &TcgEvent, (UINT8*)VarLog ); diff --git a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c index 6126bd8761..582f09f99f 100644 --- a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c +++ b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c @@ -1206,26 +1206,14 @@ MeasureVariable ( ); } - if (EventType == EV_EFI_VARIABLE_DRIVER_CONFIG) { - // - // Digest is the event data (EFI_VARIABLE_DATA_TREE) - // - Status = TcgDxeHashLogExtendEvent ( - 0, - (UINT8*)VarLog, - TcgEvent.EventSize, - &TcgEvent, - (UINT8*)VarLog - ); - } else { - Status = TcgDxeHashLogExtendEvent ( - 0, - (UINT8*)VarData, - VarSize, - &TcgEvent, - (UINT8*)VarLog - ); - } + Status = TcgDxeHashLogExtendEvent ( + 0, + (UINT8*)VarLog, + TcgEvent.EventSize, + &TcgEvent, + (UINT8*)VarLog + ); + FreePool (VarLog); return Status; } -- 2.39.2