diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-09-27 12:13:28 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-09-27 12:13:28 +0200 |
commit | 085fdff5afa56b088fe298d08940afd2900d7d29 (patch) | |
tree | 08f3bf408e11a64efa0ed3be8597527a1a2acc97 /Core/Util | |
parent | 1e2b64278942bd318519cac7ec1af58b0fc711bb (diff) | |
parent | ae2c4c820d9aca6ad7eac272e9c18f72c15dc04a (diff) | |
download | symfony-security-085fdff5afa56b088fe298d08940afd2900d7d29.zip symfony-security-085fdff5afa56b088fe298d08940afd2900d7d29.tar.gz symfony-security-085fdff5afa56b088fe298d08940afd2900d7d29.tar.bz2 |
Merge branch '2.8'
* 2.8: (28 commits)
Detect Mintty for color support on Windows
Detect Mintty for color support on Windows
[WebProfilerBundle] Fix search button click listener
[Form][Type Date/Time] added choice_translation_domain option.
Massively simplifying the BC and deprecated-throwing code thanks to suggestions by stof in #15870
Making all "debug" messages use the debug router
Making GuardTokenInterface extend TokenInterface
Updating behavior to not continue after an authenticator has set the response
Add a group for tests of the finder against the FTP server
Fix trigger_error calls
Fix legacy security tests
tweaking message related to configuration edge case that we want to be helpful with
Minor tweaks - lowering the required security-http requirement and nulling out a test field
Fix license headers
Fix license headers
Fix license headers
Ensure the ClockMock is loaded before using it in the testsuite
Allow serializer 3.0 in the PropertyInfo component
Add the replace rules for the security-guard component
Forbid serializing a Crawler
...
Diffstat (limited to 'Core/Util')
-rw-r--r-- | Core/Util/SecureRandom.php | 8 |
1 files changed, 6 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); |