You are here: php + radius ISA (Microsoft) « PHP Language « IT news, forums, messages
php + radius ISA (Microsoft)

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;

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация