}
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 and 2 for apache MD5 salt
- my $type = shift;
+ # 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 = 2;
- if (($type == 1)||($type == 2)) {
- $cryptsaltlen = 8;
- }
-
+
+ my $cryptsaltlen = ($md5 ? 8 : 2);
+
open (F, "</dev/urandom") || die &HTMLError("No /dev/urandom found!");
foreach (1..$cryptsaltlen) {
read(F, $in, 1);
$out .= $valid[ord($in) % ($#valid + 1)];
}
close F;
- my $md5 = $out;
- if ($type == 1) { $md5 = "\$1\$$out\$"; }
- return $md5
+ if ($md5 == 1 && !$no_crypttype_header) { $out = "\$1\$$out\$"; }
+ return $out
}
sub Encrypt {
userdir-ldap-cgi (0.3.37) UNRELEASED; urgency=low
+ [ Martin Zobel-Helas ]
* use libjs-jquery-tablesorter to sort machines.cgi
- -- Martin Zobel-Helas <zobel@debian.org> Fri, 09 Mar 2012 10:03:46 +0100
+ [ Nick Mathewson ]
+ * Use the changes@ address consistently in preference to change@.
+
+ -- Peter Palfrader <weasel@debian.org> Sun, 10 Jun 2012 22:03:14 +0200
userdir-ldap-cgi (0.3.36) unstable; urgency=low
<p>
The email forwarding can be easily reconfigured using GnuPG:
<pre>
-echo "emailforward: foo@bar.com" | gpg --clearsign | mail change@db.debian.org
+echo "emailforward: foo@bar.com" | gpg --clearsign | mail changes@db.debian.org
</pre>
or by visiting <a href="https://db.debian.org/login.html">db.debian.org</a>
}
# create a md5 crypted password
- $newwebpassword = apache_md5_crypt($query->param('newwebpass'), &Util::CreateCryptSalt(2));
+ $newwebpassword = apache_md5_crypt($query->param('newwebpass'), &Util::CreateCryptSalt(1, 1));
&Util::LDAPUpdate($ldap, $editdn, 'webPassword', $newwebpassword);
}