Use phpseclib's Crypt module to generate encryption keys
Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
0d57c09bd5
commit
2f79bacefa
@ -214,7 +214,12 @@ class ServerConfigChecks
|
||||
$blowfishSecret, $cookieAuthServer, $blowfishSecretSet
|
||||
) {
|
||||
if ($cookieAuthServer && $blowfishSecret === null) {
|
||||
$blowfishSecret = uniqid('', true);
|
||||
if (! function_exists('openssl_random_pseudo_bytes')) {
|
||||
$blowfishSecret = bin2hex(phpseclib\Crypt\Random::string(16));
|
||||
} else {
|
||||
$blowfishSecret = bin2hex(openssl_random_pseudo_bytes(16));
|
||||
}
|
||||
|
||||
$blowfishSecretSet = true;
|
||||
$this->cfg->set('blowfish_secret', $blowfishSecret);
|
||||
return array($blowfishSecret, $blowfishSecretSet);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user