fallback to paircreate() if dictionary lookup fails
[mech_eap.orig] / util.h
diff --git a/util.h b/util.h
index ec80a20..2a3f66e 100644 (file)
--- a/util.h
+++ b/util.h
@@ -154,7 +154,8 @@ enum gss_eap_token_type {
     TOK_TYPE_EXPORT_NAME             = 0x0401,  /* RFC 2743 exported name */
     TOK_TYPE_EXPORT_NAME_COMPOSITE   = 0x0402,  /* exported composite name */
     TOK_TYPE_DELETE_CONTEXT          = 0x0405,  /* RFC 2743 delete context */
-    TOK_TYPE_ESTABLISH_CONTEXT       = 0x0601,  /* establish context */
+    TOK_TYPE_INITIATOR_CONTEXT       = 0x0601,  /* initiator-sent context token */
+    TOK_TYPE_ACCEPTOR_CONTEXT        = 0x0602,  /* acceptor-sent context token */
 };
 
 /* inner token types and flags */
@@ -546,6 +547,8 @@ enum gss_eap_state {
 
 #define GSSEAP_STATE_NEXT(s)    ((s) << 1)
 
+#define GSSEAP_SM_STATE(ctx)                ((ctx)->state)
+
 #ifdef GSSEAP_DEBUG
 void gssEapSmTransition(gss_ctx_id_t ctx, enum gss_eap_state state);
 #define GSSEAP_SM_TRANSITION(ctx, state)    gssEapSmTransition((ctx), (state))
@@ -553,7 +556,7 @@ void gssEapSmTransition(gss_ctx_id_t ctx, enum gss_eap_state state);
 #define GSSEAP_SM_TRANSITION(ctx, state)    do { (ctx)->state = (state); } while (0)
 #endif
 
-#define GSSEAP_SM_TRANSITION_NEXT(ctx)      GSSEAP_SM_TRANSITION((ctx), GSSEAP_STATE_NEXT((ctx)->state))
+#define GSSEAP_SM_TRANSITION_NEXT(ctx)      GSSEAP_SM_TRANSITION((ctx), GSSEAP_STATE_NEXT(GSSEAP_SM_STATE((ctx))))
 
 /* state machine entry */
 struct gss_eap_sm {
@@ -574,11 +577,14 @@ struct gss_eap_sm {
                               OM_uint32 *);
 };
 
-#define SM_FLAG_FORCE_SEND_TOKEN            0x00000001  /* send token even if empty */
-#define SM_FLAG_STOP_EVAL                   0x00000002  /* no more handlers for this state */
+/* state machine flags, set by handler */
+#define SM_FLAG_FORCE_SEND_TOKEN            0x00000001  /* send token even if no inner tokens */
+#define SM_FLAG_OUTPUT_TOKEN_CRITICAL       0x00000002  /* output token is critical */
+
+/* state machine flags, set by state machine */
+#define SM_FLAG_INPUT_TOKEN_CRITICAL        0x10000000  /* input token was critical */
 
-#define SM_ITOK_FLAG_CRITICAL               0x00000001  /* sent tokens marked critical */
-#define SM_ITOK_FLAG_REQUIRED               0x00000002  /* received tokens must be present */
+#define SM_ITOK_FLAG_REQUIRED               0x00000001  /* received tokens must be present */
 
 OM_uint32
 gssEapSmStep(OM_uint32 *minor,