-
-
Notifications
You must be signed in to change notification settings - Fork 105
refactor(mimefactory): factor out header confidentiality policy #5715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
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 { |
There was a problem hiding this comment.
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
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