Skip to content

Commit f539932

Browse files
committed
fixed CS
1 parent fa7df09 commit f539932

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

UPGRADE-5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ Security
327327
```
328328

329329
* Using `Argon2iPasswordEncoder` while only the `argon2id` algorithm is supported
330-
now throws a \LogicException`, use `Argon2idPasswordEncoder` instead
330+
now throws a `\LogicException`, use `Argon2idPasswordEncoder` instead
331331

332332
SecurityBundle
333333
--------------

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ public function encodePassword($raw, $salt)
4646
if (\defined('PASSWORD_ARGON2ID')) {
4747
return $this->encodePasswordNative($raw, \PASSWORD_ARGON2ID);
4848
}
49-
if (\defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
50-
$hash = \sodium_crypto_pwhash_str(
51-
$raw,
52-
\SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
53-
\SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
54-
);
55-
\sodium_memzero($raw);
56-
57-
return $hash;
49+
if (!\defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
50+
throw new LogicException('Algorithm "argon2id" is not supported. Please install the libsodium extension or upgrade to PHP 7.3+.');
5851
}
5952

60-
throw new LogicException('Algorithm "argon2id" is not supported. Please install the libsodium extension or upgrade to PHP 7.3+.');
53+
$hash = \sodium_crypto_pwhash_str(
54+
$raw,
55+
\SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
56+
\SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
57+
);
58+
\sodium_memzero($raw);
59+
60+
return $hash;
6161
}
6262

6363
/**

0 commit comments

Comments
 (0)