mirror of
https://github.com/nextcloud/server.git
synced 2026-03-12 21:52:19 -04:00
Merge pull request #36653 from nextcloud/bugfix/noid/more-defensive-old-token-handling
fix(authentication): Handle null or empty string password hash
This commit is contained in:
commit
c550acae62
1 changed files with 1 additions and 1 deletions
|
|
@ -113,7 +113,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
// We need to check against one old token to see if there is a password
|
||||
// hash that we can reuse for detecting outdated passwords
|
||||
$randomOldToken = $this->mapper->getFirstTokenForUser($uid);
|
||||
$oldTokenMatches = $randomOldToken && $this->hasher->verify(sha1($password) . $password, $randomOldToken->getPasswordHash());
|
||||
$oldTokenMatches = $randomOldToken && $randomOldToken->getPasswordHash() && $this->hasher->verify(sha1($password) . $password, $randomOldToken->getPasswordHash());
|
||||
|
||||
$dbToken = $this->newToken($token, $uid, $loginName, $password, $name, $type, $remember);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue