Skip to content

Commit 1ccf30b

Browse files
authored
Update hash algo to default to the PASSWORD_DEFAULT constant if not specified. Also changed the ARGON default to ARGON2ID.
1 parent 14a9bb1 commit 1ccf30b

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

models/Ion_auth_model.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,19 +2646,13 @@ protected function _get_hash_parameters($identity = NULL)
26462646
*/
26472647
protected function _get_hash_algo()
26482648
{
2649-
$algo = FALSE;
2650-
switch ($this->hash_method)
2651-
{
2652-
case 'bcrypt':
2653-
$algo = PASSWORD_BCRYPT;
2654-
break;
2655-
2656-
case 'argon2':
2657-
$algo = PASSWORD_ARGON2I;
2658-
break;
2659-
2660-
default:
2661-
// Do nothing
2649+
$algo = PASSWORD_DEFAULT;
2650+
2651+
if ($this->hash_method === 'bcrypt') {
2652+
$algo = PASSWORD_BCRYPT;
2653+
}
2654+
else if ($this->hash_method === 'argon2') {
2655+
$algo = PASSWORD_ARGON2ID;
26622656
}
26632657

26642658
return $algo;

0 commit comments

Comments
 (0)