aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/passwords/driver/sha_xf1.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-06-02 10:14:26 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-06-02 10:14:26 +0200
commitac311e1b39f891ba3c137f6203981c491639bec3 (patch)
tree43e76978dcbc89aec7ad6a65d2f08cadc62772e6 /phpBB/phpbb/passwords/driver/sha_xf1.php
parent94b2b64ca199f3db66818c3830c96ea9ff7eeff9 (diff)
downloadforums-ac311e1b39f891ba3c137f6203981c491639bec3.tar
forums-ac311e1b39f891ba3c137f6203981c491639bec3.tar.gz
forums-ac311e1b39f891ba3c137f6203981c491639bec3.tar.bz2
forums-ac311e1b39f891ba3c137f6203981c491639bec3.tar.xz
forums-ac311e1b39f891ba3c137f6203981c491639bec3.zip
[ticket/12352] Do not check hashes that don't have the necessary length
This should significantly reduce the time spent on checking hashes of passwords that should be converted. PHPBB3-12352
Diffstat (limited to 'phpBB/phpbb/passwords/driver/sha_xf1.php')
-rw-r--r--phpBB/phpbb/passwords/driver/sha_xf1.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/phpBB/phpbb/passwords/driver/sha_xf1.php b/phpBB/phpbb/passwords/driver/sha_xf1.php
index 08b8cecaf3..7ae0b90f51 100644
--- a/phpBB/phpbb/passwords/driver/sha_xf1.php
+++ b/phpBB/phpbb/passwords/driver/sha_xf1.php
@@ -47,7 +47,7 @@ class sha_xf1 extends base
*/
public function check($password, $hash, $user_row = array())
{
- if (empty($hash) || !isset($user_row['user_passwd_salt']))
+ if (empty($hash) || (strlen($hash) != 40 && strlen($hash) != 64) || !isset($user_row['user_passwd_salt']))
{
return false;
}