summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/ldap.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/password/drivers/ldap.php')
-rw-r--r--plugins/password/drivers/ldap.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php
index d46da0b26..d11dbdc7d 100644
--- a/plugins/password/drivers/ldap.php
+++ b/plugins/password/drivers/ldap.php
@@ -232,8 +232,12 @@ class rcube_ldap_password
return false;
}
- /* Hardcoded to second blowfish version and set number of rounds */
- $crypted_password = '{CRYPT}' . crypt($password_clear, '$2a$12$' . self::random_salt(13));
+ $rcmail = rcmail::get_instance();
+ $cost = (int) $rcmail->config->get('password_blowfish_cost');
+ $cost = $cost < 4 || $cost > 31 ? 12 : $cost;
+ $prefix = sprintf('$2a$%02d$', $cost);
+
+ $crypted_password = '{CRYPT}' . crypt($password_clear, $prefix . self::random_salt(22));
break;
case 'md5':