Add option to force encryption#8220
Conversation
8914248 to
f1652d4
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
bb4bde4 to
b47d145
Compare
b47d145 to
c67dc51
Compare
15d971f to
a1137cb
Compare
a412867 to
5836a72
Compare
098f508 to
cb8ffb6
Compare
2b97913 to
5e61bba
Compare
ec863ca to
ae4c3f3
Compare
| let encrypted_message = test_utils::encrypt_raw_message( | ||
| bob, | ||
| &[alice], | ||
| b"From: bob@example.net\r\n\ |
There was a problem hiding this comment.
Maybe replace "\n" with "\r\n" in encrypt_raw_message() before encryption, or do we sometimes need just "\n"?
|
|
||
| let now = tools::time(); | ||
| let max_unencrypted_timestamp = std::cmp::max(max_unencrypted_timestamp, max_mailing_list_timestamp); | ||
| if max_unencrypted_timestamp.saturating_add(3600 * 24 * 90) > now { |
There was a problem hiding this comment.
delete_device_after affects this if it's set to <= 5 weeks. It may even be disabled, but set right before, we can't know that. Just disabling force_encryption for existing users is probably not what we want however. Maybe it makes sense to also check if there are any messages older than 90 days at all, not sure.
| assert!(chat::send_msg(alice, chat.id, &mut msg).await.is_err()); | ||
| assert_eq!( | ||
| msg.error().unwrap(), | ||
| "\u{26a0}\u{fe0f} Your email provider example.org requires end-to-end encryption which is not setup yet." |
There was a problem hiding this comment.
"Your server" or "Your relay" may be better these days, may be reworded in another PR
There was a problem hiding this comment.
This is a fallback wording, it is replaced by the UIs even for English version. Can be tweaked, but the user never sees this.
4747fa7 to
65ed62a
Compare
This change is a preparation for ignoring unencrypted messages by default. New test_utils::encrypt_raw_message and test_utils::receive_encrypted_imf are used to encrypt the messages before "receiving" them with receive_imf.
65ed62a to
4046ca5
Compare
4046ca5 to
a9aa493
Compare
Closes #7494
There is a new
force_encryptionconfig which is enabled by default. For users with recently active unencrypted chats it is disabled in a migration. Enabling it prevents both sending and receiving unencrypted messages, so when sending to unencrypted chats we will no longer send unencrypted message to a chatmail relay for it to be rejected, but fail locally.There are many changes to tests because we had a lot of tests using unencrypted chats, I have put them into separate commits.
The setting is not per-relay as there have been more discussion after the comments below. UIs will put the setting somewhere deeper than "Advanced" likely inside the "Relays" configuration but not in the individual relay settings.