Commit graph

263 commits

Author SHA1 Message Date
2a9bade333 Rename short variable
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-16 01:06:26 +01:00
28fe0d04c7 Remove unused variable in for loop
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-16 01:06:26 +01:00
9e67d7d887 Use the new receiving_chain_length endpoint
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-16 01:06:26 +01:00
80cdab3ba3 is_encrypted doesn't require the plugin to be instanciated
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-16 01:06:26 +01:00
8e44c07aed Specify local=False parameter to ['xep_0030'].get_info
The API here might have changed? It seems this call was going just fine
until it wasn't. It was returning an empty string. Adding `local=False`
seems to force it to fetch the info remotely and return a proper Iq.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-16 01:06:26 +01:00
29bf6e8650 Update omemo lib to 0.13 and asyncio changes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-16 01:06:26 +01:00
080a27e7d8
Add 0030 as a direct dependency
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-15 22:50:10 +01:00
272ea80581
CI: Add py3.{9,10}
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-15 01:13:45 +01:00
cd5a09d2f0 Update ChangeLog
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-15 01:06:38 +01:00
aa91f43aa0 Merge branch 'decrypt-heartbeats' into 'main'
Don't fail on decrypting heartbeats

See merge request poezio/slixmpp-omemo!12
2021-12-15 01:03:15 +01:00
e00c646d95
echo_client: Handle decrypt_message's Optional-ness
Also comment about it

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-15 00:56:19 +01:00
05b5705f22
Don't fail on decrypting heartbeats
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-12-14 17:20:16 +01:00
494899bb3c
Add interface semi-hidden to RatchetForwardingMessage
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-18 00:30:07 +02:00
26665d9e6a should_heartbeat: factor out in internal method to avoid reparsing message
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-17 20:18:47 +02:00
bb52d93241
should_heartbeat: also return True on new sessions
And the docstring now reflects the reality again!

We're parsing the Encrypted dict again, when we just did it in
decrypt_message above, but this function is also part of the API and
doing that for them is the least we can do.

Maybe there should be an internal function that we can call from
decrypt_message, that also gets called by should_heartbeat.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-17 18:58:31 +02:00
91a04000d7
Treat receiving chain length None as 0
It appears a receiving chain length set to None just means we haven't
received any message for this session yet. It doesn't make sense to spam
heartbeats at this stage

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-17 11:31:36 +02:00
baf29cb05f
should_heartbeat: correctly return what last commit said
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-17 03:39:48 +02:00
c7a0a092d4 should_heartbeat: also take into account unacked sessions
receiving_chain_length would sometimes be None (thanks python strict
typing) causing the thing to fail.

When this is the case, I assume this means the session hasn't been
confirmed from our side yet and it would be good to ACK it. (To be
confirmed with people who know, in progress).

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-17 02:56:57 +02:00
a2a287ee5d
don't include empty sessions in _chain_lengths method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-16 21:49:55 +02:00
7a887ccac3 Pass correct argument type to should_heartbeat call
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-16 21:37:56 +02:00
59543ac585
Add missing argument to should_heartbeat call
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-16 21:31:57 +02:00
a8ce75551a
Update ChangeLog
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-15 02:36:13 +02:00
311292a0be Merge branch 'initial-publish' into 'master'
Fix #10: ensure device list and bundle are published after startup

Closes #10

See merge request poezio/slixmpp-omemo!11
2021-07-15 00:48:58 +02:00
aa54f58649 Always publish on session_start
The condition wasn't necessary in session_start for PEP nodes not to be
published multiple times.

This also fixes the fact that we weren't publishing on reconnect.

And also fixes one indentation level too many in the _initial_publish
method.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-15 00:46:35 +02:00
fbe5e36c3e Fix #10: ensure device list and bundle are published after startup
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-15 00:46:35 +02:00
3ac03796dc Merge branch 'heartbeat' into 'master'
Automatically send heartbeats

See merge request poezio/slixmpp-omemo!10
2021-07-15 00:43:30 +02:00
7e079f4260 make_heartbeat needs to be async
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-14 09:45:15 +02:00
95481e64b2 decrypt_message: don't always send heartbeat
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-14 09:45:15 +02:00
89eb4dfece decrypt_message: msg.send isn't a coroutine
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-14 09:45:15 +02:00
7f1d48c529 make_heartbeat: add parameter to make_message
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-14 09:45:15 +02:00
ad5822b360 Automatically send heartbeats
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-14 09:45:15 +02:00
62fa03959a Ensure bundles are republished on decrypt
This would likely do that we had a fixed set of prekeys because we
wouldn't republish after one was used.

This shouldn't have any security implications. Just so that we wouldn't
have been able to initiate new sessions after all published prekeys were
used up, as we don't have the private keys anymore. They are deleted
when used (as should be) by the backend OMEMO library.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-14 09:39:40 +02:00
af33cd41e5
Learn about chain length: new should_heartbeat method
With this commit, slixmpp-omemo now reads the ratchet chain length,
(both receiving and sending), that we should track to know when to send
a heartbeat message.

This allows us to signal other devices that we are still active and
listening. Some clients will stop encrypting to us if we haven't replied
for a certain number of messages.

The current 0384 spec (0.7) says we should send a heartbeat message at
least once this number goes over 53 (fair dice roll). It doesn't say
when a client may/should stop encrypting to us, or what it should do at
all once we go over 53.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-13 20:29:14 +02:00
38701075e9
echo_client: fix wrong variable error
Thanks mathieui

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-13 20:28:19 +02:00
59e82ec9ee
echo_bot: implement basic commands
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-12 23:25:57 +02:00
ba028d98c8
echo_bot: Don't pass the whole message to plain_reply and encrypted_reply anymore
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-12 23:12:09 +02:00
cea2345f29
echo_bot: change messages style
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-12 19:26:24 +02:00
d9b77dbf86
Release 0.5.0
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-12 11:22:23 +02:00
78db04a1a8 Add my_fingerprint method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-07-12 11:14:19 +02:00
92a379a327 Merge branch 'change-fp-repr' into 'master'
fp_from_ik: change fp repr to lowercase with no colon

See merge request poezio/slixmpp-omemo!8
2021-07-12 11:09:42 +02:00
6c61d0f237 fp_from_ik: change fp repr to lowercase with no colon
This allows the user to be able to do what they want with the string.
They can then insert colons, or split up in groups of chars or..

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-06-29 02:02:43 +02:00
957b555d93
Raise an exception when the payload is not of the form we expect
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-28 12:28:52 +01:00
94e3a62d8a
Error out when data_dir is not specified. #11
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-12 01:30:30 +01:00
534492fe45
Simplify fp_from_ik method, remove codec import
Reuse changes from python-omemo, explicitly the following PR under CC0:
https://github.com/Syndace/python-omemo/pull/28

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-11 03:26:32 +01:00
b5faae0b23
Change variable name to make mypy happier
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-11 01:33:10 +01:00
1ac08130ed
Ensure expect_problems is a dict within encrypt_message
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-11 01:32:39 +01:00
ce868745d5
CI: Allow failure for now
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-11 01:26:34 +01:00
a478dc59de
Add .gitlab-ci.yml
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-11 01:24:48 +01:00
266684b036
Release version 0.4.0
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-10 23:17:01 +01:00
7d80d74554
Add ChangeLog
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-03-10 23:03:48 +01:00