feat: remove hidden headers - #8543
Conversation
a0ea20e to
fbe0a75
Compare
Hocuri
left a comment
There was a problem hiding this comment.
Do we have some mechanisms that prevents "Chat-" headers from being added to unencrypted messages? If not, then probably we need one? Would be bad if there was a bug that a Chat-Broadcast-Secret can be added to unencrypted messages
fbe0a75 to
dd88156
Compare
I don't think there is any protection against this. The easiest way will be to check |
hpk42
left a comment
There was a problem hiding this comment.
looks good to me. Am a bit unsure about unencrypted messages. Maybe makes sense to mention in the commit message that unencrypted messages don't have an embedded second Message-Id copy, if i see it correctly.
| debug_assert_ne!(header_name, "from"); | ||
| debug_assert_ne!(header_name, "message-id"); | ||
| debug_assert_ne!(header_name, "autocrypt"); |
There was a problem hiding this comment.
these checks are now gone, right? so in theory someone can push those headers without debug asserts tripping over it.
There was a problem hiding this comment.
Added these assertions back in other places. But also if someone adds headers and removes asserts, there are tests that fail when there are multiple Message-ID headers.
9072565 to
840dde0
Compare
Unencrypted messages are no longer sent as multipart/mixed with Message-ID header duplicated inside. This was useful as non-standard protection against servers that rewrite the Message-ID, but now most messages are sent encrypted and for them standard RFC 9788 header protection works the same way.
840dde0 to
f1addc2
Compare
Most importantly, this removes wrapping unencrypted messages into
multipart/mixedwith a single part.Closes #8542