mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/11873] Do not hash very large passwords in order to safe resources.
PHPBB3-11873
This commit is contained in:
committed by
Andreas Fischer
parent
d18bded3ac
commit
cba28c39ad
@@ -502,6 +502,13 @@ function phpbb_hash($password)
|
|||||||
*/
|
*/
|
||||||
function phpbb_check_hash($password, $hash)
|
function phpbb_check_hash($password, $hash)
|
||||||
{
|
{
|
||||||
|
if (strlen($password) > 4096)
|
||||||
|
{
|
||||||
|
// If the password is too huge, we will simply reject it
|
||||||
|
// and not let the server try to hash it.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||||
if (strlen($hash) == 34)
|
if (strlen($hash) == 34)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user