Skip to content

Removed SecureRandom class #15880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"php": ">=5.5.9",
"doctrine/common": "~2.4",
"twig/twig": "~1.20|~2.0",
"psr/log": "~1.0"
"psr/log": "~1.0",
"paragonie/random_compat": "~1.0"
},
"replace": {
"symfony/asset": "self.version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public function load(array $configs, ContainerBuilder $container)
$this->registerRequestConfiguration($config['request'], $container, $loader);
}

$loader->load('security.xml');

if ($this->isConfigEnabled($container, $config['form'])) {
$this->formConfigEnabled = true;
$this->registerFormConfiguration($config, $container, $loader);
Expand Down
15 changes: 0 additions & 15 deletions src/Symfony/Bundle/FrameworkBundle/Resources/config/security.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<services>
<service id="security.csrf.token_generator" class="Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator" public="false">
<argument type="service" id="security.secure_random" />
</service>

<service id="security.csrf.token_storage" class="Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage" public="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ public function testCsrfProtectionForFormsEnablesCsrfProtectionAutomatically()
$this->assertTrue($container->hasDefinition('security.csrf.token_manager'));
}

public function testSecureRandomIsAvailableIfCsrfIsDisabled()
{
$container = $this->createContainerFromFile('csrf_disabled');

$this->assertTrue($container->hasDefinition('security.secure_random'));
}

public function testProxies()
{
$container = $this->createContainerFromFile('full');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@ private function createPasswordQuestion()

private function generateSalt()
{
return base64_encode($this->getContainer()->get('security.secure_random')->nextBytes(30));
return base64_encode(random_bytes(30));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
class="Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices"
parent="security.authentication.rememberme.services.abstract"
abstract="true">
<argument type="service" id="security.secure_random" />
</service>

<service id="security.authentication.rememberme.services.simplehash"
Expand Down
201 changes: 0 additions & 201 deletions src/Symfony/Component/Security/Core/Tests/Util/SecureRandomTest.php

This file was deleted.

112 changes: 0 additions & 112 deletions src/Symfony/Component/Security/Core/Util/SecureRandom.php

This file was deleted.

Loading