Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93fcdb8

Browse files
[PasswordHasher] Skip test on nul byte for PHP versions that doesn't support it with Bcrypt
1 parentfbc47bc commit93fcdb8

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎src/Symfony/Component/PasswordHasher/Tests/Hasher/NativePasswordHasherTest.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ public function testBcryptWithLongPassword()
9898
$this->assertTrue($hasher->verify($hasher->hash($plainPassword),$plainPassword));
9999
}
100100

101+
/**
102+
* "password_hash()" does not accept passwords containing NUL bytes prior to PHP 8.2
103+
* and throws a ValueError, thus this test is skipped because `$hasher->verify()` will
104+
* not be executed.
105+
*
106+
* @requires PHP >= 8.2
107+
*/
101108
publicfunctiontestBcryptWithNulByte()
102109
{
103110
$hasher =newNativePasswordHasher(null,null,4, \PASSWORD_BCRYPT);

‎src/Symfony/Component/PasswordHasher/Tests/Hasher/SodiumPasswordHasherTest.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ public function testBcryptWithLongPassword()
7373
$this->assertTrue($hasher->verify((newNativePasswordHasher(null,null,4, \PASSWORD_BCRYPT))->hash($plainPassword),$plainPassword));
7474
}
7575

76+
/**
77+
* "password_hash()" does not accept passwords containing NUL bytes prior to PHP 8.2
78+
* and throws a ValueError, thus this test is skipped because `$hasher->verify()` will
79+
* not be executed.
80+
*
81+
* @requires PHP >= 8.2
82+
*/
7683
publicfunctiontestBcryptWithNulByte()
7784
{
7885
$hasher =newSodiumPasswordHasher(null,null);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp