Blame SOURCES/0041-tpm-Don-t-log-duplicate-identical-events.patch

6a35ff
From 58df8d745c6516818ba6ebfa8fe826702c1621a0 Mon Sep 17 00:00:00 2001
6a35ff
From: Chris Coulson <chris.coulson@canonical.com>
6a35ff
Date: Thu, 26 Sep 2019 20:01:01 +0100
6a35ff
Subject: [PATCH 41/62] tpm: Don't log duplicate identical events
6a35ff
6a35ff
According to the comment in tpm_measure_variable ("Don't measure something that we've already measured"), shim
6a35ff
shouldn't measure duplicate events if they are identical, which also aligns with section 2.3.4.8 of the TCG PC
6a35ff
Client Platform Firmware Profile Specification ("If it has been measured previously, it MUST NOT be measured
6a35ff
again"). This is currently broken because tpm_data_measured() uses the return value of CompareGuid() incorrectly.
6a35ff
6a35ff
Upstream-commit-id: 103adc89ce5
6a35ff
---
6a35ff
 tpm.c | 2 +-
6a35ff
 1 file changed, 1 insertion(+), 1 deletion(-)
6a35ff
6a35ff
diff --git a/tpm.c b/tpm.c
6a35ff
index c0617bb479e..196b93c30f6 100644
6a35ff
--- a/tpm.c
6a35ff
+++ b/tpm.c
6a35ff
@@ -241,7 +241,7 @@ static BOOLEAN tpm_data_measured(CHAR16 *VarName, EFI_GUID VendorGuid, UINTN Var
6a35ff
 
6a35ff
 	for (i=0; i
6a35ff
 		if ((StrCmp (VarName, measureddata[i].VariableName) == 0) &&
6a35ff
-		    (CompareGuid (&VendorGuid, measureddata[i].VendorGuid)) &&
6a35ff
+		    (CompareGuid (&VendorGuid, measureddata[i].VendorGuid) == 0) &&
6a35ff
 		    (VarSize == measureddata[i].Size) &&
6a35ff
 		    (CompareMem (VarData, measureddata[i].Data, VarSize) == 0)) {
6a35ff
 			return TRUE;
6a35ff
-- 
6a35ff
2.26.2
6a35ff