From: Zhang, Chao B Date: Sat, 21 Jul 2018 03:20:24 +0000 (+0800) Subject: MdeModulePkg: TpmMeasureLib: Re-prioritize TCG/TCG2 protocol X-Git-Tag: edk2-stable201903~1373 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=d9e206d4bf9124fe526baaa0ec56a7d2316ca6b3 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 --- 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,