summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-02-11 23:22:20 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-02-11 23:22:20 +0100
commitf1ea56b5024729e01050249a0c4ee7ac28faca83 (patch)
treee1c868f20d1275262ec2f3ce1e9744cd9a2aeef3 /tests
parente3c787682dfebec2c8e4071aa570a7ee9f77ea52 (diff)
downloadnextcloud-server-f1ea56b5024729e01050249a0c4ee7ac28faca83.tar.gz
nextcloud-server-f1ea56b5024729e01050249a0c4ee7ac28faca83.zip
Fix the thorrtler whitelist bitmask
Before we actually didn't check each bit of the bitmask. Now we do. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Security/Bruteforce/ThrottlerTest.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/lib/Security/Bruteforce/ThrottlerTest.php b/tests/lib/Security/Bruteforce/ThrottlerTest.php
index dac12a00dcd..da386db9d2d 100644
--- a/tests/lib/Security/Bruteforce/ThrottlerTest.php
+++ b/tests/lib/Security/Bruteforce/ThrottlerTest.php
@@ -101,6 +101,27 @@ class ThrottlerTest extends TestCase {
true,
],
[
+ '10.10.10.10',
+ [
+ 'whitelist_0' => '10.10.10.11/31',
+ ],
+ true,
+ ],
+ [
+ '10.10.10.10',
+ [
+ 'whitelist_0' => '10.10.10.9/31',
+ ],
+ false,
+ ],
+ [
+ '10.10.10.10',
+ [
+ 'whitelist_0' => '10.10.10.15/29',
+ ],
+ true,
+ ],
+ [
'dead:beef:cafe::1',
[
'whitelist_0' => '192.168.0.0/16',
@@ -128,6 +149,14 @@ class ThrottlerTest extends TestCase {
true,
],
[
+ 'dead:beef:cafe::1111',
+ [
+ 'whitelist_0' => 'dead:beef:cafe::1100/123',
+
+ ],
+ true,
+ ],
+ [
'invalid',
[],
false,