[ticket/10101] Add support for native phpass hashes

phpass (the hashing library we use) adds a hash identifier to every
hash. By default this identifier is '$P$'. For some reason we have
changed it to '$H$'.

This patch allows both of them to be used for authentication, so that a
third party system could create users with '$P$' hashes.

PHPBB3-10101
This commit is contained in:
Igor Wiedler 2011-03-17 23:59:38 +01:00
parent 784132d7e8
commit f8384b7302

View file

@ -516,7 +516,7 @@ function _hash_crypt_private($password, $setting, &$itoa64)
$output = '*'; $output = '*';
// Check for correct hash // Check for correct hash
if (substr($setting, 0, 3) != '$H$') if (substr($setting, 0, 3) != '$H$' && substr($setting, 0, 3) != '$P$')
{ {
return $output; return $output;
} }