Merge branch 'master' into tlv-mic
[moonshot.git] / mech_eap / util_sm.c
index 72d5cf4..3bb28b8 100644 (file)
@@ -125,7 +125,7 @@ recordErrorToken(OM_uint32 *minor,
     errorBuffer.length = sizeof(errorData);
     errorBuffer.value = errorData;
 
-    return gssEapRecordInnerContextToken(minor, ctx, &errorBuffer, 
+    return gssEapRecordInnerContextToken(minor, ctx, &errorBuffer,
                                          ITOK_TYPE_CONTEXT_ERR | ITOK_FLAG_CRITICAL);
 }
 
@@ -321,14 +321,17 @@ gssEapSmStep(OM_uint32 *minor,
             /*
              * Break out if we made a state transition and have some tokens to send.
              */
-            if ((smFlags & SM_FLAG_TRANSITED) &&
-                 ((smFlags & SM_FLAG_FORCE_SEND_TOKEN) || innerOutputTokenCount != 0)) {
+            if (smFlags & SM_FLAG_SEND_TOKEN) {
                 SM_ASSERT_VALID(ctx, major);
                 break;
             }
         } else if ((smp->itokFlags & SM_ITOK_FLAG_REQUIRED) &&
             smp->inputTokenType != ITOK_TYPE_NONE) {
             /* Check for required inner tokens */
+#ifdef GSSEAP_DEBUG
+            fprintf(stderr, "GSS-EAP: missing required token %08X\n",
+                    smp->inputTokenType);
+#endif
             major = GSS_S_DEFECTIVE_TOKEN;
             *minor = GSSEAP_MISSING_REQUIRED_ITOK;
             break;