Merge pull request #20767 from nextcloud/enh/argon2id-options
Apply Argon2 options for Argon2id hashing as well
This commit is contained in:
commit
8c023a6579
|
@ -65,7 +65,7 @@ class Hasher implements IHasher {
|
||||||
public function __construct(IConfig $config) {
|
public function __construct(IConfig $config) {
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
||||||
if (\defined('PASSWORD_ARGON2I')) {
|
if (\defined('PASSWORD_ARGON2ID') || \defined('PASSWORD_ARGON2I')) {
|
||||||
// password_hash fails, when the minimum values are undershot.
|
// password_hash fails, when the minimum values are undershot.
|
||||||
// In this case, apply minimum.
|
// In this case, apply minimum.
|
||||||
$this->options['threads'] = max($this->config->getSystemValueInt('hashingThreads', PASSWORD_ARGON2_DEFAULT_THREADS), 1);
|
$this->options['threads'] = max($this->config->getSystemValueInt('hashingThreads', PASSWORD_ARGON2_DEFAULT_THREADS), 1);
|
||||||
|
|
Loading…
Reference in New Issue