From ad606196554dadea49e5ddfa44fb54b89ba24d3e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 28 Apr 2020 21:04:34 +0200 Subject: Fix Argon2 options checks The minimum for memory cost is 8 KiB per thread. Threads must be checked and set first to allow checking against the correct memory cost mimimum. Options are now applied the following way: - If config.php contains the setting with an integer higher or equal to the minimum, it is applied. - If config.php contains the setting with an integer lower than the minimum, the minimum is applied. - If config.php does not contain the setting or with no integer value, the PHP default is applied. Signed-off-by: MichaIng Signed-off-by: Roeland Jago Douma --- tests/lib/Security/HasherTest.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/lib/Security/HasherTest.php') diff --git a/tests/lib/Security/HasherTest.php b/tests/lib/Security/HasherTest.php index cc5cb786088..e1faef2f69b 100644 --- a/tests/lib/Security/HasherTest.php +++ b/tests/lib/Security/HasherTest.php @@ -113,6 +113,11 @@ class HasherTest extends \Test\TestCase { $this->config = $this->createMock(IConfig::class); + $this->config->method('getSystemValueInt') + ->willReturnCallback(function ($name, $default) { + return $default; + }); + $this->hasher = new Hasher($this->config); } -- cgit v1.2.3