summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Parent <math.parent@gmail.com>2011-11-20 17:34:20 (GMT)
committerMathieu Parent <math.parent@gmail.com>2011-11-20 17:34:20 (GMT)
commit1b79bbc0adfd97c1903cba9bb3698e3ce3976173 (patch)
treed186b610939f556bf17682c8dd0af9c23544b043
parent1fa8f6d586c4827c68b04ce3f43f293fe3614f94 (diff)
downloadserver-master.tar.gz
Replace Digest::SHA1 lib by Digest::SHAHEADmaster
(https://issues.kolab.org/show_bug.cgi?id=515).
-rw-r--r--perl-kolab/perl-kolab/ChangeLog7
-rw-r--r--perl-kolab/perl-kolab/bin/kolabpasswd.in7
-rw-r--r--perl-kolab/perl-kolab/lib/Kolab/LDAP.pm2
-rw-r--r--perl-kolab/perl-kolab/sbin/kolab_bootstrap.in7
4 files changed, 12 insertions, 11 deletions
diff --git a/perl-kolab/perl-kolab/ChangeLog b/perl-kolab/perl-kolab/ChangeLog
index bc8da55..7f0142c 100644
--- a/perl-kolab/perl-kolab/ChangeLog
+++ b/perl-kolab/perl-kolab/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-20 Mathieu Parent <math.parent@gmail.com>
+
+ * bin/kolabpasswd.in, lib/Kolab/LDAP.pm, sbin/kolab_bootstrap.in:
+
+ Replace Digest::SHA1 lib by Digest::SHA
+ (https://issues.kolab.org/show_bug.cgi?id=515).
+
2010-07-17 Gunnar Wrobel <p@rdus.de>
* lib/Kolab/LDAP.pm:
diff --git a/perl-kolab/perl-kolab/bin/kolabpasswd.in b/perl-kolab/perl-kolab/bin/kolabpasswd.in
index 38b88b0..c24b773 100644
--- a/perl-kolab/perl-kolab/bin/kolabpasswd.in
+++ b/perl-kolab/perl-kolab/bin/kolabpasswd.in
@@ -55,7 +55,7 @@ use Term::ReadKey;
use IO::File;
use File::Temp;
use Net::LDAP;
-use Digest::SHA1;
+use Digest::SHA qw(sha1);
use MIME::Base64;
use Kolab::Util;
use Kolab;
@@ -109,11 +109,8 @@ sub __generate_hex_salt {
# Hash a password without using slappasswd
sub hashPassword2 {
my $pw = shift;
- my $ctx = Digest::SHA1->new;
my $salt = __generate_hex_salt();
- $ctx->add($pw);
- $ctx->add($salt);
- my $hashpw = '{SSHA}' . encode_base64($ctx->digest . $salt ,'');
+ my $hashpw = '{SSHA}' . encode_base64(sha1($pw . $salt) . $salt ,'');
return $hashpw;
}
diff --git a/perl-kolab/perl-kolab/lib/Kolab/LDAP.pm b/perl-kolab/perl-kolab/lib/Kolab/LDAP.pm
index 8756be0..49d90d9 100644
--- a/perl-kolab/perl-kolab/lib/Kolab/LDAP.pm
+++ b/perl-kolab/perl-kolab/lib/Kolab/LDAP.pm
@@ -37,7 +37,7 @@ use DB_File;
use Kolab;
use Kolab::Util;
use Kolab::Cyrus;
-use Digest::SHA1 qw(sha1);
+use Digest::SHA qw(sha1);
use MIME::Base64 qw(encode_base64);
require Exporter;
diff --git a/perl-kolab/perl-kolab/sbin/kolab_bootstrap.in b/perl-kolab/perl-kolab/sbin/kolab_bootstrap.in
index 1c4532d..468ffbe 100644
--- a/perl-kolab/perl-kolab/sbin/kolab_bootstrap.in
+++ b/perl-kolab/perl-kolab/sbin/kolab_bootstrap.in
@@ -69,7 +69,7 @@ use Getopt::Std;
use Term::ReadKey;
use Time::Local;
use Time::localtime;
-use Digest::SHA1;
+use Digest::SHA qw(sha1);
use MIME::Base64;
# Reload only kolab.globals into our configuration.
@@ -154,11 +154,8 @@ sub __generate_hex_salt {
# Hash a password without using slappasswd
sub hashPassword2 {
my $pw = shift;
- my $ctx = Digest::SHA1->new;
my $salt = __generate_hex_salt();
- $ctx->add($pw);
- $ctx->add($salt);
- my $hashpw = '{SSHA}' . encode_base64($ctx->digest . $salt ,'');
+ my $hashpw = '{SSHA}' . encode_base64(sha1($pw . $salt) . $salt ,'');
return $hashpw;
}