// L2TPNS Radius Stuff
-char const *cvs_id_radius = "$Id: radius.c,v 1.38 2005-07-31 10:35:39 bodea Exp $";
+char const *cvs_id_radius = "$Id: radius.c,v 1.41 2005-08-31 12:41:09 bodea Exp $";
#include <time.h>
#include <stdio.h>
#include <ctype.h>
#include <netinet/in.h>
#include <errno.h>
-#include <openssl/md5.h>
+#include "md5.h"
#include "constants.h"
#include "l2tpns.h"
#include "plugin.h"
// process RADIUS response
void processrad(uint8_t *buf, int len, char socket_index)
{
- uint8_t b[MAXCONTROL];
+ uint8_t b[MAXETHER];
MD5_CTX ctx;
uint16_t r;
sessionidt s;
if (radius[r].chap)
{
// CHAP
- uint8_t *p = makeppp(b, sizeof(b), 0, 0, t, s, PPPCHAP);
+ uint8_t *p = makeppp(b, sizeof(b), 0, 0, s, t, PPPCHAP);
if (!p) return; // Abort!
*p = (r_code == AccessAccept) ? 3 : 4; // ack/nak
else
{
// PAP
- uint8_t *p = makeppp(b, sizeof(b), 0, 0, t, s, PPPPAP);
+ uint8_t *p = makeppp(b, sizeof(b), 0, 0, s, t, PPPPAP);
if (!p) return; // Abort!
// ack/nak
// Valid Session, set it up
session[s].unique_id = 0;
- sessionsetup(t, s);
+ sessionsetup(s, t);
}
else
{
switch (radius[r].state)
{
case RADIUSCHAP: // sending CHAP down PPP
- sendchap(t, s);
+ sendchap(s, t);
break;
case RADIUSAUTH: // sending auth to RADIUS server
case RADIUSSTART: // sending start accounting to RADIUS server