Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 56f1b9a

Browse files
Merge branch '4.2'
* 4.2: Bump phpunit bridge cache id [appveyor] fix create-project phpunit Fix HttpKernel Debug requirement Fix heredoc use final annotation to allow mocking the class synchronise the form builder docblock Grammar fix in exception message fix tests forward the parse error to the calling code Avoid dots in generated class names. [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends ensure compatibility with older PHPUnit mocks [Security] Do not mix usage of password_*() functions and sodium_*() ones
2 parents 8b059ae + f2826fa commit 56f1b9a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Core/Encoder/Argon2iPasswordEncoder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ public function encodePassword($raw, $salt)
8181
*/
8282
public function isPasswordValid($encoded, $raw, $salt)
8383
{
84-
if (\PHP_VERSION_ID >= 70200 && \defined('PASSWORD_ARGON2I')) {
84+
// If $encoded was created via "sodium_crypto_pwhash_str()", the hashing algorithm may be "argon2id" instead of "argon2i".
85+
// In this case, "password_verify()" cannot be used.
86+
if (\PHP_VERSION_ID >= 70200 && \defined('PASSWORD_ARGON2I') && (false === strpos($encoded, '$argon2id$'))) {
8587
return !$this->isPasswordTooLong($raw) && password_verify($raw, $encoded);
8688
}
8789
if (\function_exists('sodium_crypto_pwhash_str_verify')) {

Core/Security.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717

1818
/**
1919
* Helper class for commonly-needed security tasks.
20+
*
21+
* @final
2022
*/
21-
final class Security
23+
class Security
2224
{
2325
const ACCESS_DENIED_ERROR = '_security.403_error';
2426
const AUTHENTICATION_ERROR = '_security.last_error';

0 commit comments

Comments
 (0)