diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-09-27 01:18:28 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-09-28 03:12:50 +0200 |
commit | cba28c39ad63920c05241f59ce7e1ad6b47039df (patch) | |
tree | 50a35ab03f5e1373d9de6c3989b0ca857a581820 | |
parent | d18bded3acf8e307a5329fe3777b616bbc1d9119 (diff) | |
download | forums-cba28c39ad63920c05241f59ce7e1ad6b47039df.tar forums-cba28c39ad63920c05241f59ce7e1ad6b47039df.tar.gz forums-cba28c39ad63920c05241f59ce7e1ad6b47039df.tar.bz2 forums-cba28c39ad63920c05241f59ce7e1ad6b47039df.tar.xz forums-cba28c39ad63920c05241f59ce7e1ad6b47039df.zip |
[ticket/11873] Do not hash very large passwords in order to safe resources.
PHPBB3-11873
-rw-r--r-- | phpBB/includes/functions.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b2b12c1445..eef4ade4e7 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -502,6 +502,13 @@ function phpbb_hash($password) */ function phpbb_check_hash($password, $hash) { + if (strlen($password) > 4096) + { + // If the password is too huge, we will simply reject it + // and not let the server try to hash it. + return false; + } + $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if (strlen($hash) == 34) { |