X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAuth%2FPassword.pm;h=20a9ed57c4bae3e0ad84fab23f12867b33988c82;hb=9b039e37be3108c90d20d4db36f0a9a54400c800;hp=d566cf0f19fce3f482c694ef3f23951e3c0c658d;hpb=c157c911ac9175e4838990d051c594dd5eec7e21;p=kivitendo-erp.git diff --git a/SL/Auth/Password.pm b/SL/Auth/Password.pm index d566cf0f1..20a9ed57c 100644 --- a/SL/Auth/Password.pm +++ b/SL/Auth/Password.pm @@ -3,7 +3,6 @@ package SL::Auth::Password; use strict; use Carp; -use Digest::MD5 (); use Digest::SHA (); use Encode (); use PBKDF2::Tiny (); @@ -49,15 +48,6 @@ sub hash { if ($params{algorithm} =~ m/^SHA256/) { return '{' . $params{algorithm} . '}' . Digest::SHA::sha256_hex($salt . $params{password}); - } elsif ($params{algorithm} =~ m/^SHA1/) { - return '{' . $params{algorithm} . '}' . Digest::SHA::sha1_hex($salt . $params{password}); - - } elsif ($params{algorithm} =~ m/^MD5/) { - return '{' . $params{algorithm} . '}' . Digest::MD5::md5_hex($salt . $params{password}); - - } elsif ($params{algorithm} eq 'CRYPT') { - return '{CRYPT}' . crypt($params{password}, substr($params{login}, 0, 2)); - } elsif ($params{algorithm} =~ m/^PBKDF2/) { return $class->hash_pkkdf2(password => $params{password}, stored_password => $params{stored_password}); @@ -86,7 +76,7 @@ sub parse { my ($class, $password, $default_algorithm) = @_; return ($1, $2) if $password =~ m/^\{ ([^\}]+) \} (.+)/x; - return ($default_algorithm || 'CRYPT', $password); + return ($default_algorithm || 'PBKDF2', $password); } 1;