build without RADIUS-related headers if no acceptor
authorLuke Howard <lukeh@padl.com>
Tue, 13 Sep 2011 04:16:17 +0000 (14:16 +1000)
committerLuke Howard <lukeh@padl.com>
Tue, 13 Sep 2011 04:16:17 +0000 (14:16 +1000)
mech_eap/Makefile.am
mech_eap/gssapiP_eap.h
mech_eap/import_sec_context.c
mech_eap/util.h
mech_eap/util_radius.h

index 0214ca0..86b575e 100644 (file)
@@ -73,7 +73,6 @@ mech_eap_la_SOURCES =                         \
        store_cred.c                            \
        unwrap.c                                \
        unwrap_iov.c                            \
-       util_base64.c                           \
        util_buffer.c                           \
        util_context.c                          \
        util_cksum.c                            \
@@ -105,6 +104,7 @@ mech_eap_la_SOURCES +=                              \
        release_any_name_mapping.c              \
        set_name_attribute.c                    \
        util_attr.cpp                           \
+       util_base64.c                           \
        util_json.cpp                           \
        util_radius.cpp
 
index fcd4bab..b141032 100644 (file)
@@ -83,6 +83,7 @@ typedef const gss_OID_desc *gss_const_OID;
 #include <wpabuf.h>
 
 /* FreeRADIUS headers */
+#ifdef GSSEAP_ENABLE_ACCEPTOR
 #ifdef __cplusplus
 extern "C" {
 #define operator fr_operator
@@ -95,6 +96,7 @@ extern "C" {
 #undef operator
 }
 #endif
+#endif /* GSSEAP_ENABLE_ACCEPTOR */
 
 #include "gsseap_err.h"
 #include "radsec_err.h"
@@ -184,6 +186,7 @@ struct gss_eap_initiator_ctx {
     struct wpabuf reqData;
 };
 
+#ifdef GSSEAP_ENABLE_ACCEPTOR
 struct gss_eap_acceptor_ctx {
     struct rs_context *radContext;
     struct rs_connection *radConn;
@@ -191,6 +194,7 @@ struct gss_eap_acceptor_ctx {
     gss_buffer_desc state;
     VALUE_PAIR *vps;
 };
+#endif
 
 #ifdef HAVE_HEIMDAL_VERSION
 struct gss_ctx_id_t_desc_struct
@@ -215,8 +219,10 @@ struct gss_ctx_id_struct
     union {
         struct gss_eap_initiator_ctx initiator;
         #define initiatorCtx         ctxU.initiator
+#ifdef GSSEAP_ENABLE_ACCEPTOR
         struct gss_eap_acceptor_ctx  acceptor;
         #define acceptorCtx          ctxU.acceptor
+#endif
 #ifdef GSSEAP_ENABLE_REAUTH
         gss_ctx_id_t                 reauth;
         #define reauthCtx            ctxU.reauth
@@ -311,6 +317,10 @@ gssEapSaveStatusInfo(OM_uint32 minor, const char *format, ...);
 #define IS_WIRE_ERROR(err)              ((err) > GSSEAP_RESERVED && \
                                          (err) <= GSSEAP_RADIUS_PROT_FAILURE)
 
+/* upper bound of RADIUS error range must be kept in sync with radsec.h */
+#define IS_RADIUS_ERROR(err)            ((err) >= ERROR_TABLE_BASE_rse && \
+                                         (err) <= ERROR_TABLE_BASE_rse + 20)
+
 /* export_sec_context.c */
 OM_uint32
 gssEapExportSecContext(OM_uint32 *minor,
index 9d6ae3d..1b9c0ad 100644 (file)
@@ -48,6 +48,7 @@
         }                                       \
     } while (0)
 
+#ifdef GSSEAP_ENABLE_ACCEPTOR
 static OM_uint32
 gssEapImportPartialContext(OM_uint32 *minor,
                            unsigned char **pBuf,
@@ -113,6 +114,7 @@ gssEapImportPartialContext(OM_uint32 *minor,
 
     return GSS_S_COMPLETE;
 }
+#endif
 
 static OM_uint32
 importMechanismOid(OM_uint32 *minor,
@@ -304,6 +306,7 @@ gssEapImportContext(OM_uint32 *minor,
     if (GSS_ERROR(major))
         return major;
 
+#ifdef GSSEAP_ENABLE_ACCEPTOR
     /*
      * The partial context should only be expected for unestablished
      * acceptor contexts.
@@ -318,6 +321,7 @@ gssEapImportContext(OM_uint32 *minor,
 #ifdef GSSEAP_DEBUG
     assert(remain == 0);
 #endif
+#endif
 
     major = GSS_S_COMPLETE;
     *minor = 0;
index 04fa4b9..905916b 100644 (file)
@@ -960,9 +960,11 @@ gssBufferToKrbData(gss_buffer_t buffer, krb5_data *data)
 }
 #endif
 
+#ifdef GSSEAP_ENABLE_ACCEPTOR
 #include "util_json.h"
 #include "util_attr.h"
 #include "util_base64.h"
+#endif
 #ifdef GSSEAP_ENABLE_REAUTH
 #include "util_reauth.h"
 #endif
index 04e6fc5..da790ab 100644 (file)
@@ -170,9 +170,6 @@ gssEapRadiusMapError(OM_uint32 *minor,
 #define PW_SAML_AAA_ASSERTION               132
 #define PW_MS_WINDOWS_AUTH_DATA             133
 
-#define IS_RADIUS_ERROR(code)               ((code) >= ERROR_TABLE_BASE_rse && \
-                                             (code) <= ERROR_TABLE_BASE_rse + RSE_TIMEOUT_IO)
-
 #ifdef __cplusplus
 }
 #endif