mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-01-06 03:54:12 +02:00
[Web] Validate plain md5 hashes, closes #3017
This commit is contained in:
parent
1580e4b2a5
commit
80a9c39956
@ -386,6 +386,12 @@ function verify_hash($hash, $password) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
elseif (preg_match('/^{PLAIN-MD5}/i', $hash)) {
|
||||
$hash = preg_replace('/^{PLAIN-MD5}/i', '', $hash);
|
||||
if (md5($password) == $hash) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
elseif (preg_match('/^{SHA512-CRYPT}/i', $hash)) {
|
||||
// Remove tag if any
|
||||
$hash = preg_replace('/^{SHA512-CRYPT}/i', '', $hash);
|
||||
|
Loading…
Reference in New Issue
Block a user