Skip to content

Commit 9c6bbe1

Browse files
committed
#8 - fixed password hashing algorithm
1 parent 6af4353 commit 9c6bbe1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/config.local.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@
6262
// To create the hash, visit setup.php in a browser and type a password into the field,
6363
// on submission it will be echoed out to you as a hashed value.
6464
$PFA_SALT = md5(time() . '*' . $_SERVER['REMOTE_ADDR'] . '*' . mt_rand(0, 60000));
65-
$CONF['setup_password'] = $PFA_SALT.':'.sha1($PFA_SALT.':'.($_ENV['PFA_SETUP_PASS'] ? $_ENV['PFA_SETUP_PASS'] : $_ENV['PFA_DB_PASS']));
65+
# SHA1 encoding is obsolete since 3.3
66+
#$CONF['setup_password'] = $PFA_SALT.':'.sha1($PFA_SALT.':'.($_ENV['PFA_SETUP_PASS'] ? $_ENV['PFA_SETUP_PASS'] : $_ENV['PFA_DB_PASS']));
67+
# New password hashing since 3.3
68+
$CONF['setup_password'] = password_hash(($_ENV['PFA_SETUP_PASS'] ? $_ENV['PFA_SETUP_PASS'] : $_ENV['PFA_DB_PASS']), PASSWORD_DEFAULT);
6669

6770
// Language config
6871
// Language files are located in './languages', change as required..

0 commit comments

Comments
 (0)