Skip to content

refactor(mimefactory): factor out header confidentiality policy#5715

Merged
link2xt merged 4 commits intomainfrom
link2xt/hcp
Jun 26, 2024
Merged

refactor(mimefactory): factor out header confidentiality policy#5715
link2xt merged 4 commits intomainfrom
link2xt/hcp

Conversation

@link2xt
Copy link
Copy Markdown
Collaborator

@link2xt link2xt commented Jun 23, 2024

Instead of constructing lists of protected,
unprotected and hidden headers,
construct a single list of headers
and then sort them into separate lists
based on the well-defined policy.

This also fixes the bug
where Subject was not present in the IMF header
for signed-only messages.

Closes #5713

@link2xt link2xt force-pushed the link2xt/hcp branch 4 times, most recently from b731269 to dfae85d Compare June 23, 2024 18:41
@link2xt link2xt marked this pull request as ready for review June 23, 2024 18:42
@link2xt link2xt force-pushed the link2xt/hcp branch 3 times, most recently from 7b8ec9e to 2f7837d Compare June 23, 2024 18:56
@link2xt link2xt force-pushed the link2xt/hcp branch 2 times, most recently from dfd04eb to 7dc3b61 Compare June 23, 2024 19:59
Instead of constructing lists of protected,
unprotected and hidden headers,
construct a single list of headers
and then sort them into separate lists
based on the well-defined policy.

This also fixes the bug
where Subject was not present in the IMF header
for signed-only messages.
unprotected_headers.push(header.clone());
} else if header.name.to_lowercase().as_str() == "from" {
protected_headers.push(header.clone());
if verified || is_securejoin_message {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Btw, if Param::ForcePlaintext is set, an unencrypted message is sent even if the chat is verified. Just checking related code. Before is_encrypted && was here, but probably we must never send unencrypted messages in verified chats. Though one can understand the word "verified" as "having only correctly signed messages" theoretically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Factor out Header Confidentiality Policy

2 participants