update for latest libradsec
authorLuke Howard <lukeh@padl.com>
Mon, 21 Mar 2011 13:17:53 +0000 (00:17 +1100)
committerLuke Howard <lukeh@padl.com>
Mon, 21 Mar 2011 13:17:53 +0000 (00:17 +1100)
accept_sec_context.c
radsec.conf
util_radius.cpp
util_radius.h

index 5d2c113..afbfb3f 100644 (file)
@@ -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;
index bc825c9..27f895a 100644 (file)
@@ -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"
index f422087..dfd8964 100644 (file)
@@ -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;
     }
 
index eaec68e..39caa18 100644 (file)
@@ -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 */