diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2013-08-22 19:21:42 -0500 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2013-09-14 13:55:45 +0200 |
| commit | 8b9370c6a956447be304b609eb63d029cb19f2dc (patch) | |
| tree | 97ed901c76445f1b521c383610b5b046e03eff51 /phpBB | |
| parent | 58755c4972128923f12cc1511bd24c36912bf890 (diff) | |
| download | forums-8b9370c6a956447be304b609eb63d029cb19f2dc.tar forums-8b9370c6a956447be304b609eb63d029cb19f2dc.tar.gz forums-8b9370c6a956447be304b609eb63d029cb19f2dc.tar.bz2 forums-8b9370c6a956447be304b609eb63d029cb19f2dc.tar.xz forums-8b9370c6a956447be304b609eb63d029cb19f2dc.zip | |
[feature/passwords] Define default hashing algorithm in container file
The default hashing algorithm type is defined as a parameter in the service
definition file for the password hashing system. This will allow us to change
this in the future but it will also prevent unexperienced admins from changing
the hashing algorithm.
PHPBB3-11610
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/config/crypto.yml | 11 | ||||
| -rw-r--r-- | phpBB/config/services.yml | 7 | ||||
| -rw-r--r-- | phpBB/phpbb/crypto/manager.php | 4 |
3 files changed, 13 insertions, 9 deletions
diff --git a/phpBB/config/crypto.yml b/phpBB/config/crypto.yml index 072995a8a8..2ef942df66 100644 --- a/phpBB/config/crypto.yml +++ b/phpBB/config/crypto.yml @@ -1,3 +1,6 @@ +parameters: + password_hashing.algorithm: crypto.driver.bcrypt_2y + services: crypto.driver.bcrypt: class: phpbb_crypto_driver_bcrypt @@ -41,3 +44,11 @@ services: - @service_container tags: - { name: service_collection, tag: crypto.driver } + + crypto.manager: + class: phpbb_crypto_manager + arguments: + - @config + - @service_container + - @crypto.driver_collection + - %password_hashing.algorithm% diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index e7c3232fa7..486df3f556 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -122,13 +122,6 @@ services: - @config - @dbal.conn - crypto.manager: - class: phpbb_crypto_manager - arguments: - - @config - - @service_container - - @crypto.driver_collection - dispatcher: class: phpbb_event_dispatcher arguments: diff --git a/phpBB/phpbb/crypto/manager.php b/phpBB/phpbb/crypto/manager.php index 753a86ae84..e314b08865 100644 --- a/phpBB/phpbb/crypto/manager.php +++ b/phpBB/phpbb/crypto/manager.php @@ -58,11 +58,11 @@ class phpbb_crypto_manager * * @param phpbb_config $config phpBB configuration */ - public function __construct($config, $container, $hashing_algorithms) + public function __construct($config, $container, $hashing_algorithms, $default) { $this->config = $config; $this->container = $container; - $this->type = 'crypto.driver.bcrypt_2y'; // might want to make this flexible + $this->type = $default; $this->fill_type_map($hashing_algorithms); $this->load_crypto_helper(); |
