X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=util_sm.c;h=339d397b0454bda4e866500a9513861af686c248;hb=049caec86c34a751def0312b94fbfe8257bc2f04;hp=ae687ba5e97c42a0d2014d03564b3801a95e95e6;hpb=99dd54f0a504f1cde0dc61519c55d8b5d9bffcb1;p=mech_eap.orig diff --git a/util_sm.c b/util_sm.c index ae687ba..339d397 100644 --- a/util_sm.c +++ b/util_sm.c @@ -382,7 +382,7 @@ gssEapSmStep(OM_uint32 *minor, /* Format output token from inner tokens */ if (innerOutputTokens->count != 0 || /* inner tokens to send */ !CTX_IS_INITIATOR(ctx) || /* any leg acceptor */ - ctx->state != GSSEAP_STATE_ESTABLISHED) { /* non-last leg initiator */ + !CTX_IS_ESTABLISHED(ctx)) { /* non-last leg initiator */ tmpMajor = gssEapEncodeInnerTokens(&tmpMinor, innerOutputTokens, outputTokenTypes, &unwrappedOutputToken); if (tmpMajor == GSS_S_COMPLETE) { @@ -396,6 +396,9 @@ gssEapSmStep(OM_uint32 *minor, } } + /* If the context is established, empty tokens only to be emitted by initiator */ + assert(!CTX_IS_ESTABLISHED(ctx) || ((outputToken->length == 0) == CTX_IS_INITIATOR(ctx))); + SM_ASSERT_VALID(ctx, major); cleanup: