mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Support any php default password hash algorithm change
SVN:trunk[5998]
This commit is contained in:
@@ -96,12 +96,10 @@ class ormPassword
|
|||||||
{
|
{
|
||||||
$bResult = false;
|
$bResult = false;
|
||||||
$aInfo = password_get_info($this->m_sHashed);
|
$aInfo = password_get_info($this->m_sHashed);
|
||||||
switch ($aInfo["algoName"])
|
switch ($aInfo["algo"])
|
||||||
{
|
{
|
||||||
case 'bcrypt':
|
case 0:
|
||||||
$bResult = password_verify($sClearTextPassword, $this->m_sHashed);
|
//unknown, assume it's a legacy password
|
||||||
break;
|
|
||||||
case 'unknown':
|
|
||||||
$sHashedPwd = $this->ComputeHash($sClearTextPassword);
|
$sHashedPwd = $this->ComputeHash($sClearTextPassword);
|
||||||
if ($this->m_sHashed == $sHashedPwd)
|
if ($this->m_sHashed == $sHashedPwd)
|
||||||
{
|
{
|
||||||
@@ -109,7 +107,7 @@ class ormPassword
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//shouldn't happen until php modify PASSWORD_DEFAULT
|
$bResult = password_verify($sClearTextPassword, $this->m_sHashed);
|
||||||
}
|
}
|
||||||
return $bResult;
|
return $bResult;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user