The git bot | 22 May 2013 00:00
Gravatar

Commit report for master branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
Updates

Alan T. DeKok <at> 2013-05-21T19:05:13Z
Files modified:
	* share/dictionary.telkom

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/5113475ce044b03bbd5bd941828d10d7ca514c9f
====== 
removed old comment

Alan T. DeKok <at> 2013-05-21T17:04:31Z
Files modified:
	* src/tests/condition.txt

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/03783354d0a38aa09e296bf4fb20200b5b5537bf
====== 
Infinite loops are bad.

	foo {
		...
	}

	authorize = ${foo}

will add "foo" to the parent section, by appending it to the end
(Continue reading)

The git bot | 22 May 2013 00:00
Gravatar

Commit report for v2.x.x branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
Updates

Alan T. DeKok <at> 2013-05-21T19:04:37Z
Files modified:
	* share/dictionary.telkom

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/2fa057297c910d0b0eb7c108d63c9c6e9d30f29a
====== 
Merge pull request #293 from fajarnugraha/v2.x.x-suse-20130510

Fix suse package to build and run cleanly for current v2.x.x branch

Alan DeKok <at> 2013-05-21T15:10:57Z
Files modified:
	* suse/freeradius.spec

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/e2706906bd7a0932d753974e479c66b85a147d7b
====== 
suse: build fixes

* Bump version to 2.2.1
* Only requires sqlite3-devel and libpcap-devel on Suse 11.x and above
* README was renamed to README.rst

Fajar A. Nugraha <at> 2013-05-21T11:05:48Z
(Continue reading)

The git bot | 18 May 2013 00:00
Gravatar

Commit report for master branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
A better way of getting empty alternations

Alan T. DeKok <at> 2013-05-17T17:26:06Z
Files modified:
	* src/main/xlat.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/25b6fdd66ac5144610e805d6476b4286c09e9a04
====== 
--

-- 
This commit summary was generated  <at> 2013-05-18T00:00:07Z by lgfeed version 0.00 (https://github.com/arr2036/lgfeed).
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html

The git bot | 17 May 2013 00:00
Gravatar

Commit report for master branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
'A' is a valid base64 character

Alan T. DeKok <at> 2013-05-16T16:43:21Z
Files modified:
	* src/lib/base64.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/d34c33d2b70e69eeefd4bae13e0195a8bbe28cb9
====== 
Tests for xlat output

Alan T. DeKok <at> 2013-05-16T15:31:56Z
Files modified:
	* src/include/parser.h
	* src/main/radattr.c
	* src/main/xlat.c
	* src/tests/xlat.txt

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/e07b87d38abcb5fa4d3a23b1a7f924510cc72313
====== 
Save the parsed array reference

Alan T. DeKok <at> 2013-05-16T15:31:38Z
Files modified:
	* src/main/xlat.c

(Continue reading)

Alan DeKok | 16 May 2013 23:51
Favicon
Gravatar

More additions to unlang

  The changes in today add "compile-time" validation, and evaluation of
static values.  For example:

 	if (Session-Timeout < blue) {

  In v2, the server will start, and give run-time errors.

  In v3, the server will refuse to start, as "blue" is not a valid number.

  Even better, parts of the virtual servers can now be removed at start
time:

	if (0) {
		sql
		ldap
	}

  When the contents of a condition are statically equivalent to false
(e.g. 0), then the contents of the "if" block are completely ignored.
It lets you have conditional parts of the configuration, which have zero
run-time CPU or memory cost.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html

The git bot | 16 May 2013 00:00
Gravatar

Commit report for master branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
A more robust way of statically removing "if (false)" sections

Alan T. DeKok <at> 2013-05-15T18:07:04Z
Files modified:
	* src/main/modules.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/4bc3e552b5e4f6b218ec1294ceab26f2139533ca
====== 
Never mind... we'll get to this later

Alan T. DeKok <at> 2013-05-15T17:25:00Z
Files modified:
	* src/main/modules.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/4c0eba986561c0a0c97235c8b6dcc790d7aa1127
====== 
Minor fixes

Alan T. DeKok <at> 2013-05-15T16:20:05Z
Files modified:
	* src/main/modules.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/7f01740fdc2f56ac600b43bff12ef63e135f9243
====== 
(Continue reading)

Ivan Ostres | 15 May 2013 11:28
Gravatar

MODULE DEV: Problem adding an attribute to access-accept message

Hi List!

I am learning how to write a custom module (in my case for authorization 
in prepaid billing) and I need to add some custom attributes (both 
standard and VSA) to access-accept message. I am trying to do this in 
mod_authorize:

         service = pairfind(request->packet->vps, 
CISCO_SSG_SERVICE_INFO, VENDOR_CISCO, TAG_ANY);
         if (service != NULL) {
           RDEBUG("Found CISCO_SSG_SERVICE_INFO -> Prepaid billing 
request");
           pairmake_reply("Idle-Timeout",10, T_OP_ADD);
           request->reply->code = PW_AUTHENTICATION_ACK;
           return RLM_MODULE_OK;
          }

I can see in a log that this part of code is used:

(0) prepaid : Found CISCO_SSG_SERVICE_INFO -> Prepaid billing request
(0)   [prepaid] = handled
(0) # Executing section post-auth from file 
/usr/local/etc/raddb/sites-enabled/default
(0)   group post-auth {
(0)  - entering group post-auth {...}
(0)   [exec] = noop
Sending Access-Accept of id 12 from 0.0.0.0 port 1812 to 192.168.123.196 
port 49444
(0) Finished request 0.

(Continue reading)

The git bot | 15 May 2013 00:00
Gravatar

Commit report for master branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
Move many common functions to a common library

And add stupid wrappers for rad_fork() and rad_waitpid()
We can go fix those later...

Alan T. DeKok <at> 2013-05-14T22:20:30Z
Files modified:
	* src/main/all.mk
	* src/main/libfreeradius-server.mk
	* src/main/radattr.c
	* src/main/radattr.mk
	* src/main/radconf2xml.c
	* src/main/radconf2xml.mk
	* src/main/radiusd.mk
	* src/main/radmin.c
	* src/main/radmin.mk
	* src/main/radwho.c
	* src/main/radwho.mk

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/83181ee2ce1c70978396cca359eb5be42b1c4e60
====== 
Remove use of global variable

Alan T. DeKok <at> 2013-05-14T22:20:05Z
Files modified:
	* src/main/exec.c
(Continue reading)

Sankalp Dubey | 14 May 2013 13:42
Favicon

How to convert the Reply-Message as challenge

 

Hi

 

We have a radius server which does not understand EAP and we are using Free Radius as EAP-PEAP-GTC proxy-inner-tunnel.

 

As the present code does not set User-Password in EAP-PEAP-GTC mode so we made the following code changes:

 

1. File:  src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c

    In function gtc_initiate(void *type_data, EAP_HANDLER *handler)

    Added following lines with reference to  the src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c file

   #ifdef WITH_PROXY

        /*

         *      The EAP session doesn't have enough information to

         *      proxy the "inside EAP" protocol.  Disable EAP proxying.

         */

        handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP;

    #endif

 

2. We also added the following  functions in rlm_eap_gtc.c file

      static int gtc_postproxy(EAP_HANDLER *handler, void *tunnel_data)

      This functions doesn’t seem to be called.

 

3. gtc_autheticate changes:

#ifdef WITH_PROXY

        /*

         *      If this options is set, then we do NOT authenticate the

         *      user here.  Instead, now that we've added the PAP

         *      attributes to the request, we STOP, and let the outer

         *      tunnel code handle it.

         *

         *      This means that the outer tunnel code will DELETE the

         *      EAP attributes, and proxy the PAP attributes to a

         *      home server.

         */

        if (handler->request->options & RAD_REQUEST_OPTION_PROXY_EAP) {

 

                /*

                 *      Set up the callbacks for the tunnel

                */

                eap_tunnel_data_t *tunnel;

                tunnel = rad_malloc(sizeof(*tunnel));

                memset(tunnel, 0, sizeof(*tunnel));

 

                tunnel->tls_session = type_data;

                tunnel->callback = gtc_postproxy;

 

                /*

                 *      Associate the callback with the request.

                */

                rcode = request_data_add(handler->request,

                                         handler->request->proxy,

                                         REQUEST_DATA_EAP_TUNNEL_CALLBACK,

                                         tunnel, free);

                rad_assert(rcode == 0);

 

                pairdelete(&handler->request->packet->vps, PW_STATE);

 

                return 1;

        }

#endif

 

The modified rlm_eap_gtc.c is attached for reference.

 

With these code changes we are able to set the User-Password in EAP-PEAP-GTC proxy mode. Also, debug message from gtc_postproxy is not visible in the log file.

 

However, when the proxied-to RADIUS Server throws Access-Challenge the same is not  forwarded by Free RADIUS to the client i.e. Reply-Message is stripped by Free RADIUS.

 

Please let us know how to convert the Reply-Message as challenge for the client.

 

Thanks n regards

Sankalp Dubey

/*
 * rlm_eap_gtc.c    Handles that are called from eap
 *
 * Version:     $Id$
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 *
 * Copyright 2003,2006  The FreeRADIUS server project
 */

#include <freeradius-devel/ident.h>
RCSID("$Id$")

#include <freeradius-devel/autoconf.h>

#include <stdio.h>
#include <stdlib.h>

#include "eap.h"

#include <freeradius-devel/rad_assert.h>

/*
 *	EAP-GTC is just ASCII data carried inside of the EAP session.
 *	The length of the data is indicated by the encapsulating EAP
 *	protocol.
 */
typedef struct rlm_eap_gtc_t {
	const char	*challenge;
	const char	*auth_type_name;
	int		auth_type;
} rlm_eap_gtc_t;

static CONF_PARSER module_config[] = {
	{ "challenge", PW_TYPE_STRING_PTR,
	  offsetof(rlm_eap_gtc_t, challenge), NULL, "Password: " },

	{ "auth_type", PW_TYPE_STRING_PTR,
	  offsetof(rlm_eap_gtc_t, auth_type_name), NULL, "PAP" },

 	{ NULL, -1, 0, NULL, NULL }           /* end the list */
};


/*
 *	Detach the module.
 */
static int gtc_detach(void *arg)
{
	rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) arg;


	free(inst);

	return 0;
}

/*
 *	Attach the module.
 */
static int gtc_attach(CONF_SECTION *cs, void **instance)
{
	rlm_eap_gtc_t	*inst;
	DICT_VALUE	*dval;

	inst = malloc(sizeof(*inst));
	if (!inst) {
		radlog(L_ERR, "rlm_eap_gtc: out of memory");
		return -1;
	}
	memset(inst, 0, sizeof(*inst));

	/*
	 *	Parse the configuration attributes.
	 */
	if (cf_section_parse(cs, inst, module_config) < 0) {
		gtc_detach(inst);
		return -1;
	}

	dval = dict_valbyname(PW_AUTH_TYPE, inst->auth_type_name);
	if (!dval) {
		radlog(L_ERR, "rlm_eap_gtc: Unknown Auth-Type %s",
		       inst->auth_type_name);
		gtc_detach(inst);
		return -1;
	}

	inst->auth_type = dval->value;

	*instance = inst;

	return 0;
}

/*
 *	Initiate the EAP-GTC session by sending a challenge to the peer.
 */
static int gtc_initiate(void *type_data, EAP_HANDLER *handler)
{
	char challenge_str[1024] = {0};
	int length;
	EAP_DS *eap_ds = handler->eap_ds;
	rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) type_data;

	if (!radius_xlat(challenge_str, sizeof(challenge_str), inst->challenge, handler->request,
NULL)) {
		radlog(L_ERR, "rlm_eap_gtc: xlat of \"%s\" failed", inst->challenge);
		return 0;
	}

	length = strlen(challenge_str);

	/*
	 *	We're sending a request...
	 */
	eap_ds->request->code = PW_EAP_REQUEST;

	eap_ds->request->type.data = malloc(length);
	if (eap_ds->request->type.data == NULL) {
		radlog(L_ERR, "rlm_eap_gtc: out of memory");
		return 0;
	}

	memcpy(eap_ds->request->type.data, challenge_str, length);
	eap_ds->request->type.length = length;

#ifdef WITH_PROXY
        /*
         *      The EAP session doesn't have enough information to
         *      proxy the "inside EAP" protocol.  Disable EAP proxying.
         */
        handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP;
#endif

	/*
	 *	We don't need to authorize the user at this point.
	 *
	 *	We also don't need to keep the challenge, as it's
	 *	stored in 'handler->eap_ds', which will be given back
	 *	to us...
	 */
	handler->stage = AUTHENTICATE;

	return 1;
}


#ifdef WITH_PROXY
/*
 *      Do post-proxy processing,
 *      0 = fail
 *      1 = OK.
 *
 *      Called from rlm_eap.c, eap_postproxy().
 */
static int gtc_postproxy(EAP_HANDLER *handler, void *tunnel_data)
{
        REQUEST* request = handler->request;
        tunnel_data = tunnel_data; /* -Wunused */

        DEBUG2("  rlm_eap_gtc: Passing reply from proxy back into the tunnel %p %d.", handler->request, handler->request->reply->code);

        /*
         *      Done doing EAP proxy stuff.
         */
        handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP;

        return 1;
}
#endif

/*
 *	Authenticate a previously sent challenge.
 */
static int gtc_authenticate(void *type_data, EAP_HANDLER *handler)
{
	VALUE_PAIR *vp;
	EAP_DS *eap_ds = handler->eap_ds;
	rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) type_data;

	/*
	 *	Get the Cleartext-Password for this user.
	 */
	rad_assert(handler->request != NULL);
	rad_assert(handler->stage == AUTHENTICATE);

	/*
	 *	Sanity check the response.  We need at least one byte
	 *	of data.
	 */
	if (eap_ds->response->length <= 4) {
		radlog(L_ERR, "rlm_eap_gtc: corrupted data");
		eap_ds->request->code = PW_EAP_FAILURE;
		return 0;
	}

#if 0
	if ((debug_flag > 2) && fr_log_fp) {
		int i;

		for (i = 0; i < eap_ds->response->length - 4; i++) {
			if ((i & 0x0f) == 0) fprintf(fr_log_fp, "%d: ", i);

			fprintf(fr_log_fp, "%02x ", eap_ds->response->type.data[i]);

			if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n");
		}
	}
#endif

	/*
	 *	Handle passwords here.
	 */
	if (inst->auth_type == PW_AUTHTYPE_LOCAL) {
		/*
		 *	For now, do clear-text password authentication.
		 */
		vp = pairfind(handler->request->config_items, PW_CLEARTEXT_PASSWORD);
		if (!vp) {
			DEBUG2("  rlm_eap_gtc: ERROR: Cleartext-Password is required for authentication.");
			eap_ds->request->code = PW_EAP_FAILURE;
			return 0;
		}

		if (eap_ds->response->type.length != vp->length) {
		  DEBUG2("  rlm_eap_gtc: ERROR: Passwords are of different length. %u %u", (unsigned)
eap_ds->response->type.length, (unsigned) vp->length);
			eap_ds->request->code = PW_EAP_FAILURE;
			return 0;
		}

		if (memcmp(eap_ds->response->type.data,
			   vp->vp_strvalue, vp->length) != 0) {
			DEBUG2("  rlm_eap_gtc: ERROR: Passwords are different");
			eap_ds->request->code = PW_EAP_FAILURE;
			return 0;
		}

		/*
		 *	EAP packets can be ~64k long maximum, and
		 *	we don't like that.
		 */
	} else if (eap_ds->response->type.length <= 128) {
		int rcode;

		/*
		 *	If there was a User-Password in the request,
		 *	why the heck are they using EAP-GTC?
		 */
		pairdelete(&handler->request->packet->vps, PW_USER_PASSWORD);

		vp = pairmake("User-Password", "", T_OP_EQ);
		if (!vp) {
			radlog(L_ERR, "rlm_eap_gtc: out of memory");
			return 0;
		}
		vp->length = eap_ds->response->type.length;
		memcpy(vp->vp_strvalue, eap_ds->response->type.data, vp->length);
		vp->vp_strvalue[vp->length] = 0;

		/*
		 *	Add the password to the request, and allow
		 *	another module to do the work of authenticating it.
		 */
		pairadd(&handler->request->packet->vps, vp);
		handler->request->password = vp;

#ifdef WITH_PROXY
        /*
         *      If this options is set, then we do NOT authenticate the
         *      user here.  Instead, now that we've added the PAP
         *      attributes to the request, we STOP, and let the outer
         *      tunnel code handle it.
         *
         *      This means that the outer tunnel code will DELETE the
         *      EAP attributes, and proxy the PAP attributes to a
         *      home server.
         */
        if (handler->request->options & RAD_REQUEST_OPTION_PROXY_EAP) {

                /*
                 *      Set up the callbacks for the tunnel
                */
                eap_tunnel_data_t *tunnel;
                tunnel = rad_malloc(sizeof(*tunnel));
                memset(tunnel, 0, sizeof(*tunnel));

                tunnel->tls_session = type_data;
                tunnel->callback = gtc_postproxy;

                /*
                 *      Associate the callback with the request.
                */
                rcode = request_data_add(handler->request,
                                         handler->request->proxy,
                                         REQUEST_DATA_EAP_TUNNEL_CALLBACK,
                                         tunnel, free);
                rad_assert(rcode == 0);

                pairdelete(&handler->request->packet->vps, PW_STATE);

                return 1;
        }
#endif

		/*
		 *	This is a wild & crazy hack.
		 */
		rcode = module_authenticate(inst->auth_type, handler->request);
		if (rcode != RLM_MODULE_OK) {
			eap_ds->request->code = PW_EAP_FAILURE;
			return 0;
		}

	} else {
		radlog(L_ERR, "rlm_eap_gtc: Response is too large to understand");
		eap_ds->request->code = PW_EAP_FAILURE;
		return 0;

	}

	DEBUG2("  rlm_eap_gtc: Everything is OK.");

	eap_ds->request->code = PW_EAP_SUCCESS;

	return 1;
}

/*
 *	The module name should be the only globally exported symbol.
 *	That is, everything else should be 'static'.
 */
EAP_TYPE rlm_eap_gtc = {
	"eap_gtc",
	gtc_attach,	      		/* attach */
	gtc_initiate,			/* Start the initial request */
	NULL,				/* authorization */
	gtc_authenticate,		/* authentication */
	gtc_detach     			/* detach */
};
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
The git bot | 14 May 2013 00:00
Gravatar

Commit report for master branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
Make radlog available in the "init" function of the Perl code

Alan T. DeKok <at> 2013-05-13T20:29:59Z
Files modified:
	* src/modules/rlm_perl/rlm_perl.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/33115285b8f852c5c18825771842e02d640f0d50
====== 
Checks for empty expansions

Alan T. DeKok <at> 2013-05-13T15:06:28Z
Files modified:
	* src/main/xlat.c
	* src/tests/xlat.txt

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/c4f13b3fe8560cc22f19f996848c32b18d8b8e63
====== 
Start of type checks on RHS of conditions

Alan T. DeKok <at> 2013-05-13T14:58:11Z
Files modified:
	* src/main/parser.c
	* src/tests/condition.txt

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/91e9b9e237d9df204d4b5f8bff4c2ba3fe0c93a3
====== 
Disallow RHS bare words for string attributes

User-Name == "bob" is OK
User-Name == bob is not

Alan T. DeKok <at> 2013-05-13T01:28:53Z
Files modified:
	* src/main/parser.c
	* src/tests/condition.txt

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/900117a4c652b1465f3b598de4ad6f5692686100
====== 
Add single quotes around literals for attributes of type string

Alan T. DeKok <at> 2013-05-13T01:28:36Z
Files modified:
	* src/main/map.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/a64099b8bdc2678bcb4436a449d021d60623bfb2
====== 
--

-- 
This commit summary was generated  <at> 2013-05-14T00:00:09Z by lgfeed version 0.00 (https://github.com/arr2036/lgfeed).
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html

The git bot | 14 May 2013 00:00
Gravatar

Commit report for v2.x.x branch

New activity for FreeRADIUS (the high performance and highly configurable RADIUS server)

======
Make radlog available in the "init" function of the Perl code

Alan T. DeKok <at> 2013-05-13T18:32:55Z
Files modified:
	* src/modules/rlm_perl/rlm_perl.c

Commit diff:
https://github.com/FreeRADIUS/freeradius-server/commit/7f2d6e365eb5b882662575bc66c92471bda96932
====== 
--

-- 
This commit summary was generated  <at> 2013-05-14T00:00:05Z by lgfeed version 0.00 (https://github.com/arr2036/lgfeed).
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html


Gmane