From bcffebaabed47f9b273cb9cfac2d051bfa6c11c0 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Wed, 2 Dec 2020 20:32:39 +0100 Subject: [PATCH] support pre-hashed passwords (#3884) --- data/web/inc/functions.mailbox.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 518dee15..603c5a8c 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -1054,7 +1054,12 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); return false; } - $password_hashed = hash_password($password); + // support pre hashed passwords + if(preg_match('/^{SSHA256}|{SHA512-CRYPT}|{SSHA512}|{MD5-CRYPT}|{PLAIN-MD5}/i', $password)) { + $password_hashed = $password; + } else { + $password_hashed = hash_password($password); + } } else { $_SESSION['return'][] = array(