Add SHA1 support.

This commit is contained in:
Patrik Novotný
2017-12-18 16:10:42 +01:00
parent bfa9e7da74
commit 6864e4e0a7
2 changed files with 9 additions and 1 deletions

View File

@@ -268,6 +268,10 @@ class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\Us
if(!$salt)
return false;
$enc_password = sha1($salt['salt'].sha1($password));
}
elseif($this -> settings['set_crypt_type'] === 'sha1')
{
$enc_password = sha1($password);
} else
{
$enc_password = $this -> pacrypt($password, $old_password);
@@ -321,6 +325,10 @@ class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\Us
if(!$salt)
return false;
$ret = sha1($salt['salt'].sha1($password)) === $db_pass;
}
elseif($this -> settings['set_crypt_type'] == 'sha1')
{
$ret = sha1($password) === $db_pass;
} else
{
$ret = $this -> pacrypt($password, $db_pass) === $db_pass;