mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
streamline decrypt/encrypt logging
This commit is contained in:
@@ -98,7 +98,6 @@ impl EncryptHelper {
|
|||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(state, addr)| state.as_ref().map(|s| (s, addr)))
|
.filter_map(|(state, addr)| state.as_ref().map(|s| (s, addr)))
|
||||||
{
|
{
|
||||||
info!(context, "adding for {}: {:?}", addr, peerstate);
|
|
||||||
let key = peerstate.peek_key(min_verified).ok_or_else(|| {
|
let key = peerstate.peek_key(min_verified).ok_or_else(|| {
|
||||||
format_err!("proper enc-key for {} missing, cannot encrypt", addr)
|
format_err!("proper enc-key for {} missing, cannot encrypt", addr)
|
||||||
})?;
|
})?;
|
||||||
@@ -122,8 +121,6 @@ pub fn try_decrypt(
|
|||||||
mail: &mailparse::ParsedMail<'_>,
|
mail: &mailparse::ParsedMail<'_>,
|
||||||
message_time: i64,
|
message_time: i64,
|
||||||
) -> Result<(Option<Vec<u8>>, HashSet<String>)> {
|
) -> Result<(Option<Vec<u8>>, HashSet<String>)> {
|
||||||
info!(context, "trying to decrypt");
|
|
||||||
|
|
||||||
let from = mail
|
let from = mail
|
||||||
.headers
|
.headers
|
||||||
.get_first_value("From")?
|
.get_first_value("From")?
|
||||||
@@ -252,7 +249,7 @@ fn decrypt_if_autocrypt_message<'a>(
|
|||||||
let encrypted_data_part = match wrapmime::get_autocrypt_mime(mail) {
|
let encrypted_data_part = match wrapmime::get_autocrypt_mime(mail) {
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
// not a proper autocrypt message, abort and ignore
|
// not a proper autocrypt message, abort and ignore
|
||||||
warn!(context, "Invalid autocrypt message: {:?}", err);
|
info!(context, "Not an autocrypt message: {:?}", err);
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
@@ -269,13 +266,12 @@ fn decrypt_if_autocrypt_message<'a>(
|
|||||||
|
|
||||||
/// Returns Ok(None) if nothing encrypted was found.
|
/// Returns Ok(None) if nothing encrypted was found.
|
||||||
fn decrypt_part(
|
fn decrypt_part(
|
||||||
context: &Context,
|
_context: &Context,
|
||||||
mail: &mailparse::ParsedMail<'_>,
|
mail: &mailparse::ParsedMail<'_>,
|
||||||
private_keyring: &Keyring,
|
private_keyring: &Keyring,
|
||||||
public_keyring_for_validate: &Keyring,
|
public_keyring_for_validate: &Keyring,
|
||||||
ret_valid_signatures: &mut HashSet<String>,
|
ret_valid_signatures: &mut HashSet<String>,
|
||||||
) -> Result<Option<Vec<u8>>> {
|
) -> Result<Option<Vec<u8>>> {
|
||||||
info!(context, "decrypting part");
|
|
||||||
let data = mail.get_body_raw()?;
|
let data = mail.get_body_raw()?;
|
||||||
|
|
||||||
if has_decrypted_pgp_armor(&data) {
|
if has_decrypted_pgp_armor(&data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user