From adb5bc77c4053d80a78cdfbf58b2c36e1cfebff3 Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 22 Feb 2023 14:51:13 +0000 Subject: [PATCH 1/3] Enable clippy::missing_docs_in_private_items in deltachat-ffi --- deltachat-ffi/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index cd9b2521a..f16ca2916 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -1,4 +1,4 @@ -#![warn(unused, clippy::all)] +#![warn(unused, clippy::all, clippy::missing_docs_in_private_items)] #![allow( non_camel_case_types, non_snake_case, From 7c099c19c8840150063c28103a1ff2954d9fa07e Mon Sep 17 00:00:00 2001 From: Hocuri Date: Wed, 22 Feb 2023 16:03:20 +0100 Subject: [PATCH 2/3] Re-disable DKIM-checks (#4076) --- CHANGELOG.md | 1 + src/authres.rs | 4 +++- src/decrypt.rs | 3 ++- src/mimeparser.rs | 14 ++++++++------ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0fa82590..ce2da427e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Use transaction in `update_blocked_mailinglist_contacts`. #4058 - Remove `Sql.get_conn()` interface in favor of `.call()` and `.transaction()`. #4055 - Updated provider database. +- Disable DKIM-Checks again #4076 ### Fixes - Start SQL transactions with IMMEDIATE behaviour rather than default DEFERRED one. #4063 diff --git a/src/authres.rs b/src/authres.rs index 2b2555544..eb267ddc9 100644 --- a/src/authres.rs +++ b/src/authres.rs @@ -644,6 +644,7 @@ Authentication-Results: dkim="; .unwrap(); } + #[ignore = "Disallowing keychanges is disabled for now"] #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_handle_authres_fails() -> Result<()> { let mut tcm = TestContextManager::new(); @@ -821,7 +822,8 @@ Authentication-Results: dkim="; .insert_str(0, "Authentication-Results: example.net; dkim=fail\n"); let rcvd = bob.recv_msg(&sent).await; - assert!(rcvd.error.unwrap().contains("DKIM failed")); + // Disallowing keychanges is disabled for now: + // assert!(rcvd.error.unwrap().contains("DKIM failed")); // The message info should contain a warning: assert!(message::get_msg_info(&bob, rcvd.id) .await diff --git a/src/decrypt.rs b/src/decrypt.rs index fa1232830..1165e3dd7 100644 --- a/src/decrypt.rs +++ b/src/decrypt.rs @@ -99,7 +99,8 @@ pub(crate) async fn prepare_decryption( from, autocrypt_header.as_ref(), message_time, - dkim_results.allow_keychange, + // Disallowing keychanges is disabled for now: + true, // dkim_results.allow_keychange, ) .await?; diff --git a/src/mimeparser.rs b/src/mimeparser.rs index cf03a0100..0b246a257 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -342,7 +342,8 @@ impl MimeMessage { if let (Some(peerstate), Ok(mail)) = (&mut decryption_info.peerstate, mail) { if message_time > peerstate.last_seen_autocrypt && mail.ctype.mimetype != "multipart/report" - && decryption_info.dkim_results.allow_keychange + // Disallowing keychanges is disabled for now: + // && decryption_info.dkim_results.allow_keychange { peerstate.degrade_encryption(message_time); } @@ -413,11 +414,12 @@ impl MimeMessage { parser.heuristically_parse_ndn(context).await; parser.parse_headers(context).await?; - if !parser.decryption_info.dkim_results.allow_keychange { - for part in parser.parts.iter_mut() { - part.error = Some("Seems like DKIM failed, this either is an attack or (more likely) a bug in Authentication-Results checking. Please tell us about this at https://support.delta.chat.".to_string()); - } - } + // Disallowing keychanges is disabled for now + // if !decryption_info.dkim_results.allow_keychange { + // for part in parser.parts.iter_mut() { + // part.error = Some("Seems like DKIM failed, this either is an attack or (more likely) a bug in Authentication-Results checking. Please tell us about this at https://support.delta.chat.".to_string()); + // } + // } if parser.is_mime_modified { parser.decoded_data = mail_raw; From 9e28ee95e5b44d90641c3cb48c9ea8de07a434fe Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 22 Feb 2023 15:10:33 +0000 Subject: [PATCH 3/3] Document PeerstateChange --- src/peerstate.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/peerstate.rs b/src/peerstate.rs index e7433f0f3..3de53ea35 100644 --- a/src/peerstate.rs +++ b/src/peerstate.rs @@ -688,6 +688,10 @@ pub(crate) async fn maybe_do_aeap_transition( Ok(()) } +/// Type of the peerstate change. +/// +/// Changes to the peerstate are notified to the user via a message +/// explaining the happened change. enum PeerstateChange { /// The contact's public key fingerprint changed, likely because /// the contact uses a new device and didn't transfer their key.