summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang, Chao B <chao.b.zhang@intel.com>2017-03-03 13:59:57 +0800
committerZhang, Chao B <chao.b.zhang@intel.com>2017-03-06 09:58:58 +0800
commit588bb5ae52edc99aef6fcb68c31ce0882f0e5c3c (patch)
treece719693de3f8be0db8e19e519b324da67283b0d
parent400b0940c8295f4cba44da3fa3e589f663f60de2 (diff)
downloadedk2-588bb5ae52edc99aef6fcb68c31ce0882f0e5c3c.tar.gz
edk2-588bb5ae52edc99aef6fcb68c31ce0882f0e5c3c.tar.bz2
edk2-588bb5ae52edc99aef6fcb68c31ce0882f0e5c3c.zip
MdeModulePkg: Variable: Update DBT PCR[7] measure
Measure DBT into PCR[7] when it is updated between initial measure if present and not empty. by following TCG PC Client PFP 00.49 Previous patch for PCR[7] DBT part is overrode. dc9bd6ed281fcba5358f3004632bdbda968be1e5 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>
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c
index 0f1cb18bac..936b5b00a3 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c
@@ -242,8 +242,17 @@ SecureBootHook (
&VariableDataSize
);
if (EFI_ERROR (Status)) {
- VariableData = NULL;
- VariableDataSize = 0;
+ //
+ // Measure DBT only if present and not empty
+ //
+ if (StrCmp (VariableName, EFI_IMAGE_SECURITY_DATABASE2) == 0 &&
+ CompareGuid (VendorGuid, &gEfiImageSecurityDatabaseGuid)) {
+ DEBUG((DEBUG_INFO, "Skip measuring variable %s since it's deleted\n", EFI_IMAGE_SECURITY_DATABASE2));
+ return;
+ } else {
+ VariableData = NULL;
+ VariableDataSize = 0;
+ }
}
Status = MeasureVariable (