mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve #657
This commit is contained in:
parent
a13bb9e930
commit
e7958fb1ed
4 changed files with 7 additions and 7 deletions
|
|
@ -619,7 +619,7 @@ class MailClient
|
||||||
}
|
}
|
||||||
catch (\MailSo\RuntimeException $oException)
|
catch (\MailSo\RuntimeException $oException)
|
||||||
{
|
{
|
||||||
\SnappyMail\Log::warning('MessageListThreadsMap ' . $oException->getMessage());
|
\SnappyMail\Log::warning('MailClient', 'MessageListThreadsMap ' . $oException->getMessage());
|
||||||
unset($oException);
|
unset($oException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
|
|
||||||
$sCipher = $this->Get('security', 'encrypt_cipher', '');
|
$sCipher = $this->Get('security', 'encrypt_cipher', '');
|
||||||
if (!$sCipher || !\SnappyMail\Crypt::cipherSupported($sCipher)) {
|
if (!$sCipher || !\SnappyMail\Crypt::cipherSupported($sCipher)) {
|
||||||
$sCipher && \SnappyMail\Log::warning("OpenSSL does not support {$sCipher}");
|
$sCipher && \SnappyMail\Log::warning('OpenSSL', "No support for {$sCipher}");
|
||||||
$aCiphers = \SnappyMail\Crypt::listCiphers();
|
$aCiphers = \SnappyMail\Crypt::listCiphers();
|
||||||
$this->Set('security', 'encrypt_cipher', $aCiphers[\array_rand($aCiphers)]);
|
$this->Set('security', 'encrypt_cipher', $aCiphers[\array_rand($aCiphers)]);
|
||||||
$this->Save();
|
$this->Save();
|
||||||
|
|
|
||||||
|
|
@ -99,14 +99,14 @@ abstract class Crypt
|
||||||
$nonce = \random_bytes(\SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES);
|
$nonce = \random_bytes(\SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES);
|
||||||
return ['sodium', $nonce, static::SodiumEncrypt($data, $nonce, $key)];
|
return ['sodium', $nonce, static::SodiumEncrypt($data, $nonce, $key)];
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Log::error($e->getMessage());
|
Log::error('Sodium', $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$iv = \random_bytes(\openssl_cipher_iv_length(static::$cipher));
|
$iv = \random_bytes(\openssl_cipher_iv_length(static::$cipher));
|
||||||
return ['openssl', $iv, static::OpenSSLEncrypt($data, $iv, $key)];
|
return ['openssl', $iv, static::OpenSSLEncrypt($data, $iv, $key)];
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Log::error($e->getMessage());
|
Log::error('OpenSSL', $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$salt = \random_bytes(16);
|
$salt = \random_bytes(16);
|
||||||
|
|
|
||||||
|
|
@ -383,10 +383,10 @@ class GnuPG
|
||||||
: $this->GPG->verify($signed_text, $signature, $plaintext);
|
: $this->GPG->verify($signed_text, $signature, $plaintext);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
if ($this->GnuPG) {
|
if ($this->GnuPG) {
|
||||||
\SnappyMail\Log::notice('gnupg_verify() failed: ' . $this->GnuPG->geterror());
|
\SnappyMail\Log::notice('GnuPG', 'gnupg_verify() failed: ' . $this->GnuPG->geterror());
|
||||||
\SnappyMail\Log::info(\print_r($this->GnuPG->geterrorinfo(),1));
|
\SnappyMail\Log::info('GnuPG', \print_r($this->GnuPG->geterrorinfo(),1));
|
||||||
} else {
|
} else {
|
||||||
\SnappyMail\Log::notice('GPG->verify() failed');
|
\SnappyMail\Log::notice('GPG', 'GPG->verify() failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue