mirror of
https://github.com/nextcloud/server.git
synced 2026-05-26 11:22:28 -04:00
Merge pull request #32282 from nextcloud/backport/32246/stable24
[stable24] Don't use hash to check if binding worked
This commit is contained in:
commit
f2810d0725
1 changed files with 3 additions and 8 deletions
|
|
@ -128,7 +128,7 @@ class Connection extends LDAPUtility {
|
|||
protected $ignoreValidation = false;
|
||||
|
||||
/**
|
||||
* @var array{dn?: mixed, hash?: string, result?: bool}
|
||||
* @var array{sum?: string, result?: bool}
|
||||
*/
|
||||
protected $bindResult = [];
|
||||
|
||||
|
|
@ -672,11 +672,7 @@ class Connection extends LDAPUtility {
|
|||
|
||||
if (
|
||||
count($this->bindResult) !== 0
|
||||
&& $this->bindResult['dn'] === $this->configuration->ldapAgentName
|
||||
&& \OC::$server->getHasher()->verify(
|
||||
$this->configPrefix . $this->configuration->ldapAgentPassword,
|
||||
$this->bindResult['hash']
|
||||
)
|
||||
&& $this->bindResult['sum'] === md5($this->configuration->ldapAgentName . $this->configPrefix . $this->configuration->ldapAgentPassword)
|
||||
) {
|
||||
// don't attempt to bind again with the same data as before
|
||||
// bind might have been invoked via getConnectionResource(),
|
||||
|
|
@ -689,8 +685,7 @@ class Connection extends LDAPUtility {
|
|||
$this->configuration->ldapAgentPassword);
|
||||
|
||||
$this->bindResult = [
|
||||
'dn' => $this->configuration->ldapAgentName,
|
||||
'hash' => \OC::$server->getHasher()->hash($this->configPrefix . $this->configuration->ldapAgentPassword),
|
||||
'sum' => md5($this->configuration->ldapAgentName . $this->configPrefix . $this->configuration->ldapAgentPassword),
|
||||
'result' => $ldapLogin,
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue