In article <[EMAIL PROTECTED]>,
Nathan Miller  <[EMAIL PROTECTED]> wrote:
>OK.. here's some debugging output from my 2 current radius servers.  The 
>first is from freeradius.  This is exactly what shows up in debug and what 
>is passed to my external script.  This is clearly not hex data.  General 
>consensus here is it's Octal, just w/o the leading 0's.
>
>         CHAP_CHALLENGE = \321r\2443S\222\0139ZF\327\250\227\311\010\321
>         CHAP_PASSWORD = 
>\001\342\256\032\255\273c\361\261Q\217p_\377\261\250\273

It's octal with 3 digits always. It's pretty common.

>1.  A perl routine to convert octal -> hex   OR octal -> binary for use in 
>md5 for comparing chap-password to digest.

# Octal to binary
$string =~ s/\\(\d\d\d)/sprintf("%c", oct $1)/ge;

# Binary to hex
$string =~ s/(.)/sprintf("%02X", ord $1)/ge;

Mike.
-- 
"Only two things are infinite, the universe and human stupidity,
 and I'm not sure about the former" -- Albert Einstein.


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

Reply via email to