X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.git;a=blobdiff_plain;f=mech_eap%2Futil_radius.h;h=d4f86ec430fb8c3315f099a0bd515dacd5564576;hp=ebd348bcaa35ee4e0a1e4297b35efb1da93d7205;hb=HEAD;hpb=32c7cb5841cb87eb434b1a802f0032b2b71c7d17 diff --git a/mech_eap/util_radius.h b/mech_eap/util_radius.h index ebd348b..d4f86ec 100644 --- a/mech_eap/util_radius.h +++ b/mech_eap/util_radius.h @@ -39,6 +39,10 @@ #ifdef __cplusplus +typedef std::pair gss_eap_attrid; +#ifdef GSSEAP_ENABLE_ACCEPTOR + + struct gss_eap_radius_attr_provider : gss_eap_attr_provider { public: gss_eap_radius_attr_provider(void); @@ -72,26 +76,18 @@ public: JSONObject &obj); JSONObject jsonRepresentation(void) const; - bool getAttribute(uint32_t attribute, - int *authenticated, - int *complete, - gss_buffer_t value, - gss_buffer_t display_value, - int *more) const; - bool getAttribute(uint16_t attribute, - uint16_t vendor, + bool getAttribute(const gss_eap_attrid &attrid, int *authenticated, int *complete, gss_buffer_t value, gss_buffer_t display_value, int *more) const; bool setAttribute(int complete, - uint32_t attribute, + const gss_eap_attrid &attrid, const gss_buffer_t value); - bool deleteAttribute(uint32_t attribute); + bool deleteAttribute(const gss_eap_attrid &attrid); - bool getFragmentedAttribute(uint16_t attribute, - uint16_t vendor, + bool getFragmentedAttribute(const gss_eap_attrid &attrid, int *authenticated, int *complete, gss_buffer_t value) const; @@ -106,42 +102,46 @@ public: static gss_eap_attr_provider *createAttrContext(void); private: - const VALUE_PAIR *getAvps(void) const { + rs_const_avp *getAvps(void) const { return m_vps; } - VALUE_PAIR *m_vps; + rs_avp *m_vps; bool m_authenticated; }; +#endif /* GSSEAP_ENABLE_ACCEPTOR */ + /* For now */ extern "C" { #endif +#ifdef GSSEAP_ENABLE_ACCEPTOR + OM_uint32 gssEapRadiusAddAvp(OM_uint32 *minor, - VALUE_PAIR **vp, - uint16_t type, - uint16_t vendor, + struct rs_packet *pkt, + unsigned int type, + unsigned int vendor, const gss_buffer_t buffer); OM_uint32 gssEapRadiusGetAvp(OM_uint32 *minor, - VALUE_PAIR *vps, - uint16_t type, - uint16_t vendor, + struct rs_packet *pkt, + unsigned int type, + unsigned int vendor, gss_buffer_t buffer, int concat); OM_uint32 gssEapRadiusGetRawAvp(OM_uint32 *minor, - VALUE_PAIR *vps, - uint16_t type, - uint16_t vendor, - VALUE_PAIR **vp); + rs_const_avp *vps, + unsigned int type, + unsigned int vendor, + rs_const_avp **vp); OM_uint32 gssEapRadiusFreeAvps(OM_uint32 *minor, - VALUE_PAIR **vps); + rs_avp **vps); OM_uint32 gssEapRadiusAttrProviderInit(OM_uint32 *minor); OM_uint32 gssEapRadiusAttrProviderFinalize(OM_uint32 *minor); @@ -150,23 +150,25 @@ OM_uint32 gssEapRadiusMapError(OM_uint32 *minor, struct rs_error *err); -#define RS_CONFIG_FILE SYSCONFDIR "/radsec.conf" - -#define VENDORPEC_MS 311 /* RFC 2548 */ +OM_uint32 +gssEapCreateRadiusContext(OM_uint32 *minor, + gss_cred_id_t cred, + struct rs_context **pRadContext); -#define PW_MS_MPPE_SEND_KEY 16 -#define PW_MS_MPPE_RECV_KEY 17 +#endif /* GSSEAP_ENABLE_ACCEPTOR */ -#define VENDORPEC_UKERNA 25622 +/* initiator utilities that require only libeap, and not freeradius */ +struct wpabuf; -#define PW_GSS_ACCEPTOR_SERVICE_NAME 128 -#define PW_GSS_ACCEPTOR_HOST_NAME 129 -#define PW_GSS_ACCEPTOR_SERVICE_SPECIFIC 130 -#define PW_GSS_ACCEPTOR_REALM_NAME 131 -#define PW_SAML_AAA_ASSERTION 132 +OM_uint32 +gssEapRadiusAddAttr(OM_uint32 *minor, + struct wpabuf **dst, + uint16_t type, + uint16_t vendor, + gss_buffer_t value); -#define IS_RADIUS_ERROR(code) ((code) >= ERROR_TABLE_BASE_rse && \ - (code) <= ERROR_TABLE_BASE_rse + RSE_TIMEOUT_IO) +/* This really needs to be a function call on Windows */ +#define RS_CONFIG_FILE SYSCONFDIR "/radsec.conf" #ifdef __cplusplus }