Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Security] tweaked previous commit

  • Loading branch information...
commit e22e111027f80ff3f74f2039e2e56e2dc73c863e 1 parent 4d0d663
@fabpot fabpot authored
View
39 DependencyInjection/SecurityExtension.php
@@ -452,42 +452,33 @@ private function createEncoder($config, ContainerBuilder $container)
// pbkdf2 encoder
if ('pbkdf2' === $config['algorithm']) {
- $arguments = array(
- $config['hash_algorithm'],
- $config['encode_as_base64'],
- $config['iterations'],
- $config['key_length'],
- );
-
return array(
- 'class' => new Parameter('security.encoder.pbkdf2.class'),
- 'arguments' => $arguments,
+ 'class' => new Parameter('security.encoder.pbkdf2.class'),
+ 'arguments' => array(
+ $config['hash_algorithm'],
+ $config['encode_as_base64'],
+ $config['iterations'],
+ $config['key_length'],
+ ),
);
}
// bcrypt encoder
if ('bcrypt' === $config['algorithm']) {
- $arguments = array(
- new Reference('security.secure_random'),
- $config['cost'],
- );
-
return array(
- 'class' => new Parameter('security.encoder.bcrypt.class'),
- 'arguments' => $arguments,
+ 'class' => new Parameter('security.encoder.bcrypt.class'),
+ 'arguments' => array($config['cost']),
);
}
// message digest encoder
- $arguments = array(
- $config['algorithm'],
- $config['encode_as_base64'],
- $config['iterations'],
- );
-
return array(
- 'class' => new Parameter('security.encoder.digest.class'),
- 'arguments' => $arguments,
+ 'class' => new Parameter('security.encoder.digest.class'),
+ 'arguments' => array(
+ $config['algorithm'],
+ $config['encode_as_base64'],
+ $config['iterations'],
+ ),
);
}
View
5 Tests/DependencyInjection/SecurityExtensionTest.php
@@ -160,10 +160,7 @@ public function testEncoders()
),
'JMS\FooBundle\Entity\User6' => array(
'class' => new Parameter('security.encoder.bcrypt.class'),
- 'arguments' => array(
- new Reference('security.secure_random'),
- 15,
- )
+ 'arguments' => array(15),
),
)), $container->getDefinition('security.encoder_factory.generic')->getArguments());
}
Please sign in to comment.
Something went wrong with that request. Please try again.