don't fail hard if reauth cred generation fails
[mech_eap.orig] / gssapiP_eap.h
index b53e131..b7740da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 #include "config.h"
 
+#ifdef HAVE_HEIMDAL_VERSION
+#define KRB5_DEPRECATED         /* so we can use krb5_free_unparsed_name() */
+#endif
+
 #include <assert.h>
 #include <string.h>
 #include <errno.h>
@@ -59,6 +63,7 @@
 #include <eap_peer/eap.h>
 #include <eap_peer/eap_config.h>
 #include <eap_peer/eap_methods.h>
+#include <eap_common/eap_common.h>
 #include <wpabuf.h>
 
 /* FreeRADIUS headers */
@@ -135,18 +140,6 @@ struct gss_cred_id_struct
 
 #define CTX_IS_INITIATOR(ctx)               (((ctx)->flags & CTX_FLAG_INITIATOR) != 0)
 
-enum gss_eap_state {
-    GSSEAP_STATE_IDENTITY = 0,              /* identify peer */
-    GSSEAP_STATE_AUTHENTICATE,              /* exchange EAP messages */
-    GSSEAP_STATE_EXTENSIONS_REQ,            /* initiator extensions */
-    GSSEAP_STATE_EXTENSIONS_RESP,           /* acceptor extensions */
-    GSSEAP_STATE_ESTABLISHED,               /* context established */
-    GSSEAP_STATE_ERROR,                     /* context error */
-#ifdef GSSEAP_ENABLE_REAUTH
-    GSSEAP_STATE_KRB_REAUTH                 /* fast reauthentication */
-#endif
-};
-
 #define CTX_IS_ESTABLISHED(ctx)             ((ctx)->state == GSSEAP_STATE_ESTABLISHED)
 
 /* Initiator context flags */
@@ -162,7 +155,6 @@ enum gss_eap_state {
 #define CTX_FLAG_EAP_MASK                   0xFFFF0000
 
 struct gss_eap_initiator_ctx {
-    gss_cred_id_t defaultCred;
     unsigned int idleWhile;
 #ifndef __cplusplus
     struct eap_peer_config eapPeerConfig;
@@ -198,6 +190,7 @@ struct gss_ctx_id_struct
     time_t expiryTime;
     uint64_t sendSeq, recvSeq;
     void *seqState;
+    gss_cred_id_t defaultCred;
     union {
         struct gss_eap_initiator_ctx initiator;
         #define initiatorCtx         ctxU.initiator