perl-kolab/perl-kolab

Git Service User git at kolabsys.com
Sun Nov 20 18:34:50 CET 2011


 perl-kolab/perl-kolab/ChangeLog               |    7 +++++++
 perl-kolab/perl-kolab/bin/kolabpasswd.in      |    7 ++-----
 perl-kolab/perl-kolab/lib/Kolab/LDAP.pm       |    2 +-
 perl-kolab/perl-kolab/sbin/kolab_bootstrap.in |    7 ++-----
 4 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 1b79bbc0adfd97c1903cba9bb3698e3ce3976173
Author: Mathieu Parent <math.parent at gmail.com>
Date:   Sun Nov 20 18:34:20 2011 +0100

    Replace Digest::SHA1 lib by Digest::SHA
    
    (https://issues.kolab.org/show_bug.cgi?id=515).

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 at 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 at 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;
 }
 





More information about the commits mailing list