You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-07 17:42:53 +03:00
functions.inc.php pacrypt():
- for 'system' encryption, use full hashed password as salt https://sourceforge.net/p/postfixadmin/bugs/2/ git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1595 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
@@ -861,17 +861,11 @@ function pacrypt ($pw, $pw_db="") {
|
||||
}
|
||||
|
||||
elseif ($CONF['encrypt'] == 'system') {
|
||||
if (preg_match("/\\$1\\$/", $pw_db)) {
|
||||
$split_salt = preg_split ('/\$/', $pw_db);
|
||||
$salt = "\$1\$${split_salt[2]}\$";
|
||||
if ($pw_db) {
|
||||
$password = crypt($pw, $pw_db);
|
||||
} else {
|
||||
if (strlen($pw_db) == 0) {
|
||||
$salt = substr (md5 (mt_rand ()), 0, 2);
|
||||
} else {
|
||||
$salt = substr ($pw_db, 0, 2);
|
||||
}
|
||||
$password = crypt($pw);
|
||||
}
|
||||
$password = crypt ($pw, $salt);
|
||||
}
|
||||
|
||||
elseif ($CONF['encrypt'] == 'cleartext') {
|
||||
|
Reference in New Issue
Block a user