(RADIATOR) passwords

Hugh Irvine hugh at open.com.au
Fri Sep 21 00:48:22 CDT 2001


Hello -

On Friday 21 September 2001 14:06, Tech wrote:
> Hi Hugh,
> We are just about there I am now returning the whole username with the
> realm removed as a password but now have to bring this down to 6 places as
> can be seen from the log below
> Thanking you to date.
>
> Fri Sep 21 11:09:25 2001:1000861765:1234567890:1234567890:123456:FAIL
> Fri Sep 21 11:38:21 2001:1000863501:1234567890:1234567890:123456:FAIL
>

# -*- mode: Perl -*-
# addUsernameAsPassword
#
# PreAuthHook to add a Password attribute
# to an Access-Request.
# The User-Name is used for the Password.
# Note that the Password must be encoded
# with the shared secret of the original NAS.
#
# Author: Hugh Irvine (hugh at open.com.au)
# Copyright (C) 2001 Open System Consultants
#

sub
{
    my $p = ${$_[0]};
    my $rp = ${$_[1]};

    # Get the request code and password.
    my $code = $p->code;
    my $password = $p->get_attr('User-Password');

    if (($code eq 'Access-Request') && ($password eq ""))
    {
        my $secret = $p->{Client}->{Secret};
        my $pw = substr($p->get_attr('User-Name'), 0, 6);        
        $p->change_attr('User-Password', 
            $p->encode_password($pw, $secret));
    }
    return;
}


regards

Hugh


-- 
Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list