Refactor
[mech_eap.orig] / gssapiP_eap.h
index 6ab69df..2483924 100644 (file)
 /* Kerberos includes */
 #include <krb5.h>
 
+#define NAME_FLAG_NAI                       0x00000001
+#define NAME_FLAG_SERVICE                   0x00000002
+#define NAME_FLAG_SAML                      0x00000010
+#define NAME_FLAG_RADIUS                    0x00000020
+
+#define NAME_HAS_ATTRIBUTES(name)           ((name)->flags & \
+                                             (NAME_FLAG_SAML | NAME_FLAG_RADIUS))
+
+struct eap_gss_saml_assertion;
+struct eap_gss_avp_list;
+
 struct gss_name_struct {
-    GSSEAP_MUTEX mutex;
+    GSSEAP_MUTEX mutex; /* mutex protecting attributes */
     OM_uint32 flags;
-    krb5_principal kerberosName;
-    void *aaa;
-    void *assertion;
+    krb5_principal krbPrincipal; /* this is immutable */
+    struct eap_gss_saml_assertion *assertion;
+    struct eap_gss_avp_list *avps;
 };
 
-#define CRED_FLAG_INITIATOR                 0x00000001
-#define CRED_FLAG_ACCEPTOR                  0x00000002
+#define CRED_FLAG_INITIAT                 0x00000001
+#define CRED_FLAG_ACCEPT                    0x00000002
 #define CRED_FLAG_DEFAULT_IDENTITY          0x00000004
 #define CRED_FLAG_PASSWORD                  0x00000008
 
@@ -73,6 +84,7 @@ struct gss_cred_id_struct {
     OM_uint32 flags;
     gss_name_t name;
     gss_buffer_desc password;
+    gss_OID_set mechanisms;
     time_t expiryTime;
 };
 
@@ -81,7 +93,7 @@ struct gss_cred_id_struct {
 #define CTX_IS_INITIATOR(ctx)               (((ctx)->flags & CTX_FLAG_INITIATOR) != 0)
 
 enum eap_gss_state {
-    EAP_STATE_AUTHENTICATE = 1,
+    EAP_STATE_AUTHENTICATE = 0,
     EAP_STATE_KEY_TRANSPORT,
     EAP_STATE_SECURE_ASSOCIATION,
     EAP_STATE_GSS_CHANNEL_BINDINGS,