mirror of
https://github.com/chatmail/core.git
synced 2026-05-14 04:16:30 +03:00
Re-enable DKIM-checks (#3935)
Re-enable keychange-denying when the From address is wrong Reverts #3728 Closes #3735 Reopens #3700
This commit is contained in:
@@ -644,7 +644,6 @@ Authentication-Results: dkim=";
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[ignore = "Disallowing keychanges is disabled for now"]
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn test_handle_authres_fails() -> Result<()> {
|
async fn test_handle_authres_fails() -> Result<()> {
|
||||||
let mut tcm = TestContextManager::new();
|
let mut tcm = TestContextManager::new();
|
||||||
@@ -822,8 +821,7 @@ Authentication-Results: dkim=";
|
|||||||
.insert_str(0, "Authentication-Results: example.net; dkim=fail\n");
|
.insert_str(0, "Authentication-Results: example.net; dkim=fail\n");
|
||||||
let rcvd = bob.recv_msg(&sent).await;
|
let rcvd = bob.recv_msg(&sent).await;
|
||||||
|
|
||||||
// Disallowing keychanges is disabled for now:
|
assert!(rcvd.error.unwrap().contains("DKIM failed"));
|
||||||
// assert!(rcvd.error.unwrap().contains("DKIM failed"));
|
|
||||||
// The message info should contain a warning:
|
// The message info should contain a warning:
|
||||||
assert!(message::get_msg_info(&bob, rcvd.id)
|
assert!(message::get_msg_info(&bob, rcvd.id)
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -99,8 +99,7 @@ pub(crate) async fn prepare_decryption(
|
|||||||
from,
|
from,
|
||||||
autocrypt_header.as_ref(),
|
autocrypt_header.as_ref(),
|
||||||
message_time,
|
message_time,
|
||||||
// Disallowing keychanges is disabled for now:
|
dkim_results.allow_keychange,
|
||||||
true, // dkim_results.allow_keychange,
|
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
@@ -325,8 +325,7 @@ impl MimeMessage {
|
|||||||
if let (Some(peerstate), Ok(mail)) = (&mut decryption_info.peerstate, mail) {
|
if let (Some(peerstate), Ok(mail)) = (&mut decryption_info.peerstate, mail) {
|
||||||
if message_time > peerstate.last_seen_autocrypt
|
if message_time > peerstate.last_seen_autocrypt
|
||||||
&& mail.ctype.mimetype != "multipart/report"
|
&& mail.ctype.mimetype != "multipart/report"
|
||||||
// Disallowing keychanges is disabled for now:
|
&& decryption_info.dkim_results.allow_keychange
|
||||||
// && decryption_info.dkim_results.allow_keychange
|
|
||||||
{
|
{
|
||||||
peerstate.degrade_encryption(message_time);
|
peerstate.degrade_encryption(message_time);
|
||||||
}
|
}
|
||||||
@@ -397,12 +396,11 @@ impl MimeMessage {
|
|||||||
parser.heuristically_parse_ndn(context).await;
|
parser.heuristically_parse_ndn(context).await;
|
||||||
parser.parse_headers(context).await?;
|
parser.parse_headers(context).await?;
|
||||||
|
|
||||||
// Disallowing keychanges is disabled for now
|
if !parser.decryption_info.dkim_results.allow_keychange {
|
||||||
// if !decryption_info.dkim_results.allow_keychange {
|
for part in parser.parts.iter_mut() {
|
||||||
// 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());
|
||||||
// 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 {
|
if parser.is_mime_modified {
|
||||||
parser.decoded_data = mail_raw;
|
parser.decoded_data = mail_raw;
|
||||||
|
|||||||
Reference in New Issue
Block a user