1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

Merge branch 'prep-release-3.0.12' into develop-olympus

* prep-release-3.0.12:
  [prep-release-3.0.12] Update changelog for 3.0.12 release.
  [ticket/11873] Add unit test for large password input.
  [ticket/11873] Do not hash very large passwords in order to safe resources.
This commit is contained in:
Andreas Fischer
2013-09-28 15:02:44 +02:00
3 changed files with 16 additions and 0 deletions

View File

@@ -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)
{