Commit Graph

40 Commits (2ef0c2959cd9b9d2103c88a0111cadb1c15a2f3c)

Author SHA1 Message Date
Devin Ragotzy 2ef0c2959c Add use_small_heuristics option and run fmt 2021-05-12 15:37:29 -04:00
Devin Ragotzy c85f4d4f0c Add rustfmt config file and run over workspace 2021-05-12 15:36:52 -04:00
Damir Jelić 324a0aafca Merge branch 'key-share-improvements' 2021-04-21 13:47:02 +02:00
Damir Jelić bfc7434f7e crypto: Move the outbound session filter logic into the group session cache 2021-04-20 13:35:47 +02:00
Johannes Becker 3414a59b91 chore: bump ruma 2021-04-16 12:45:21 +02:00
Damir Jelić d4c56cc5b3 crypto: Refactor the outobund group session storing
This introduces a group session cache struct that can be shared between
components that need to access the currently active group session.
2021-04-15 15:19:21 +02:00
Damir Jelić cb58c499b3 crypto: Store that our outbound session was invalidated 2021-04-12 13:47:38 +02:00
Damir Jelić bbe812f1d9 common: Add a executor abstraction so we can spawn tasks under WASM 2021-03-23 10:18:55 +01:00
Damir Jelić 75ac29540d crypto: Simplify counting the number of messages a to-device request has 2021-03-13 11:50:05 +01:00
Damir Jelić 880818a588 crypto: Send bigger sendToDevice requests out that carry our room keys 2021-03-12 16:33:35 +01:00
Damir Jelić e09a155cfc crypto: Fix a completely wrong application of extend()
We were merging the to-device messages using the extend() method while
our data has the shape of BTreeMap<UserId, BTreeMap<_, _>>, extending
such a map would mean that the inner BTreeMap would get dropped if both
maps contain the same UserId.

We need to extend the inner maps, those are guaranteed to contain unique
device ids.
2021-03-12 16:33:26 +01:00
Damir Jelić aff5cddb68 crypto: Remove an unneeded import. 2021-03-10 09:58:30 +01:00
poljar 4a8c30527d
crypto: Fix a typo.
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
2021-03-10 09:54:33 +01:00
Damir Jelić 560aa5b0a9 crypto: Encrypt the share group session requests in parallel. 2021-03-09 15:09:59 +01:00
Damir Jelić a8bc619dca crypto: Encrypt room keys for a room key share request in parallel 2021-03-09 14:30:28 +01:00
Damir Jelić 61167fab15 crypto: Make restored outbound sessions wait for requests if they have some 2021-03-05 17:12:32 +01:00
Damir Jelić 93e5c34670 crypto: Add a bit more info to the room key sharing logic logging 2021-03-02 17:15:10 +01:00
Damir Jelić 6597948564 crypto: Add a TODO item for m.room_key.withheld messages 2021-03-02 16:27:24 +01:00
Damir Jelić 693a0337a2 crypto: Don't log the devices that receive an outbound session twice 2021-03-02 16:26:58 +01:00
Damir Jelić 123772c524 crypto: More logs for the group session sharing logic 2021-03-02 14:54:56 +01:00
Damir Jelić bb358909ef crypto: Fix a typo and improve some logs in the session sharing logic. 2021-03-02 12:54:22 +01:00
Denis Kasak 3f7eae8633 cargo fmt 2021-03-02 12:20:09 +01:00
Denis Kasak 2b5e1744ee More refactoring of the group session sharing code for clarity. 2021-03-02 12:20:09 +01:00
Denis Kasak df8c489304 Fix typo: visiblity -> visibility 2021-03-02 12:20:09 +01:00
Denis Kasak aa16a7e291 crypto: Refactor the group session rotation code some more for clarity. 2021-03-02 12:20:09 +01:00
Denis Kasak 70ecf269d0 Improve docstring of GroupSessionManager::collect_session_recipients. 2021-03-02 12:20:09 +01:00
Damir Jelić 2e659afd26 crypto: Make it clearer that the deleted flag can only be set to true 2021-03-01 20:34:29 +01:00
Damir Jelić 9e83eaf2f5 crypto: Store the history visiblity with the outbound session 2021-02-03 16:01:58 +01:00
Damir Jelić 10da61c567 crypto: Answer key reshare requests only at the originally shared message index 2021-01-28 14:07:51 +01:00
Damir Jelić 6cb2c8b468 crypto: Store and restore outbound group sessions 2021-01-25 17:14:13 +01:00
Damir Jelić 1483c22171 crypto: Don't send out empty to-device reuqests when sharing sessions
An empty to-device request can happen if we're trying to re-share a
session with devices that are we're missing an olm session with so don't
send them out.
2021-01-21 14:04:31 +01:00
Damir Jelić ef2f20eb97 crypto: Rotate the megolm session if a device gets blacklisted 2021-01-21 12:19:02 +01:00
Damir Jelić 377b8ea75a crypto: Use consistent ordering for the group session sharing log line 2021-01-19 10:19:15 +01:00
Damir Jelić e5ba0298d0 crypto: Refactor and document the share group session method a bit better 2021-01-18 15:21:54 +01:00
Damir Jelić 4eb504d000 crypto: Improve the log line when we share group sessions 2021-01-18 14:15:31 +01:00
Damir Jelić 436530e874 crypto: Fix a couple clippy warnings 2021-01-18 13:50:59 +01:00
Damir Jelić 43a74524c5 crypto: Add a pending requests method for the outbound group session 2021-01-18 12:44:19 +01:00
Damir Jelić bab8fde0ac crypto: Change the way we share group sessions
This patch removes the need to ask if a group session needs to be shared
it also adapts the method so it re-shares sessions if new users or
devices join the group.
2021-01-15 18:04:45 +01:00
Damir Jelić 7cab7cadc9 crypto: Rework the cryptostore.
This modifies the cryptostore and storage logic in two ways:
    * The cryptostore trait has only one main save method.
    * The receive_sync method tries to save all the objects in one
    `save_changes()` call.

This means that all the changes a sync makes get commited to the store
in one transaction, leaving us in a consistent state.

This also means that we can pass the Changes struct the receive sync
method collects to our caller if the caller wishes to store the room
state and crypto state changes in a single transaction.
2020-10-20 17:19:37 +02:00
Damir Jelić e7a24d5e68 crypto: Move the session managers under a common module. 2020-10-16 11:09:55 +02:00