This commit is contained in:
the-djmaze 2022-11-11 22:50:32 +01:00
parent a13bb9e930
commit e7958fb1ed
4 changed files with 7 additions and 7 deletions

View file

@ -619,7 +619,7 @@ class MailClient
}
catch (\MailSo\RuntimeException $oException)
{
\SnappyMail\Log::warning('MessageListThreadsMap ' . $oException->getMessage());
\SnappyMail\Log::warning('MailClient', 'MessageListThreadsMap ' . $oException->getMessage());
unset($oException);
}

View file

@ -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 does not support {$sCipher}");
$sCipher && \SnappyMail\Log::warning('OpenSSL', "No support for {$sCipher}");
$aCiphers = \SnappyMail\Crypt::listCiphers();
$this->Set('security', 'encrypt_cipher', $aCiphers[\array_rand($aCiphers)]);
$this->Save();

View file

@ -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($e->getMessage());
Log::error('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($e->getMessage());
Log::error('OpenSSL', $e->getMessage());
}
$salt = \random_bytes(16);

View file

@ -383,10 +383,10 @@ class GnuPG
: $this->GPG->verify($signed_text, $signature, $plaintext);
if (!$result) {
if ($this->GnuPG) {
\SnappyMail\Log::notice('gnupg_verify() failed: ' . $this->GnuPG->geterror());
\SnappyMail\Log::info(\print_r($this->GnuPG->geterrorinfo(),1));
\SnappyMail\Log::notice('GnuPG', 'gnupg_verify() failed: ' . $this->GnuPG->geterror());
\SnappyMail\Log::info('GnuPG', \print_r($this->GnuPG->geterrorinfo(),1));
} else {
\SnappyMail\Log::notice('GPG->verify() failed');
\SnappyMail\Log::notice('GPG', 'GPG->verify() failed');
}
}
return $result;