Use phpseclib's Crypt module to generate encryption keys
Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
ab05803a42
commit
c8297b4718
@ -600,8 +600,8 @@ class AuthenticationCookie extends AuthenticationPlugin
|
||||
{
|
||||
if (empty($GLOBALS['cfg']['blowfish_secret'])) {
|
||||
if (empty($_SESSION['auto_blowfish_secret'])) {
|
||||
// this returns 23 characters
|
||||
$_SESSION['auto_blowfish_secret'] = uniqid('', true);
|
||||
// this returns 32 characters
|
||||
$_SESSION['auto_blowfish_secret'] = crypt_random_string(32);
|
||||
}
|
||||
return $_SESSION['auto_blowfish_secret'];
|
||||
} else {
|
||||
|
||||
@ -330,7 +330,7 @@ function perform_config_checks()
|
||||
$server_name = htmlspecialchars($server_name);
|
||||
|
||||
if ($cookie_auth_server && $blowfish_secret === null) {
|
||||
$blowfish_secret = uniqid('', true);
|
||||
$blowfish_secret = bin2hex(crypt_random_string(16));
|
||||
$blowfish_secret_set = true;
|
||||
$cf->set('blowfish_secret', $blowfish_secret);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user