add some state machine prototypes
authorLuke Howard <lukeh@padl.com>
Wed, 8 Sep 2010 19:35:12 +0000 (21:35 +0200)
committerLuke Howard <lukeh@padl.com>
Wed, 8 Sep 2010 19:35:12 +0000 (21:35 +0200)
mech_eap/gssapiP_eap.h
mech_eap/init_sec_context.c
mech_eap/util_context.c

index 267235a..f6da260 100644 (file)
@@ -120,10 +120,34 @@ struct eap_gss_initiator_ctx {
     struct eap_sm *eap;
 };
 
+typedef OM_uint32 (*eap_gss_initiator_sm)(OM_uint32 *,
+                                          gss_cred_id_t,
+                                          gss_ctx_id_t *,
+                                          gss_OID,
+                                          OM_uint32,
+                                          OM_uint32,
+                                          gss_channel_bindings_t,
+                                          gss_buffer_t,
+                                          gss_OID *,
+                                          gss_buffer_t,
+                                          OM_uint32 *,
+                                          OM_uint32 *);
+
 /* Acceptor context flags */
 struct eap_gss_acceptor_ctx {
 };
 
+typedef OM_uint32 (*eap_gss_acceptor_sm)(OM_uint32 *,
+                                         gss_ctx_id_t *,
+                                         gss_cred_id_t,
+                                         gss_buffer_t,
+                                         gss_channel_bindings_t,
+                                         gss_name_t *,
+                                         gss_buffer_t,
+                                         OM_uint32 *,
+                                         OM_uint32 *,
+                                         gss_cred_id_t *);
+
 struct gss_ctx_id_struct {
     GSSEAP_MUTEX mutex;
     enum eap_gss_state state;
index cb20f20..51528d6 100644 (file)
@@ -154,5 +154,15 @@ gss_init_sec_context(OM_uint32 *minor,
                      OM_uint32 *ret_flags,
                      OM_uint32 *time_rec)
 {
-    GSSEAP_NOT_IMPLEMENTED;
+    OM_uint32 major, tmpMinor;
+    gss_ctx_id_t ctx = *pCtx;
+
+    if (ctx == GSS_C_NO_CONTEXT) {
+    }
+
+cleanup:
+    if (GSS_ERROR(major))
+        gssEapReleaseContext(&tmpMinor, &ctx);
+
+    return major;
 }
index b6dec71..33324de 100644 (file)
@@ -53,6 +53,8 @@ gssEapAllocContext(OM_uint32 *minor,
         return GSS_S_FAILURE;
     }
 
+    ctx->state = EAP_STATE_AUTHENTICATE;
+
     *pCtx = ctx;
 
     return GSS_S_COMPLETE;