Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Illuminate/Hashing/ArgonHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(array $options = [])
{
$this->time = $options['time'] ?? $this->time;
$this->memory = $options['memory'] ?? $this->memory;
$this->threads = $options['threads'] ?? $this->threads;
$this->threads = $this->threads($options);
$this->verifyAlgorithm = $options['verify'] ?? $this->verifyAlgorithm;
}

Expand Down Expand Up @@ -187,6 +187,10 @@ protected function time(array $options)
*/
protected function threads(array $options)
{
if (defined('PASSWORD_ARGON2_PROVIDER') && PASSWORD_ARGON2_PROVIDER === 'sodium') {
return 1;
}

return $options['threads'] ?? $this->threads;
}
}
12 changes: 0 additions & 12 deletions tests/Hashing/HasherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ public function testBasicBcryptHashing()

public function testBasicArgon2iHashing()
{
if (\PHP_VERSION_ID >= 80100) {
$this->markTestSkipped('Test failing in PHP 8.1');
}

if (! defined('PASSWORD_ARGON2I')) {
$this->markTestSkipped('PHP not compiled with Argon2i hashing support.');
}
Expand All @@ -42,10 +38,6 @@ public function testBasicArgon2iHashing()

public function testBasicArgon2idHashing()
{
if (\PHP_VERSION_ID >= 80100) {
$this->markTestSkipped('Test failing in PHP 8.1');
}

if (! defined('PASSWORD_ARGON2ID')) {
$this->markTestSkipped('PHP not compiled with Argon2id hashing support.');
}
Expand All @@ -64,10 +56,6 @@ public function testBasicArgon2idHashing()
*/
public function testBasicBcryptVerification()
{
if (\PHP_VERSION_ID >= 80100) {
$this->markTestSkipped('Test failing in PHP 8.1');
}

$this->expectException(RuntimeException::class);

if (! defined('PASSWORD_ARGON2I')) {
Expand Down