Blame SOURCES/0023-SAPI-fix-number-of-handles-for-FlushContext.patch

897056
From ecfc3b4c1e9a59c6a230398bced24118d19ea099 Mon Sep 17 00:00:00 2001
897056
From: William Roberts <william.c.roberts@intel.com>
897056
Date: Thu, 7 Jul 2022 09:00:19 -0500
897056
Subject: [PATCH 23/23] SAPI: fix number of handles for FlushContext
897056
897056
The lookup table for the number of command handles for
897056
Tss2_Sys_FlushContext has the count set to 1, when in reality the
897056
command takes no handles in the handle area but a handle as the input
897056
parameter. This works currently because handles and parameters are just
897056
concatenated and the parsing logic on the TPM just unpacks them, so in
897056
this case, thet're in the same spot with the same value. This goes
897056
unnoticed until you call Tss2_Sys_GetCpBuffer and the buffer is empty as
897056
the logic things its a handle in the handle area and not a handle in the
897056
parameter area.
897056
897056
Signed-off-by: William Roberts <william.c.roberts@intel.com>
897056
---
897056
 src/tss2-sys/sysapi_util.c | 2 +-
897056
 1 file changed, 1 insertion(+), 1 deletion(-)
897056
897056
diff --git a/src/tss2-sys/sysapi_util.c b/src/tss2-sys/sysapi_util.c
897056
index d84acc5d..a92f47a2 100644
897056
--- a/src/tss2-sys/sysapi_util.c
897056
+++ b/src/tss2-sys/sysapi_util.c
897056
@@ -262,7 +262,7 @@ static int GetNumHandles(TPM2_CC commandCode, bool req)
897056
         { TPM2_CC_FirmwareRead, 0, 0 },
897056
         { TPM2_CC_ContextSave, 1, 0 },
897056
         { TPM2_CC_ContextLoad, 0, 1 },
897056
-        { TPM2_CC_FlushContext, 1, 0 },
897056
+        { TPM2_CC_FlushContext, 0, 0 },
897056
         { TPM2_CC_EvictControl, 2, 0 },
897056
         { TPM2_CC_ReadClock, 0, 0 },
897056
         { TPM2_CC_ClockSet, 1, 0 },
897056
-- 
897056
2.34.3
897056