Skip to content

Commit

Permalink
fix password crypt hash being always evaluated to argon2i as the case…
Browse files Browse the repository at this point in the history
… always returns true if PASSWORD_ARGON2I is defined but the froxlor setting might be set to another hash leading to a useless password

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Feb 3, 2024
1 parent 9c70976 commit ece4b34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Froxlor/Api/Commands/EmailAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ public function add()

// prefix hash-algo
switch (Settings::Get('system.passwordcryptfunc')) {
case defined('PASSWORD_ARGON2I') && PASSWORD_ARGON2I:
case 'argon2i':
$cpPrefix = '{ARGON2I}';
break;
case defined('PASSWORD_ARGON2ID') && PASSWORD_ARGON2ID:
case 'argon2id':
$cpPrefix = '{ARGON2ID}';
break;
default:
Expand Down Expand Up @@ -404,10 +404,10 @@ public function update()
$password = Crypt::validatePassword($password, true);
// prefix hash-algo
switch (Settings::Get('system.passwordcryptfunc')) {
case defined('PASSWORD_ARGON2I') && PASSWORD_ARGON2I:
case 'argon2i':
$cpPrefix = '{ARGON2I}';
break;
case defined('PASSWORD_ARGON2ID') && PASSWORD_ARGON2ID:
case 'argon2id':
$cpPrefix = '{ARGON2ID}';
break;
default:
Expand Down

0 comments on commit ece4b34

Please sign in to comment.