diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-09-27 12:08:38 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-09-27 12:08:38 +0200 |
commit | 74116250c103acec51ba89d325427261b3ea0272 (patch) | |
tree | 4e237b2c8377e5abf9e8465100c89a12fa1769dc | |
parent | db16d7ce3ea2faac274650a7c57ff49dde82f853 (diff) | |
parent | 7aac5b9786bacbf018c2c6519df666b666bf652e (diff) | |
download | symfony-security-74116250c103acec51ba89d325427261b3ea0272.zip symfony-security-74116250c103acec51ba89d325427261b3ea0272.tar.gz symfony-security-74116250c103acec51ba89d325427261b3ea0272.tar.bz2 |
Merge branch '2.3' into 2.7
* 2.3:
Detect Mintty for color support on Windows
Add a group for tests of the finder against the FTP server
Fix license headers
Forbid serializing a Crawler
Fix phpdoc block of NativeSessionStorage class
Added exception when setAutoInitialize is called when locked
[FrameworkBundle] Advanced search templates of bundles
[Security] Allow user providers to be defined in many files
Use random_bytes function if it is available for random number generation
-rw-r--r-- | Core/Util/SecureRandom.php | 8 | ||||
-rw-r--r-- | composer.json | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Core/Util/SecureRandom.php b/Core/Util/SecureRandom.php index f4167e4..65722ce 100644 --- a/Core/Util/SecureRandom.php +++ b/Core/Util/SecureRandom.php @@ -43,9 +43,9 @@ final class SecureRandom implements SecureRandomInterface $this->logger = $logger; // determine whether to use OpenSSL - if (!function_exists('openssl_random_pseudo_bytes')) { + if (!function_exists('random_bytes') && !function_exists('openssl_random_pseudo_bytes')) { if (null !== $this->logger) { - $this->logger->notice('It is recommended that you enable the "openssl" extension for random number generation.'); + $this->logger->notice('It is recommended that you install the "paragonie/random_compat" library or enable the "openssl" extension for random number generation.'); } $this->useOpenSsl = false; } else { @@ -58,6 +58,10 @@ final class SecureRandom implements SecureRandomInterface */ public function nextBytes($nbBytes) { + if (function_exists('random_bytes')) { + return random_bytes($nbBytes); + } + // try OpenSSL if ($this->useOpenSsl) { $bytes = openssl_random_pseudo_bytes($nbBytes, $strong); diff --git a/composer.json b/composer.json index aeea64a..53ab0b7 100644 --- a/composer.json +++ b/composer.json @@ -42,11 +42,13 @@ "suggest": { "symfony/class-loader": "For using the ACL generateSql script", "symfony/finder": "For using the ACL generateSql script", + "symfony/form": "", "symfony/validator": "For using the user password constraint", "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", "doctrine/dbal": "For using the built-in ACL implementation", "symfony/expression-language": "For using the expression voter", "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5" + "paragonie/random_compat": "" }, "autoload": { "psr-4": { "Symfony\\Component\\Security\\": "" } |