From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1F5638221B for ; Fri, 3 Mar 2017 00:38:41 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2017 00:38:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,236,1484035200"; d="scan'208";a="71158361" Received: from czhan46-mobl1.ccr.corp.intel.com ([10.239.192.225]) by orsmga005.jf.intel.com with ESMTP; 03 Mar 2017 00:38:39 -0800 From: "Zhang, Chao B" To: edk2-devel@lists.01.org Cc: star.zeng@intel.com, jiewen.yao@intel.com, Chao Zhang Date: Fri, 3 Mar 2017 16:38:36 +0800 Message-Id: <20170303083836.37112-2-chao.b.zhang@intel.com> X-Mailer: git-send-email 2.11.0.windows.1 In-Reply-To: <20170303083836.37112-1-chao.b.zhang@intel.com> References: <20170303083836.37112-1-chao.b.zhang@intel.com> Subject: [PATCH 2/2] MdeModulePkg: Variable: Update DBT PCR[7] measure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 08:38:41 -0000 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 Cc: Yao Jiewen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang --- MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c index 0f1cb18..936b5b0 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 ( -- 1.9.5.msysgit.1