X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=util_radius.h;h=c505b2a1f38de451e6576de0f378492ca5296cef;hb=4866125c4be79ec72fc388eabba01505786850b4;hp=1da66f23060a259e2de3d0fd80d0466f0adce88a;hpb=0dbffe887f9d0c5c712689575df07e364f2cddee;p=mech_eap.git diff --git a/util_radius.h b/util_radius.h index 1da66f2..c505b2a 100644 --- a/util_radius.h +++ b/util_radius.h @@ -66,67 +66,101 @@ public: bool initFromBuffer(const gss_eap_attr_ctx *ctx, const gss_buffer_t buffer); - bool getAttribute(unsigned int attribute, + 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, + int *authenticated, + int *complete, + gss_buffer_t value, + gss_buffer_t display_value, + int *more) const; + + bool getFragmentedAttribute(uint16_t attribute, + uint16_t vendor, + int *authenticated, + int *complete, + gss_buffer_t value) const; - bool authenticated() const { return m_authenticated; } + bool authenticated(void) const { return m_authenticated; } - static bool init(); - static void finalize(); + time_t getExpiryTime(void) const; + + static bool init(void); + static void finalize(void); static gss_eap_attr_provider *createAttrContext(void); private: + bool allocRadHandle(const std::string &configFile); + const VALUE_PAIR *getAvps(void) const { + return m_avps; + } + + struct rs_handle *m_rh; + VALUE_PAIR *m_avps; bool m_authenticated; + std::string m_configFile; }; /* For now */ -#define PW_SAML_ASSERTION 1936 - extern "C" { #endif -#ifndef __cplusplus -static inline OM_uint32 -addRadiusAttributeFromBuffer(OM_uint32 *minor, - rc_handle *rh, - VALUE_PAIR **vp, - int type, - gss_buffer_t buffer) -{ - if (rc_avpair_add(rh, vp, type, buffer->value, buffer->length, 0) == NULL) { - *minor = ENOMEM; - return GSS_S_FAILURE; - } +OM_uint32 +gssEapRadiusAddAvp(OM_uint32 *minor, + struct rs_handle *rh, + VALUE_PAIR **vp, + uint16_t type, + uint16_t vendor, + gss_buffer_t buffer); + +OM_uint32 +gssEapRadiusGetAvp(OM_uint32 *minor, + VALUE_PAIR *vps, + uint16_t type, + uint16_t 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); - return GSS_S_COMPLETE; -} +OM_uint32 gssEapRadiusAttrProviderInit(OM_uint32 *minor); +OM_uint32 gssEapRadiusAttrProviderFinalize(OM_uint32 *minor); -static inline OM_uint32 -getBufferFromRadiusAttributes(OM_uint32 *minor, - VALUE_PAIR *vps, - int type, - gss_buffer_t buffer) -{ - VALUE_PAIR *vp; - gss_buffer_desc tmp = GSS_C_EMPTY_BUFFER; - - vp = rc_avpair_get(vps, type, 0); - if (vp != NULL) { - tmp.length = vp->lvalue; - tmp.value = vp->strvalue; - } +OM_uint32 +gssEapRadiusAllocConn(OM_uint32 *minor, + const gss_cred_id_t cred, + gss_ctx_id_t ctx); - return duplicateBuffer(minor, &tmp, buffer); -} -#endif +OM_uint32 +gssEapRadiusMapError(OM_uint32 *minor, + struct rs_error *err); -OM_uint32 gssEapRadiusAttrProviderInit(OM_uint32 *minor); -OM_uint32 gssEapRadiusAttrProviderFinalize(OM_uint32 *minor); +#define RS_CONFIG_FILE SYSCONFDIR "/radsec.conf" +#define RS_DICT_FILE DATAROOTDIR "/freeradius/dictionary" + +#define VENDORPEC_MS 311 /* RFC 2548 */ + +#define PW_MS_MPPE_SEND_KEY 16 +#define PW_MS_MPPE_RECV_KEY 17 + +#define VENDORPEC_UKERNA 25622 + +#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 #ifdef __cplusplus }