refactor(mimefactory): factor out header confidentiality policy#5715
Merged
refactor(mimefactory): factor out header confidentiality policy#5715
Conversation
link2xt
commented
Jun 23, 2024
b731269 to
dfae85d
Compare
7b8ec9e to
2f7837d
Compare
dfd04eb to
7dc3b61
Compare
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.
iequidoo
reviewed
Jun 24, 2024
src/mimefactory.rs
Outdated
| unprotected_headers.push(header.clone()); | ||
| } else if header.name.to_lowercase().as_str() == "from" { | ||
| protected_headers.push(header.clone()); | ||
| if verified || is_securejoin_message { |
Collaborator
There was a problem hiding this comment.
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
iequidoo
approved these changes
Jun 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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