Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 1710

[3.2.x] Convertors • Re: SHA1 password problem while migration from FluxBB to phpBB

$
0
0
OK, I don't know if I'm right, but it seems there's a bug. I made a step by step execution with a PHP debugger and cannot find another explanation.

Authentication with SHA1 ciphered passwords in the database work with the following code in sha1.php:

Code:

public function check($password, $hash, $user_row = array()){return (strlen($hash) == 46) ? $this->helper->string_compare($hash, '$sha1$' . sha1($password)) : false;}
Two modifications:
  • strlen comparison should be made toward a 46 characters $hash and not a 40 one, due to the $sha1$ prefix,
  • string_compare comparison should be preceded by the concatenation of the $sha1$ prefix to the shaonized password.
With this code modification (and the prefixing in the database of all user passwords by the $sha1$ prefix), my migration is transparent. Users can connect with their current password and its ciphering is changed in the database on the go to bcrypt, the default one, by phpBB.

Statistics: Posted by Doc Davluz — Sat Mar 09, 2024 2:45 pm



Viewing all articles
Browse latest Browse all 1710

Trending Articles