From 595525407cf72f50e5289af8bb568693f37145bd Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 22 Mar 2011 00:17:53 +1100 Subject: [PATCH] update for latest libradsec --- accept_sec_context.c | 7 ++++++- radsec.conf | 10 ++++++---- util_radius.cpp | 11 ++++++++++- util_radius.h | 1 - 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/accept_sec_context.c b/accept_sec_context.c index 5d2c113..afbfb3f 100644 --- a/accept_sec_context.c +++ b/accept_sec_context.c @@ -421,7 +421,7 @@ createRadiusHandle(OM_uint32 *minor, assert(actx->radContext == NULL); assert(actx->radConn == NULL); - if (rs_context_create(&actx->radContext, RS_DICT_FILE) != 0) { + if (rs_context_create(&actx->radContext) != 0) { *minor = GSSEAP_RADSEC_CONTEXT_FAILURE; return GSS_S_FAILURE; } @@ -443,6 +443,11 @@ createRadiusHandle(OM_uint32 *minor, goto fail; } + if (rs_context_init_freeradius_dict(actx->radContext, NULL) != 0) { + err = rs_err_ctx_pop(actx->radContext); + goto fail; + } + if (rs_conn_create(actx->radContext, &actx->radConn, configStanza) != 0) { err = rs_err_conn_pop(actx->radConn); goto fail; diff --git a/radsec.conf b/radsec.conf index bc825c9..27f895a 100644 --- a/radsec.conf +++ b/radsec.conf @@ -1,7 +1,9 @@ -config gss-eap { - type = UDP - timeout = 1 - retries = 10 +dictionary = "/usr/local/etc/raddb/dictionary" + +realm gss-eap { + type = "UDP" + timeout = 5 + retries = 3 server { hostname = "localhost" service = "1812" diff --git a/util_radius.cpp b/util_radius.cpp index f422087..dfd8964 100644 --- a/util_radius.cpp +++ b/util_radius.cpp @@ -459,7 +459,16 @@ gss_eap_radius_attr_provider::init(void) * 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) { + if (rs_context_create(&radContext) != 0) + return false; + + if (rs_context_read_config(radContext, RS_CONFIG_FILE) != 0) { + rs_context_destroy(radContext); + return false; + } + + if (rs_context_init_freeradius_dict(radContext, NULL)) { + rs_context_destroy(radContext); return false; } diff --git a/util_radius.h b/util_radius.h index eaec68e..39caa18 100644 --- a/util_radius.h +++ b/util_radius.h @@ -149,7 +149,6 @@ gssEapRadiusMapError(OM_uint32 *minor, struct rs_error *err); #define RS_CONFIG_FILE SYSCONFDIR "/radsec.conf" -#define RS_DICT_FILE SYSCONFDIR "/raddb/dictionary" #define VENDORPEC_MS 311 /* RFC 2548 */ -- 2.1.4