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

Commit

Permalink
[Security] minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jun 13, 2019
1 parent 86658a1 commit 6d3fa06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Core/Encoder/SodiumPasswordEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ public function __construct(int $opsLimit = null, int $memLimit = null)

public static function isSupported(): bool
{
if (\extension_loaded('libsodium') || \function_exists('sodium_crypto_pwhash_str')) {
return true;
}

if (class_exists('ParagonIE_Sodium_Compat') && method_exists('ParagonIE_Sodium_Compat', 'crypto_pwhash_is_available')) {
return \ParagonIE_Sodium_Compat::crypto_pwhash_is_available();
}

return \function_exists('sodium_crypto_pwhash_str') || \extension_loaded('libsodium');
return false;
}

/**
Expand Down

0 comments on commit 6d3fa06

Please sign in to comment.