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

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