|
|
@ -440,20 +440,24 @@ class password extends rcube_plugin
|
|
|
|
|
|
|
|
|
|
|
|
case 'sha256-crypt':
|
|
|
|
case 'sha256-crypt':
|
|
|
|
$rounds = (int) $rcmail->config->get('password_crypt_rounds');
|
|
|
|
$rounds = (int) $rcmail->config->get('password_crypt_rounds');
|
|
|
|
if ($rounds < 1000)
|
|
|
|
$prefix = '$5$';
|
|
|
|
$prefix = '$5$';
|
|
|
|
|
|
|
|
else
|
|
|
|
if ($rounds > 1000) {
|
|
|
|
$prefix = '$5$rounds=' . $rounds . '$';
|
|
|
|
$prefix .= 'rounds=' . $rounds . '$';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$crypted = crypt($password, $prefix . self::random_salt(16));
|
|
|
|
$crypted = crypt($password, $prefix . self::random_salt(16));
|
|
|
|
$prefix = '{CRYPT}';
|
|
|
|
$prefix = '{CRYPT}';
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'sha512-crypt':
|
|
|
|
case 'sha512-crypt':
|
|
|
|
$rounds = (int) $rcmail->config->get('password_crypt_rounds');
|
|
|
|
$rounds = (int) $rcmail->config->get('password_crypt_rounds');
|
|
|
|
if ($rounds < 1000)
|
|
|
|
$prefix = '$6$';
|
|
|
|
$prefix = '$6$';
|
|
|
|
|
|
|
|
else
|
|
|
|
if ($rounds > 1000) {
|
|
|
|
$prefix = '$6$rounds=' . $rounds . '$';
|
|
|
|
$prefix .= 'rounds=' . $rounds . '$';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$crypted = crypt($password, $prefix . self::random_salt(16));
|
|
|
|
$crypted = crypt($password, $prefix . self::random_salt(16));
|
|
|
|
$prefix = '{CRYPT}';
|
|
|
|
$prefix = '{CRYPT}';
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|