X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=moonshot%2Fmech_eap%2Futil_radius.cpp;h=76fba7b9d179ddf30157ebc19efdfd3fe5d7c552;hb=3e6abb79b847b72dd7b8c137e4fdc94b47f7b485;hp=1be1d53be2d71c4b706226c62b34848cfab17b7f;hpb=23ebe188e7889d739492f66e5cd393fa57dda6ef;p=moonshot.git diff --git a/moonshot/mech_eap/util_radius.cpp b/moonshot/mech_eap/util_radius.cpp index 1be1d53..76fba7b 100644 --- a/moonshot/mech_eap/util_radius.cpp +++ b/moonshot/mech_eap/util_radius.cpp @@ -96,7 +96,7 @@ gss_eap_radius_attr_provider::initWithGssContext(const gss_eap_attr_ctx *manager return false; /* We assume libradsec validated this for us */ - assert(pairfind(m_vps, PW_MESSAGE_AUTHENTICATOR) != NULL); + GSSEAP_ASSERT(pairfind(m_vps, PW_MESSAGE_AUTHENTICATOR) != NULL); m_authenticated = true; } } @@ -151,7 +151,7 @@ isInternalAttributeP(uint16_t attrid, uint16_t vendor) bool bInternalAttribute = false; /* should have been filtered */ - assert(!isSecretAttributeP(attrid, vendor)); + GSSEAP_ASSERT(!isSecretAttributeP(attrid, vendor)); switch (vendor) { case VENDORPEC_UKERNA: @@ -377,8 +377,7 @@ gss_eap_radius_attr_provider::getAttribute(uint32_t attrid, if (isSecretAttributeP(attrid) || isInternalAttributeP(attrid)) { return false; } else if (isFragmentedAttributeP(attrid)) { - return getFragmentedAttribute(ATTRID(attrid), - VENDOR(attrid), + return getFragmentedAttribute(attrid, authenticated, complete, value); @@ -406,7 +405,8 @@ gss_eap_radius_attr_provider::getAttribute(uint32_t attrid, duplicateBuffer(valueBuf, value); } - if (display_value != GSS_C_NO_BUFFER) { + if (display_value != GSS_C_NO_BUFFER && + vp->type != PW_TYPE_OCTETS) { char displayString[MAX_STRING_LEN]; gss_buffer_desc displayBuf; @@ -445,6 +445,16 @@ gss_eap_radius_attr_provider::getFragmentedAttribute(uint16_t attribute, } bool +gss_eap_radius_attr_provider::getFragmentedAttribute(uint32_t attrid, + int *authenticated, + int *complete, + gss_buffer_t value) const +{ + return getFragmentedAttribute(ATTRID(attrid), VENDOR(attrid), + authenticated, complete, value); +} + +bool gss_eap_radius_attr_provider::getAttribute(uint16_t attribute, uint16_t vendor, int *authenticated, @@ -480,11 +490,11 @@ gss_eap_radius_attr_provider::releaseAnyNameMapping(gss_buffer_t type_id GSSEAP_ bool gss_eap_radius_attr_provider::init(void) { - struct rs_context *radContext; - gss_eap_attr_ctx::registerProvider(ATTR_TYPE_RADIUS, createAttrContext); -#if 1 +#ifdef GSSEAP_ENABLE_REAUTH + struct rs_context *radContext; + /* * This hack is necessary in order to force the loading of the global * dictionary, otherwise accepting reauthentication tokens fails unless @@ -661,7 +671,7 @@ avpToJson(const VALUE_PAIR *vp) { JSONObject obj; - assert(vp->length <= MAX_STRING_LEN); + GSSEAP_ASSERT(vp->length <= MAX_STRING_LEN); switch (vp->type) { case PW_TYPE_INTEGER: @@ -845,7 +855,7 @@ gssEapRadiusMapError(OM_uint32 *minor, { int code; - assert(err != NULL); + GSSEAP_ASSERT(err != NULL); code = rs_err_code(err, 0);