Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions src/mimeparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@ impl MimeMessage {
// but only if the mail was correctly signed. Probably it's ok to not require
// encryption here, but let's follow the standard.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably also drop this check.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autocrypt/gossip and securejoin will need a concerted revisit at some point, but i'd ask for caution now going for "refactors" when they drop checks in this area. Tests still passing after removing checks does not mean much, if the checks were never covered by tests.

let gossip_headers = mail.headers.get_all_values("Autocrypt-Gossip");
gossiped_keys =
parse_gossip_headers(context, &from.addr, &recipients, gossip_headers).await?;
gossiped_keys = parse_gossip_headers(context, gossip_headers).await?;
}

if let Some(inner_from) = inner_from {
Expand Down Expand Up @@ -2135,12 +2134,8 @@ fn remove_header(
/// Parses `Autocrypt-Gossip` headers from the email,
/// saves the keys into the `public_keys` table,
/// and returns them in a HashMap<address, public key>.
///
/// * `from`: The address which sent the message currently being parsed
async fn parse_gossip_headers(
context: &Context,
from: &str,
recipients: &[SingleInfo],
gossip_headers: Vec<String>,
) -> Result<BTreeMap<String, GossipedKey>> {
// XXX split the parsing from the modification part
Expand All @@ -2155,25 +2150,6 @@ async fn parse_gossip_headers(
}
};

if !recipients
.iter()
.any(|info| addr_cmp(&info.addr, &header.addr))
{
warn!(
context,
"Ignoring gossiped \"{}\" as the address is not in To/Cc list.", &header.addr,
);
continue;
}
if addr_cmp(from, &header.addr) {
// Non-standard, might not be necessary to have this check here
warn!(
context,
"Ignoring gossiped \"{}\" as it equals the From address", &header.addr,
);
continue;
}

import_public_key(context, &header.public_key)
.await
.context("Failed to import Autocrypt-Gossip key")?;
Expand Down