X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=blobdiff_plain;f=Util.pm;h=27060d703c80000cd78b748590e095f19cdcd1a5;hp=001de372e5e232fc5637a0995cd30a107d35af0d;hb=93f39f9573613a5161a99557f8293bbdf7a435dd;hpb=5395e53d542c72fcadd2c2bcba80a51b9597c12b diff --git a/Util.pm b/Util.pm index 001de37..27060d7 100644 --- a/Util.pm +++ b/Util.pm @@ -33,21 +33,26 @@ sub CreateKey { } sub CreateCryptSalt { + # CreateCryptSalt(type = 0, skip_header = 0) # this can create either a DES type salt or a MD5 salt + # 0 for DES, 1 for MD5 salt + # if skip_header is 0, does not add $1$ for md5 salts. my $md5 = shift; # do we want a MD5 salt? + my $no_crypttype_header = shift; my $validstr = './0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; my @valid = split(//,$validstr); my ($in, $out); - + my $cryptsaltlen = ($md5 ? 8 : 2); - + open (F, "