refactor(mimefactory): add Encryption enum - #8573
Conversation
f0f1d06 to
d0a6268
Compare
hpk42
left a comment
There was a problem hiding this comment.
A good refactoring although it's a bit hard to know if it fully preserves behaviour especially around symmetric encryption -- it seems that should_encrypt_with_broadcast_secret is not actually used anymore.
| // created before we had symmetric encryption, | ||
| // we show an error message. | ||
| let text = BROADCAST_INCOMPATIBILITY_MSG; | ||
| chat::add_info_msg(context, chat.id, text).await?; |
There was a problem hiding this comment.
this adds a message to the DB which is a bit unexpected for the from_msg loader function returning a MimeFactory.
There was a problem hiding this comment.
Maybe the message can be removed completely, it was for the old broadcast lists. Users should have migrated to channels by now.
| is_encrypted: bool, | ||
| will_be_encrypted: bool, |
There was a problem hiding this comment.
this creates a lot of unrelated churn in the diff, and i am not sure it's an improvement.
| /// Vector of pairs of recipient | ||
| /// addresses and OpenPGP keys | ||
| /// to use for encryption. |
There was a problem hiding this comment.
this partially repeats the types and has too short lines.
| /// Vector of pairs of recipient | |
| /// addresses and OpenPGP keys | |
| /// to use for encryption. | |
| /// Addresses and OpenPGP keys to use for encryption. |
e484810 to
01f3d9b
Compare
Creating QR code or sending a message will still fail with a shorter error, but no info message will be created anymore. Most users should have migrated the channels by recreating them by now. This change is needed for moving loading of the shared secret to earlier stages of message preparation, otherwise mimefactory will have to create these info messages when loading the message into memory.
This replaces independent data structures which allowed invalid state of having both the public keys and the shared secret, or having a shared secret but not encrypting the message because encryption_pubkeys was None instead of Some(Vec::new()).
01f3d9b to
5799581
Compare
This replaces independent data structures
which allowed invalid state of having both the public keys and the shared secret, or having a shared secret
but not encrypting the message because encryption_pubkeys was None instead of Some(Vec::new()).