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 95c1fc8

Browse filesBrowse files
committed
Extend Argon2i support check to account for sodium_compat
1 parent 17b5a2c commit 95c1fc8
Copy full SHA for 95c1fc8

File tree

1 file changed

+9
-3
lines changed
Filter options

1 file changed

+9
-3
lines changed

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

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