From ece4b34f259787bb5d24a98ab2c16b8cd289e69c Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 3 Feb 2024 10:12:36 +0100 Subject: [PATCH] fix password crypt hash being always evaluated to argon2i as the case 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 --- lib/Froxlor/Api/Commands/EmailAccounts.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Froxlor/Api/Commands/EmailAccounts.php b/lib/Froxlor/Api/Commands/EmailAccounts.php index d8799ded..b69da105 100644 --- a/lib/Froxlor/Api/Commands/EmailAccounts.php +++ b/lib/Froxlor/Api/Commands/EmailAccounts.php @@ -157,10 +157,10 @@ class EmailAccounts extends ApiCommand implements ResourceEntity // 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: @@ -404,10 +404,10 @@ class EmailAccounts extends ApiCommand implements ResourceEntity $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: