[Devel] remove gen_ha1 tool

Norman Brandinger norm at goes.com
Wed Mar 15 15:52:29 CET 2006


Below is a little PHP routine that performs a similar function:

<?php

$username = $argv[1];
$drealm   = $argv[2];
$password = $argv[3];

$a1="$username:$drealm:$password";
$ha1=md5($a1);

echo "MD5 generated  : $ha1\n";

echo "OpenSER gen_ha1: ";
system("/usr/local/sbin/openser_gen_ha1 $username $drealm $password");

?>


Regards,
Norm


Daniel-Constantin Mierla wrote:
> Hello,
>
> gen_ha1 (openser_gen_ha1) can be replaced by using some other common 
> tools on unix/linux.
>
> gen_ha1 user realm password
>
> is the same as:
>
> echo -n 'user:realm:password' | md5sum | awk  '{ print $1 }
>
> I would suggest to remove the code for gen_ha1 from openser, the 
> question is: are you aware that on some distros md5sum cannot be found?
>
> awk is already used by all scripts that use gen_ha1, so this should 
> not be a problem.
>
> Cheers,
> Daniel
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>
>
>




More information about the Devel mailing list