summaryrefslogtreecommitdiff
path: root/perl-kolab/perl-kolab/bin/kolabpasswd.in
diff options
context:
space:
mode:
Diffstat (limited to 'perl-kolab/perl-kolab/bin/kolabpasswd.in')
-rw-r--r--perl-kolab/perl-kolab/bin/kolabpasswd.in7
1 files changed, 2 insertions, 5 deletions
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;
}