From 141bef75cb924644191c90bd722a250ef60099b7 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 29 Dec 2013 17:04:38 +0100 Subject: [feature/passwords] Undo simplification to bcrypt driver By simplifying, a needed part was removed that is actually required. PHPBB3-11610 --- phpBB/phpbb/passwords/driver/bcrypt.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/passwords/driver') diff --git a/phpBB/phpbb/passwords/driver/bcrypt.php b/phpBB/phpbb/passwords/driver/bcrypt.php index b16d2ada56..1d1b1e267d 100644 --- a/phpBB/phpbb/passwords/driver/bcrypt.php +++ b/phpBB/phpbb/passwords/driver/bcrypt.php @@ -29,8 +29,9 @@ class bcrypt extends base */ public function hash($password, $salt = '') { - // Get prefix of this driver - $prefix = $this->get_prefix(); + // The 2x and 2y prefixes of bcrypt might not be supported + // Revert to 2a if this is the case + $prefix = (!$this->is_supported()) ? '$2a$' : $this->get_prefix(); // Do not support 8-bit characters with $2a$ bcrypt // Also see http://www.php.net/security/crypt_blowfish.php -- cgit v1.2.1