This commit is contained in:
the-djmaze 2023-05-08 09:47:08 +02:00
parent a043eaec81
commit 7b70117155

View file

@ -50,9 +50,12 @@ class Application extends \RainLoop\Config\AbstractConfig
if (!$sCipher || !\SnappyMail\Crypt::cipherSupported($sCipher)) { if (!$sCipher || !\SnappyMail\Crypt::cipherSupported($sCipher)) {
$sCipher && \SnappyMail\Log::warning('Crypt', "OpenSSL no support for cipher '{$sCipher}'"); $sCipher && \SnappyMail\Log::warning('Crypt', "OpenSSL no support for cipher '{$sCipher}'");
$aCiphers = \SnappyMail\Crypt::listCiphers(); $aCiphers = \SnappyMail\Crypt::listCiphers();
$this->Set('security', 'encrypt_cipher', $aCiphers[\array_rand($aCiphers)]); $sCipher2 = $aCiphers ? $aCiphers[\array_rand($aCiphers)] : '';
if ($sCipher !== $sCipher2) {
$this->Set('security', 'encrypt_cipher', $sCipher2);
$this->Save(); $this->Save();
} }
}
return $bResult; return $bResult;
} }