Skip to content

Commit 69442c2

Browse files
FAPI: Fix session cleanup.
The session cleanup in error cases tried to flush a password session. Fixes: #2735 Signed-off-by: Juergen Repp <juergen_repp@web.de>
1 parent 166a553 commit 69442c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tss2-fapi/fapi_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ ifapi_session_clean(FAPI_CONTEXT *context)
12041204
if (context->policy_session && context->policy_session != ESYS_TR_NONE) {
12051205
Esys_FlushContext(context->esys, context->policy_session);
12061206
}
1207-
if (context->session1 != ESYS_TR_NONE) {
1207+
if (context->session1 != ESYS_TR_NONE && context->session1 != ESYS_TR_PASSWORD) {
12081208
if (context->session1 == context->session2) {
12091209
context->session2 = ESYS_TR_NONE;
12101210
}
@@ -1213,7 +1213,7 @@ ifapi_session_clean(FAPI_CONTEXT *context)
12131213
}
12141214
context->session1 = ESYS_TR_NONE;
12151215
}
1216-
if (context->session2 != ESYS_TR_NONE) {
1216+
if (context->session2 != ESYS_TR_NONE && context->policy_session != ESYS_TR_NONE) {
12171217
if (Esys_FlushContext(context->esys, context->session2) != TSS2_RC_SUCCESS) {
12181218
LOG_ERROR("Cleanup session failed.");
12191219
context->session2 = ESYS_TR_NONE;

0 commit comments

Comments
 (0)