From: Martin Zobel-Helas Date: Fri, 9 Mar 2012 11:47:38 +0000 (+0100) Subject: Better salt X-Git-Tag: release-0.3.40~74 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=commitdiff_plain;h=9b394648f35965c5b6e18a8ff12af25d73866f7a Better salt Signed-off-by: Martin Zobel-Helas --- diff --git a/Util.pm b/Util.pm index 001de37..f6be1ed 100644 --- a/Util.pm +++ b/Util.pm @@ -50,6 +50,22 @@ sub CreateCryptSalt { return ($md5 ? "\$1\$$out\$" : $out); } +sub CreateMD5Salt { + my $validstr = './0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + my @valid = split(//,$validstr); + my ($in, $out); + + my $cryptsaltlen = 8; + + open (F, "param('doupdate'))) { } # create a md5 crypted password - $newwebpassword = apache_md5_crypt($query->param('newwebpass'), &Util::CreateCryptSalt()); + $newwebpassword = apache_md5_crypt($query->param('newwebpass'), &Util::CreateMD5Salt()); &Util::LDAPUpdate($ldap, $editdn, 'webPassword', $newwebpassword); }