mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Implement new Password class and related unit tests
This commit is contained in:
parent
90dcc4a2e8
commit
647bc7c112
4 changed files with 579 additions and 9 deletions
|
|
@ -61,7 +61,7 @@ class VendorPass
|
|||
else
|
||||
{
|
||||
$iterations = 15;
|
||||
$salt = Password::createSecureSalt(8, 'hex');
|
||||
$salt = Rhymix\Framework\Security::getRandom(8, 'hex');
|
||||
}
|
||||
$count = 1 << $iterations;
|
||||
$hash = hash('sha512', $salt . $password, true);
|
||||
|
|
@ -104,7 +104,7 @@ class VendorPass
|
|||
}
|
||||
else
|
||||
{
|
||||
$salt = Password::createSecureSalt(32, 'hex');
|
||||
$salt = Rhymix\Framework\Security::getRandom(32, 'hex');
|
||||
}
|
||||
return md5($password . $salt) . ':' . $salt;
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ class VendorPass
|
|||
{
|
||||
if (!isset($options['salt']) || !preg_match('/^[0-9a-zA-Z\.\/]{22,}$/', $options['salt']))
|
||||
{
|
||||
$options['salt'] = Password::createSecureSalt(22, 'alnum');
|
||||
$options['salt'] = Rhymix\Framework\Security::getRandom(22, 'alnum');
|
||||
}
|
||||
if (!isset($options['cost']) || $options['cost'] < 4 || $options['cost'] > 31)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue