From: Luke Howard Date: Tue, 8 Mar 2011 13:29:40 +0000 (+1100) Subject: force load of global dictionary in RADIUS attr provider initialisation X-Git-Tag: vm/20110310~25 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=c733bb860c7806bcae908bf4123f66c749d8da3c;hp=40b73c2839179714941dae521261ee3e55613609;p=moonshot.git force load of global dictionary in RADIUS attr provider initialisation --- diff --git a/mech_eap/util_radius.cpp b/mech_eap/util_radius.cpp index 9d9df42..fb62c43 100644 --- a/mech_eap/util_radius.cpp +++ b/mech_eap/util_radius.cpp @@ -446,9 +446,25 @@ gss_eap_radius_attr_provider::releaseAnyNameMapping(gss_buffer_t type_id, bool gss_eap_radius_attr_provider::init(void) { + struct rs_context *radContext; + gss_eap_attr_ctx::registerProvider(ATTR_TYPE_RADIUS, "urn:ietf:params:gss-eap:radius-avp", createAttrContext); + +#if 1 + /* + * This hack is necessary in order to force the loading of the global + * dictionary, otherwise accepting reauthentication tokens fails unless + * the acceptor has already accepted a normal authentication token. + */ + if (rs_context_create(&radContext, RS_DICT_FILE) != 0) { + return false; + } + + rs_context_destroy(radContext); +#endif + return true; } @@ -710,6 +726,7 @@ avpImport(VALUE_PAIR **pVp, fail: if (vp != NULL) pairbasicfree(vp); + *pVp = NULL; return false; }