Skip to content

Commit 3898e8f

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: minor symfony#25421 grammar typo in docs (michaelKaefer) Extend Argon2i support check to account for sodium_compat
2 parents 4f9dc9d + d21aa19 commit 3898e8f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/Symfony/Component/Lock/StoreInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface StoreInterface
3131
public function save(Key $key);
3232

3333
/**
34-
* Waits a key becomes free, then stores the resource.
34+
* Waits until a key becomes free, then stores the resource.
3535
*
3636
* If the store does not support this feature it should throw a NotSupportedException.
3737
*

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ class Argon2iPasswordEncoder extends BasePasswordEncoder implements SelfSaltingE
2222
{
2323
public static function isSupported()
2424
{
25-
return (\PHP_VERSION_ID >= 70200 && \defined('PASSWORD_ARGON2I'))
26-
|| \function_exists('sodium_crypto_pwhash_str')
27-
|| \extension_loaded('libsodium');
25+
if (\defined('PASSWORD_ARGON2I')) {
26+
return true;
27+
}
28+
29+
if (\class_exists('ParagonIE_Sodium_Compat') && \method_exists('ParagonIE_Sodium_Compat', 'crypto_pwhash_is_available')) {
30+
return \ParagonIE_Sodium_Compat::crypto_pwhash_is_available();
31+
}
32+
33+
return \function_exists('sodium_crypto_pwhash_str') || \extension_loaded('libsodium');
2834
}
2935

3036
/**

0 commit comments

Comments
 (0)