Commit graph

3981 commits

Author SHA1 Message Date
7134716343
E2EE MUC support
This change transmits the original JID of the sender (in decrypt) or
receiver(s) (in encrypt).

Handling of MUC is not complete. It is possible that some participants
have access to realjids while others don't (e.g., moderators in
semi-anon MUCs).

The code currently doesn't handle this and this will cause at least two
issues:
- Sending an encrypted message in a semi-anon MUC would reveal the
  sender's identity (public key)
- Recipients wouldn't be able to decrypt this message as they don't have
  access to the sender's realjid. Unless they already have the bundle
  available and then they could associate the public key with a jid
  (another privacy issue/defeating the point of semi-anon rooms).

TODO: Fix this ^

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-01-01 22:36:41 +01:00
92e81d8f87 Allow encryption in normal messages
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-31 11:54:52 +01:00
238eb8a0a1 E2EEPlugin: Mute some lint warnings because of metaclass
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-31 11:54:52 +01:00
323d39f932 Tabs: add by_jid search method for tabs who have a jid attr
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-31 11:54:52 +01:00
28be8ab0cd
Add TODO in plugin_e2ee _decrypt
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-30 05:39:08 +01:00
fa063ddd57 Merge branch 'plugin-omemo' into 'master'
E2EE plugins support

See merge request poezio/poezio!18
2019-12-28 22:36:27 +01:00
mathieui
abbb6a714e
Disable a pylint error on a line (due to __getattr__ override) 2019-12-28 16:47:18 +01:00
9e390085a1
omemo: omemo_plugin moved to its own repository for licensing purposes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 19:02:09 +01:00
39e756cb35 omemo: Add TODO for unverified state
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
96acbaa13d omemo: remove unnecessary newline in docstring
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
fb637a597b omemo: prevent traceback when no JID is specified in non-supported tab
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
c610a76fd9 omemo: use dedicated method to check if encryption is enabled
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
3697e308c2 omemo: use jid property instead of name on chat tab
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
931fc58199 omemo: Update decrypt_message with slixmpp-omemo changes
decrypt_message now takes an Encrypted container and a sender (JID)
instead of a Message object.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
ecdd036237 omemo: Update get_fingerprints with slixmpp-omemo changes
slixmpp-omemo's get_trust_for_jid doesn't provide fingerprints directly
anymore, it simply wraps the omemo lib method.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
mathieui
e8dd6f0a91 omemo: fix show_fingerprints (JID instead of str) 2019-12-27 18:58:48 +01:00
04efd8ee07 omemo: implement get_fingerprints method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
mathieui
518ba47e2a omemo: add an api in plugin_e2ee to get the fingerprint(s) of a jid 2019-12-27 18:58:48 +01:00
mathieui
5c4571751e omemo: fix an indent error and make mypy happy 2019-12-27 18:58:48 +01:00
mathieui
b40de0bcbe omemo: fix some errors / feedback in trust setting 2019-12-27 18:58:48 +01:00
mathieui
07447a465a omemo: fix the type of the supported tab tyoes 2019-12-27 18:58:48 +01:00
03499a2d2c omemo: handle MissingBundleException when it comes from EncryptionPrepareException
We're not supposed to see MissingBundleException directly as it's
handled by slixmpp-omemo. Slixmpp-omemo will give us all the remaining
exceptions via EncryptionPrepareException when it doesn't know what to
do anymore.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
0e27485c36 Remove exception catchall in omemo plugin as it's now handled in plugin_e2ee
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
cd3f2a197b omemo: Remove unused variable in encrypt method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
mathieui
c85c8f6c77 omemo: add supported_tab_types and trust_states into the omemo plugin 2019-12-27 18:58:48 +01:00
mathieui
25dae11eb3 omemo: add supported_tab_types and trust_states plugin attributes
- supported tab types is a list of tabs this plugin should be active in
 (only chattabs)
- trust_states is a dict[str → set] containing only two keys: accepted
 and rejected, whose values are the internal plugin states that should
 allow encryption and the ones that should not
2019-12-27 18:58:48 +01:00
4586765793 omemo: session_start is now async
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:58:48 +01:00
mathieui
1dd713b857 omemo: add a wrapper around _encrypt() to handle user feedback
(yes, another one)
2019-12-27 18:58:48 +01:00
mathieui
b1e913d772 omemo: fix indentation of one line 2019-12-27 18:58:48 +01:00
mathieui
e94ee52c10 omemo: add missing typing import 2019-12-27 18:58:47 +01:00
mathieui
97d29bc1cd Fix potential race condition when encrypting
(do not try to rely on the current tab)
2019-12-27 18:57:33 +01:00
0c86e9a52f omemo: Edit and move TODO comment for NoEligibleDevicesException
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:33 +01:00
mathieui
5a1a2e6c18 Add a "passthrough" parameter for calls through the safetymetaclass
So errors don’t get caught
2019-12-27 18:57:33 +01:00
33a1519a39 omemo: Catch IqError and IqTimeout and display generic message for now
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:33 +01:00
cbe96a6f77 omemo: Skip devices on MissingBundleException. Encrypt to the rest
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:33 +01:00
687f360797 omemo: ensure whitelist includes encryption tag in the correct format
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:33 +01:00
83e8305554 omemo: use @to instead of @from for message recipients
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:33 +01:00
ec846f222e omemo: decode decrypted body
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:33 +01:00
50833050c7 omemo: handle async encryption methods
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:33 +01:00
7609a56e48 omemo: handle StaticConversationTab as well
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:57:31 +01:00
fa3c96a602 omemo: Ensure session_start is published
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
1be00f5e20 omemo: put OMEMO data into a folder specific to the account
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
95a9858717 omemo: the container tag for OMEMO is 'encrypted' not 'payload'
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
c8f88658b4 omemo: adapt to new E2EE API
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
42fa792aa5 omemo: Add omemo_enable and omemo_disable commands
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
d30c39c6a9 omemo: add docstring on the plugin
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
f13587a386 omemo: remove unused imports and reorder them
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
4ab6e64437 omemo: Add omemo status in the tab infobar
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
2c720c9d9b omemo: remove unused commands
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00
43a97d6430 omemo: change /omemo description
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27 18:56:27 +01:00