Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  Fix CI
  Bump ext-redis in CI on PHP >= 8.4
  Adjust pretty name of closures on PHP 8.4
  implement NodeVisitorInterface instead of extending AbstractNodeVisitor
  sync .github/expected-missing-return-types.diff
  skip test assertions that are no longer valid with PHP >= 8.2.18/8.3.5
  • Loading branch information
nicolas-grekas committed Apr 16, 2024
2 parents 0eba656 + ff0e04b commit 917f92e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Tests/Hasher/NativePasswordHasherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ public function testBcryptWithNulByte()
$hasher = new NativePasswordHasher(null, null, 4, \PASSWORD_BCRYPT);
$plainPassword = "a\0b";

$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
if (\PHP_VERSION_ID < 80218 || \PHP_VERSION_ID >= 80300 && \PHP_VERSION_ID < 80305) {
// password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
}

$this->assertTrue($hasher->verify($hasher->hash($plainPassword), $plainPassword));
}

Expand Down
6 changes: 5 additions & 1 deletion Tests/Hasher/SodiumPasswordHasherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ public function testBcryptWithNulByte()
$hasher = new SodiumPasswordHasher(null, null);
$plainPassword = "a\0b";

$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
if (\PHP_VERSION_ID < 80218 || \PHP_VERSION_ID >= 80300 && \PHP_VERSION_ID < 80305) {
// password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
}

$this->assertTrue($hasher->verify((new NativePasswordHasher(null, null, 4, \PASSWORD_BCRYPT))->hash($plainPassword), $plainPassword));
}

Expand Down

0 comments on commit 917f92e

Please sign in to comment.