From d9e206d4bf9124fe526baaa0ec56a7d2316ca6b3 Mon Sep 17 00:00:00 2001 From: "Zhang, Chao B" Date: Sat, 21 Jul 2018 11:20:24 +0800 Subject: [PATCH] MdeModulePkg: TpmMeasureLib: Re-prioritize TCG/TCG2 protocol 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 Reviewed-by: Yao, Jiewen --- .../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 @@ -184,21 +184,22 @@ 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, -- 2.39.2