aboutsummaryrefslogtreecommitdiffstats
path: root/tests/security/hash_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-10-03 10:04:59 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-10-03 10:04:59 +0200
commit7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c (patch)
treeaceb567afda7467738ab6b693dc9595a40ac7f2f /tests/security/hash_test.php
parent93531e7fb0df7d9cd2de04ca06aa9eb6a847a1c4 (diff)
parent49ce2c13b26e358b4ccef440094a8fa4b6b9afd7 (diff)
downloadforums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar
forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar.gz
forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar.bz2
forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar.xz
forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.zip
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/passwords
Conflicts: phpBB/includes/functions.php
Diffstat (limited to 'tests/security/hash_test.php')
-rw-r--r--tests/security/hash_test.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php
index 76d7d22a00..f7d2c0dad8 100644
--- a/tests/security/hash_test.php
+++ b/tests/security/hash_test.php
@@ -44,5 +44,13 @@ class phpbb_security_hash_test extends phpbb_test_case
$this->assertTrue(phpbb_check_hash('test', '$P$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
$this->assertFalse(phpbb_check_hash('foo', '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
}
+
+ public function test_check_hash_with_large_input()
+ {
+ // 16 MB password, should be rejected quite fast
+ $start_time = time();
+ $this->assertFalse(phpbb_check_hash(str_repeat('a', 1024 * 1024 * 16), '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
+ $this->assertLessThanOrEqual(5, time() - $start_time);
+ }
}