Commit graph

114 commits

Author SHA1 Message Date
72c8acca85 example-bot: add TODO for expect_problems
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
63dc98b07b example-bot: Add catchall except in decryption and encryption
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
9e70954a0e example-bot: attempt at returning encrypted messages
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
af8c731307 example-bot: Use async methods instead
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
c7983d176d Remove handler on message_encryption
This event is being sent by slixmpp's EME plugin, when a message
contains an EME tag. I can already test for this myself, so I'd rather
not hook this event to remove duplicated messages.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
b71a367bcb Remove the while loop; add dummy encrypted_reply
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
368bbd9005 Add some more comments in NoAvailableSession handling
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
643b1695a1 Change undecided/untrusted exceptions' comment
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
3061aa3372 First attempt at an example
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:28:06 +00:00
a72e81c329
xep_0384: Add publish-options when publishing devices and bundles
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 12:23:39 +00:00
e9717cd652
xep_0384: explicitely add 0060 as dep as we also depend on it
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-24 11:13:40 +00:00
99fdb6e3fc
xep_0384: rename variable to remove linting warning
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-23 18:34:43 +00:00
032469a05f
xep_0384: Remove unused variable
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-23 18:31:19 +00:00
52e49e9422
xep_0384: pass the correct omemo backend to _parse_bundle
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-23 13:41:56 +00:00
f3d9143bf6
xep_0384: update to using TrustException from the omemo lib
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-19 00:09:16 +00:00
de1ecb730a
Pass the correct variable to public_bundle.serialize
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-17 19:15:18 +00:00
3580b3941b
Also depend on omemo-backend-signal
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-17 18:58:26 +00:00
85998773c8
Fix error message whe no data_dir specified
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-17 18:31:26 +00:00
f66f5a8db7
Fix import path of JSONFileStorage
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-17 18:30:31 +00:00
9a3283abf2
Initial split version of this repo
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-02-17 18:05:43 +00:00
8dbfc140ed xep_0384: do things in session_bind only if lib is available
`session_bind` is apparently loaded at about the same time as
plugin_init, and exceptions will be raise if the library could not be
loaded.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-31 16:28:12 +01:00
3a7711aaf1 xep_0384: when encrypting, only tell client when trust is undecided
On UntrustedException, there are two possibilities.  Either trust has not been
explicitely set yet, and is 'undecided', or the device is explicitely not
trusted. When undecided, we need to ask our user to make a choice. If
untrusted, then we can safely tell the OMEMO lib to not encrypt to this device.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-31 15:47:12 +01:00
4626c80ff3 xep_0384: otpk class doesn't need instancianting
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-31 11:33:41 +01:00
6641404def xep_0384: rework passing in storage class
The previous way wasn't allowing passing classes with different
parameters.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-31 11:33:41 +01:00
33d605f5e2 xep_0384: Use DefaultOTPKPolicy from the lib. Remove stuff implementation
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-31 11:33:41 +01:00
7ccd6c89fb xep_0384: pass the UntrustedException to the user
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-31 11:33:41 +01:00
2455d00d59 xep_0384: Add allow_untrusted parameter to decrypt_message
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-31 11:33:41 +01:00
2a14807c02 xep_0384: _receive_device_list was never called because event system doesn't do async.
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:10:10 +01:00
9591cf0ced xep_0384: Modify device list handling
When receiving the device list, do not read from storage before checking
if our JID is included, because the OMEMO library always includes it.
The method now verifies directly from the items and calls the set method
if necessary.

Also fix an issue where the `device_ids` parameter of ̀_set_device_list`
was never used.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
7492508d6c xep_0384: Move publish calls on session_bind
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
0c3946c556 xep_0384: Remove own Storage implementation, use JSONFileStorage from lib
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
ae8fd402f8 xep_0384: Add a way to specify parameters to the plugin
Users can now specify replacements for the storage backend, otpk policy,
and the omemo backend.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
a490ca6066 xep_0384: Add check on data_dir before loading plugin
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
15f34aa145 xep_0384: Use variables for filenames in Storage
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
1f6c13fdd1 xep_0384: only clean specified session for a user; use existing storeSession method
Thanks Syndace

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
3fdb7cc953 xep_0384: add types to Storage
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
d3c2db0d08 xep_0384: use correct variable name in deleteJID impl
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
011aeaa7a2 xep_0384: Change listJIDs' return value to set
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
77dccdb332 xep_0384: Change behaviour for NoElibibleDevices, add comments
Thanks to Syndace for the explanation.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
2880aef846 xep_0384: Use Optional instead of Union[None, T]
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
46a7e414a4 xep_0384: update plugin to work with OMEMO lib updates
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
2c90249462 xep_0384: update storage with new lib updates
Add:
- deleteSession
- storeTrust
- loadTrust
- listJIDs
- deleteJID

Fix:
- loadInactiveDevices
- storeInactiveDevices

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
623ca1e2bb xep_0384: get_device_list now always returns active devices
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
57addc3b39 xep_0384: add _fetch_device_list method for manual fetching
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
09083d0724 xep_0384: handle IqError and IqTimeout in _fetch_bundle
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
71c592d666 xep_0384: Move _fetching_bundle method out of plugin class
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
be6b0efb0f xep_0384: rework _store_device_ids method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
8d35f7f80a xep_0384: Allow Devices in Items as well as EventItems
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
eb3916e92e xep_0384: handle OMEMO devices ns explicitely
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00
b64371e8fe xep_0384: Move _generate_encrypted_payload out of plugin class
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-01-29 18:05:59 +01:00