From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=chao.b.zhang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 89DAE210BFF58 for ; Fri, 20 Jul 2018 20:31:41 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2018 20:31:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,382,1526367600"; d="scan'208";a="76597039" Received: from czhan46-mobl1.ccr.corp.intel.com ([10.249.168.149]) by orsmga002.jf.intel.com with ESMTP; 20 Jul 2018 20:31:39 -0700 From: "Zhang, Chao B" To: edk2-devel@lists.01.org Cc: Long, Qin , Yao, Jiewen Date: Sat, 21 Jul 2018 11:31:32 +0800 Message-Id: <20180721033132.19752-3-chao.b.zhang@intel.com> X-Mailer: git-send-email 2.11.0.windows.1 In-Reply-To: <20180721033132.19752-1-chao.b.zhang@intel.com> References: <20180721033132.19752-1-chao.b.zhang@intel.com> Subject: [Patch 2/2] MdeModulePkg: TpmMeasureLib: Re-prioritize TCG/TCG2 protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2018 03:31:41 -0000 TPM1.2 is obsoleted by TPM2.0. switch TCG/TCG2 protocol check to apply this trend Cc: Long, Qin Cc: Yao, Jiewen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhang, Chao B --- .../DxeTpmMeasurementLib/DxeTpmMeasurementLib.c | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c index 8c56a713d8..3aa034851d 100644 --- a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c +++ b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c @@ -182,25 +182,26 @@ TpmMeasureAndLogData ( ) { EFI_STATUS Status; // - // Try to measure using Tpm1.2 protocol + // Try to measure using Tpm20 protocol // - Status = Tpm12MeasureAndLogData( - PcrIndex, - EventType, - EventLog, - LogLen, - HashData, - HashDataLen - ); + Status = Tpm20MeasureAndLogData( + PcrIndex, + EventType, + EventLog, + LogLen, + HashData, + HashDataLen + ); + if (EFI_ERROR (Status)) { // - // Try to measure using Tpm20 protocol + // Try to measure using Tpm1.2 protocol // - Status = Tpm20MeasureAndLogData( + Status = Tpm12MeasureAndLogData( PcrIndex, EventType, EventLog, LogLen, HashData, -- 2.16.2.windows.1