1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[feature/passwords] Use common salt generation function for all types

We will be using the same method inside the driver helper class for all hash
types. This is the same function that has been used for the salted md5 hash
of phpBB 3.0.

PHPBB3-11610
This commit is contained in:
Marc Alexander
2013-06-15 16:25:03 +02:00
parent 5574b2a8e9
commit 3f70699aa3
3 changed files with 47 additions and 31 deletions

View File

@@ -81,6 +81,6 @@ class phpbb_crypto_driver_bcrypt extends phpbb_crypto_driver_base
*/
protected function get_random_salt()
{
return substr(str_replace('+', '.', bin2hex(openssl_random_pseudo_bytes(22))), 0, 22);
return $this->helper->hash_encode64($this->helper->get_random_salt(22), 22);
}
}