Skip to content

Commit

Permalink
bug #36151 [Security] Fixed hardcoded value of SODIUM_CRYPTO_PWHASH_M…
Browse files Browse the repository at this point in the history
…EMLIMIT_INTERACTIVE (lyrixx)

This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Fixed hardcoded value of SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

6774294 [Security] Fixed hardcoded value of SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
  • Loading branch information
nicolas-grekas committed Mar 20, 2020
2 parents 7866144 + 6774294 commit 8397eb7
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -35,7 +35,7 @@ public function __construct(int $opsLimit = null, int $memLimit = null)
}

$this->opsLimit = $opsLimit ?? max(4, \defined('SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE') ? SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE : 4);
$this->memLimit = $memLimit ?? max(64 * 1024 * 1024, \defined('SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE') ? SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE : 64 * 1024 * 2014);
$this->memLimit = $memLimit ?? max(64 * 1024 * 1024, \defined('SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE') ? SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE : 64 * 1024 * 1024);

if (3 > $this->opsLimit) {
throw new \InvalidArgumentException('$opsLimit must be 3 or greater.');
Expand Down

0 comments on commit 8397eb7

Please sign in to comment.