diff options
author | MichaIng <micha@dietpi.com> | 2020-04-28 22:04:34 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-05-01 12:37:24 +0300 |
commit | e5f1523577dc027621092d95166f20fcee95cf96 (patch) | |
tree | f6e0f8a91ca56cc5c93bd23e169ca950b770cbb8 /tests | |
parent | cfd6f0b6fbbbb6d1597ff6dce6dfc3270af40c0f (diff) |
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 <micha@dietpi.com>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Security/HasherTest.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/lib/Security/HasherTest.php b/tests/lib/Security/HasherTest.php index e680efb19b6..598139736ff 100644 --- a/tests/lib/Security/HasherTest.php +++ b/tests/lib/Security/HasherTest.php @@ -102,6 +102,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); } |