[feature/passwords] Properly treat duplicates in combined hashes

PHPBB3-11610
This commit is contained in:
Marc Alexander 2013-06-27 16:14:08 +02:00
parent 556048177f
commit cfbd858bd7
2 changed files with 9 additions and 1 deletions

View file

@ -129,6 +129,10 @@ class phpbb_crypto_manager
{ {
if (isset($this->type_map["\${$type}\$"])) if (isset($this->type_map["\${$type}\$"]))
{ {
while(isset($return_ary[$type]))
{
$type = $type + ' ';
}
$return_ary[$type] = $this->type_map["\${$type}\$"]; $return_ary[$type] = $this->type_map["\${$type}\$"];
} }
else else

View file

@ -131,7 +131,7 @@ class phpbb_crypto_manager_test extends PHPUnit_Framework_TestCase
return array( return array(
array( array(
'crypto.driver.salted_md5', 'crypto.driver.salted_md5',
array('crypto.driver.bcrypt_2y', 'crypto.driver.bcrypt'), array('crypto.driver.bcrypt_2y'),
), ),
array( array(
'crypto.driver.salted_md5', 'crypto.driver.salted_md5',
@ -141,6 +141,10 @@ class phpbb_crypto_manager_test extends PHPUnit_Framework_TestCase
'crypto.driver.phpass', 'crypto.driver.phpass',
array('crypto.driver.salted_md5'), array('crypto.driver.salted_md5'),
), ),
array(
'crypto.driver.salted_md5',
array('crypto.driver.bcrypt_2y', 'crypto.driver.bcrypt'),
),
); );
} }