cleanup some symbolic constants
[mech_eap.orig] / gssapiP_eap.h
index 29d43f7..aa0a9c4 100644 (file)
@@ -34,6 +34,7 @@
 #define _GSSAPIP_EAP_H_ 1
 
 #include "config.h"
+
 #include <assert.h>
 #include <string.h>
 #include <errno.h>
 #include <time.h>
 #include <sys/param.h>
 
-/* GSS includes */
+/* GSS headers */
 #include <gssapi/gssapi.h>
 #include <gssapi/gssapi_krb5.h>
 #include <gssapi/gssapi_ext.h>
 #include "gssapi_eap.h"
 
-/* Kerberos includes */
+/* Kerberos headers */
 #include <krb5.h>
 
-/* EAP includes (not C++ clean) */
-#ifndef __cplusplus
+/* EAP headers */
 #include <common.h>
 #include <eap_peer/eap.h>
 #include <eap_peer/eap_config.h>
-#include <crypto/tls.h>
+#include <eap_peer/eap_methods.h>
 #include <wpabuf.h>
-#endif
 
-/* Workaround for FreeRADIUS not being C++ clean */
+/* FreeRADIUS headers */
 #ifdef __cplusplus
 extern "C" {
 #define operator fr_operator
@@ -68,11 +67,14 @@ extern "C" {
 #include <freeradius/libradius.h>
 #include <freeradius/radius.h>
 #include <radsec/radsec.h>
+#include <radsec/request.h>
 #ifdef __cplusplus
 #undef operator
 }
 #endif
 
+#include "gsseap_err.h"
+#include "radsec_err.h"
 #include "util.h"
 
 #ifdef __cplusplus
@@ -117,22 +119,23 @@ struct gss_cred_id_struct {
 };
 
 #define CTX_FLAG_INITIATOR                  0x00000001
-#define CTX_FLAG_KRB_REAUTH_GSS             0x00000002
+#define CTX_FLAG_KRB_REAUTH                 0x00000002
 
 #define CTX_IS_INITIATOR(ctx)               (((ctx)->flags & CTX_FLAG_INITIATOR) != 0)
 
 enum gss_eap_state {
-    EAP_STATE_IDENTITY = 0,
-    EAP_STATE_AUTHENTICATE,
-    EAP_STATE_EXTENSIONS_REQ,
-    EAP_STATE_EXTENSIONS_RESP,
-    EAP_STATE_ESTABLISHED,
+    GSSEAP_STATE_IDENTITY = 0,
+    GSSEAP_STATE_AUTHENTICATE,
+    GSSEAP_STATE_EXTENSIONS_REQ,
+    GSSEAP_STATE_EXTENSIONS_RESP,
+    GSSEAP_STATE_ESTABLISHED,
+    GSSEAP_STATE_ERROR,
 #ifdef GSSEAP_ENABLE_REAUTH
-    EAP_STATE_KRB_REAUTH_GSS
+    GSSEAP_STATE_KRB_REAUTH
 #endif
 };
 
-#define CTX_IS_ESTABLISHED(ctx)             ((ctx)->state == EAP_STATE_ESTABLISHED)
+#define CTX_IS_ESTABLISHED(ctx)             ((ctx)->state == GSSEAP_STATE_ESTABLISHED)
 
 /* Initiator context flags */
 #define CTX_FLAG_EAP_SUCCESS                0x00010000
@@ -157,7 +160,7 @@ struct gss_eap_initiator_ctx {
 };
 
 struct gss_eap_acceptor_ctx {
-    struct rs_handle *radHandle;
+    struct rs_context *radContext;
     struct rs_connection *radConn;
     char *radServer;
     gss_buffer_desc state;
@@ -198,7 +201,6 @@ struct gss_ctx_id_struct {
 #define KEY_USAGE_ACCEPTOR_SIGN             23
 #define KEY_USAGE_INITIATOR_SEAL            24
 #define KEY_USAGE_INITIATOR_SIGN            25
-#define KEY_USAGE_CHANNEL_BINDINGS          64
 
 /* wrap_iov.c */
 OM_uint32