diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index cf2dd68e2..503e14e44 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -41,7 +41,7 @@ class Application extends \RainLoop\Config\AbstractConfig $sCipher = $this->Get('security', 'encrypt_cipher', ''); if (!$sCipher || !\SnappyMail\Crypt::cipherSupported($sCipher)) { - $sCipher && \SnappyMail\Log::warning('OpenSSL', "No support for {$sCipher}"); + $sCipher && \SnappyMail\Log::warning('Crypt', "OpenSSL no support for cipher '{$sCipher}'"); $aCiphers = \SnappyMail\Crypt::listCiphers(); $this->Set('security', 'encrypt_cipher', $aCiphers[\array_rand($aCiphers)]); $this->Save(); diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php b/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php index 8b9b015f9..823694434 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php @@ -18,7 +18,6 @@ abstract class Crypt $list = \array_diff($list, \array_map('strtoupper',$list)); $list = \array_filter($list, function($v){ // DES/ECB/bf/rc insecure, GCM/CCM not supported - // AEAD return !\preg_match('/(^(des|bf|rc))|-(ecb|gcm|ccm|ocb|siv|cts)|wrap/i', $v); }); \natcasesort($list); @@ -37,6 +36,7 @@ abstract class Crypt static::$cipher = $cipher; return true; } + Log::error('Crypt', "OpenSSL no support for cipher '{$cipher}'"); return false; } @@ -99,14 +99,14 @@ abstract class Crypt $nonce = \random_bytes(\SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES); return ['sodium', $nonce, static::SodiumEncrypt($data, $nonce, $key)]; } catch (\Throwable $e) { - Log::error('Sodium', $e->getMessage()); + Log::error('Crypt', 'Sodium ' . $e->getMessage()); } try { $iv = \random_bytes(\openssl_cipher_iv_length(static::$cipher)); return ['openssl', $iv, static::OpenSSLEncrypt($data, $iv, $key)]; } catch (\Throwable $e) { - Log::error('OpenSSL', $e->getMessage()); + Log::error('Crypt', 'OpenSSL ' . $e->getMessage()); } $salt = \random_bytes(16);