|
Posted by Tomasz D³uΏniewski on 10/20/05 14:43
Hello
I wrote (mostly copy - paste) a script which authenticates users in Open
Raius .. it looks like below. Everything works fine on Open Radius. But ISA
gets me the following error
A malformed RADIUS message was received from client portal. The data is the
RADIUS message.
I think the problem is in ISA attributes ?
$connected = socket_connect($socket , $ip, $port);
$user = $user.$this->params->getRadiusSuffix($i);
$nasIP = explode('.', $ip);
//
// auth code
$RA=pack("CCCCCCCCCCCCCCCC",
1+rand()%255, 1+rand()%255, 1+rand()%255, 1+rand()%255,
1+rand()%255, 1+rand()%255, 1+rand()%255, 1+rand()%255,
1+rand()%255, 1+rand()%255, 1+rand()%255, 1+rand()%255,
1+rand()%255, 1+rand()%255, 1+rand()%255, 1+rand()%255);
$encryptedPassword =
$this->encryptRadiusPassword(trim($pass),trim($key),$RA);
$length=4+ // header
16+ // auth code
6+ // service type
2+strlen($user)+ // username
2+strlen($encryptedPassword)+ // userpassword
6+ // nasIP
6+ // nasPort
6; // nasPortType
$thisidentifier=rand()%256;
$data=pack("CCCCa*CCCCCCCCa*CCa*CCCCCCCCCCCC",
1,$thisidentifier,$length/256,$length%256, // header
$RA, // authcode
6,6,0,0,0,1, // service type
1,2+strlen($user),$user, // username
2,2+strlen($encryptedPassword),$encryptedPassword, // userpassword
4,6,$nasIP[0],$nasIP[1],$nasIP[2],$nasIP[3], // nasIP
5,6,0,0,0,0, // nasPort
61,6,0,0,0,15 // nasPortType = Ethernet);
socket_write($socket,$data,$length)
socket_recv($socket,$return,512,0);
if (ord($return) == 2) return true;
else return false;
[Back to original message]
|