-
-
Notifications
You must be signed in to change notification settings - Fork 104
fix: Ignore protected headers in outer message part (#6357) #6370
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
base: main
Are you sure you want to change the base?
Conversation
3ff41b4
to
5445310
Compare
5445310
to
92a4af4
Compare
92a4af4
to
4638c12
Compare
4638c12
to
4d718ed
Compare
4d718ed
to
bbf9f2b
Compare
Delta Chat always adds protected headers to the inner encrypted or signed message, so if a protected header is only present in the outer part, it should be ignored because it's probably added by the server or somebody else. The exceptions are Subject and List-ID because there are known cases when they are only present in the outer message part. Also treat any Chat-* headers as protected. This fixes e.g. a case when the server injects a "Chat-Version" IMF header tricking Delta Chat into thinking that it's a chat message. Also handle "Auto-Submitted" and "Autocrypt-Setup-Message" as protected headers on the receiver side, this was apparently forgotten.
bbf9f2b
to
ff411b6
Compare
@@ -2005,6 +2002,31 @@ pub(crate) fn parse_message_id(ids: &str) -> Result<String> { | |||
} | |||
} | |||
|
|||
/// Returns true if the header overwrites outer header |
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.
The comment is now outdated, all headers overwrite outer header when they come from protected headers.
Also the only place the function is used we make exception for list-id
and subject
. Maybe make this function ignore them in the first place and say that this function returns whether we don't expect the header to appear unprotected without protection in encrypted messages.
No description provided.