diff --git a/src/tss2-fapi/fapi_int.h b/src/tss2-fapi/fapi_int.h index 8615cf224..a55e5def2 100644 --- a/src/tss2-fapi/fapi_int.h +++ b/src/tss2-fapi/fapi_int.h @@ -129,7 +129,8 @@ 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 + auth_session == 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 38ea53933..f78b3e408 100644 --- a/src/tss2-fapi/fapi_util.c +++ b/src/tss2-fapi/fapi_util.c @@ -2150,6 +2150,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; }