[feature/passwords] Correctly supply hash salt and settings to bcrypt

PHPBB3-11610
This commit is contained in:
Marc Alexander 2013-06-15 12:10:03 +02:00
parent c9afda5a65
commit d3d317a2de

View file

@ -61,9 +61,8 @@ class phpbb_crypto_driver_bcrypt extends phpbb_crypto_driver_base
*/ */
public function check($password, $hash) public function check($password, $hash)
{ {
$salt = substr($hash, strpos($hash, '$', 4) + 1, 22); $salt = substr($hash, 0, 29);
var_dump('bcrypt salt: ' . $salt . ' with length ' . strlen($salt)); if (strlen($salt) != 29)
if (strlen($salt) != 22)
{ {
return false; return false;
} }