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

Appearance settings

Commit f539932

Browse filesBrowse files
committed
fixed CS
1 parent fa7df09 commit f539932
Copy full SHA for f539932

File tree

2 files changed

+11
-11
lines changed
Filter options

2 files changed

+11
-11
lines changed

‎UPGRADE-5.0.md

Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Encoder/Argon2idPasswordEncoder.php
+10-10Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.