diff --git a/src/tss2-fapi/fapi_int.h b/src/tss2-fapi/fapi_int.h index a9a542420..b172bb31c 100644 --- a/src/tss2-fapi/fapi_int.h +++ b/src/tss2-fapi/fapi_int.h @@ -129,7 +129,7 @@ typedef struct { #define ENC_SESSION_IF_POLICY(auth_session) \ (auth_session == ESYS_TR_PASSWORD || auth_session == ESYS_TR_NONE || \ - auth_session == context->session2) ? ESYS_TR_NONE : context->session2 + !context->session2) ? ESYS_TR_NONE : context->session2 /** The states for the FAPI's object authorization state*/ enum IFAPI_GET_CERT_STATE { diff --git a/src/tss2-fapi/fapi_util.c b/src/tss2-fapi/fapi_util.c index 27362f85d..f67d398c3 100644 --- a/src/tss2-fapi/fapi_util.c +++ b/src/tss2-fapi/fapi_util.c @@ -2177,6 +2177,7 @@ ifapi_authorize_object(FAPI_CONTEXT *context, IFAPI_OBJECT *object, ESYS_TR *ses else /* Use password session if session1 had not been created */ *session = ESYS_TR_PASSWORD; + context->session2 = ESYS_TR_NONE; break; }