8000 [Security/Core] fix checking for bcrypt · symfony/symfony@f01ea99 · GitHub
[go: up one dir, main page]

Skip to content

Commit f01ea99

Browse files
[Security/Core] fix checking for bcrypt
1 parent 061ac77 commit f01ea99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Security/Core/Encoder/NativePasswordEncoder.php

Lines changed: 3 additions & 3 deletions
< 6A5A tr class="diff-line-row">
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public function __construct(int $opsLimit = null, int $memLimit = null, int $cos
5151
$algos = [1 => \PASSWORD_BCRYPT, '2y' => \PASSWORD_BCRYPT];
5252

5353
if (\defined('PASSWORD_ARGON2I')) {
54-
$this->algo = $algos[2] = $algos['argon2i'] = (string) \PASSWORD_ARGON2I;
54+
$this->algo = $algos[2] = $algos['argon2i'] = \PASSWORD_ARGON2I;
5555
}
5656

5757
if (\defined('PASSWORD_ARGON2ID')) {
58-
$this->algo = $algos[3] = $algos['argon2id'] = (string) \PASSWORD_ARGON2ID;
58+
$this->algo = $algos[3] = $algos['argon2id'] = \PASSWORD_ARGON2ID;
5959
}
6060

6161
if (null !== $algo) {
@@ -75,7 +75,7 @@ public function __construct(int $opsLimit = null, int $memLimit = null, int $cos
7575
*/
7676
public function encodePassword($raw, $salt): string
7777
{
78-
if (\strlen($raw) > self::MAX_PASSWORD_LENGTH || ((string) \PASSWORD_BCRYPT === $this->algo && 72 < \strlen($raw))) {
78+
if (\strlen($raw) > self::MAX_PASSWORD_LENGTH || (\PASSWORD_BCRYPT === $this->algo && 72 < \strlen($raw))) {
7979
throw new BadCredentialsException('Invalid password.');
8080
}
8181

0 commit comments

Comments
 (0)
0