Commit a277f1e7 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(auth): match old SSHA

issue #1083
parent 303583aa
......@@ -638,7 +638,8 @@ sub _match_password {
return Authen::Passphrase->from_rfc2307($password_ldap)->match($password)
if $storage =~ /rfc2307|md5/i;
return _match_pbkdf2($password_ldap,$password) if $storage =~ /pbkdf2|SSHA/i;
return _match_pbkdf2($password_ldap,$password) if $storage eq 'pbkdf2';
return _match_ssha($password_ldap,$password) if $storage eq 'SSHA';
confess "Error: storage $storage can't do match. Use bind.";
}
......@@ -650,6 +651,10 @@ sub _ntohl {
unpack('L*', pack('N*', @_));
}
sub _match_ssha($password_ldap, $password) {
return Authen::Passphrase->from_rfc2307($password_ldap)->match($password);
}
sub _match_pbkdf2($password_db_64, $password) {
my ($sign,$password_db) = $password_db_64 =~ /(\{.*?})(.*)/;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment