Aleksander Machniak
2015-09-06 25b30a78b7ff8536a65592deede7222d216e6e21
plugins/password/password.php
@@ -439,12 +439,22 @@
            break;
        case 'sha256-crypt':
            $crypted = crypt($password, '$5$' . self::random_salt(16));
            $rounds = (int) $rcmail->config->get('password_crypt_rounds');
            if ($rounds < 1000)
                $prefix = '$5$';
            else
                $prefix = '$5$rounds=' . $rounds . '$';
            $crypted = crypt($password, $prefix . self::random_salt(16));
            $prefix  = '{CRYPT}';
            break;
        case 'sha512-crypt':
            $crypted = crypt($password, '$6$' . self::random_salt(16));
            $rounds = (int) $rcmail->config->get('password_crypt_rounds');
            if ($rounds < 1000)
                $prefix = '$6$';
            else
                $prefix = '$6$rounds=' . $rounds . '$';
            $crypted = crypt($password, $prefix . self::random_salt(16));
            $prefix  = '{CRYPT}';
            break;