Commit Graph

2280 Commits

Author SHA1 Message Date
Jonas Platte
dfd59f42a9 Fix warp build error 2021-11-29 13:36:05 +01:00
Jonas Platte
557e038869 Minimal style improvements 2021-11-29 13:27:38 +01:00
Jonas Platte
36db5e47dd Upgrade Ruma 2021-11-26 19:22:54 +01:00
Damir Jelić
56d80b91c9 fix(sdk): Send the crypto requests out before a sync as well 2021-11-26 16:52:32 +01:00
Damir Jelić
b0f48c9660 fix(crypto): Let users fetch our own device out of the store 2021-11-26 16:52:31 +01:00
Damir Jelić
68a2020516 fix(crypto): Check if the device we get from the server matches our own 2021-11-26 16:26:40 +01:00
Damir Jelić
13db642143 fix(cyrpto): Log database upgrades using the debug log level 2021-11-26 16:26:40 +01:00
Damir Jelić
f2c344b39a fix(crypto): Use the DeviceKeys as the inner type for a ReadOnlyDevice 2021-11-26 16:26:40 +01:00
Damir Jelić
7b6132b71e feat(crypto): Return the list of room keys we imported
Clients might want to retry decryption after they import room keys, for
this to be efficient they'll need to know which room keys got imported.

This patch extends the return value of the room key import result to
include the map of room keys that got imported.
2021-11-25 16:41:28 +01:00
Damir Jelić
10173b990d fix(sdk): Degrade some logs that show user ids to the debug log level 2021-11-25 14:49:07 +01:00
Damir Jelić
fc74526699 fix(crypto): Add the ability to mark room keys as backed up when importing 2021-11-25 11:18:09 +01:00
Damir Jelić
55973b5bf1 fix(crypto): Make ExportedRoomKey deserialization laxer
Some clients might have skipped the serialization of an empty
sender_claimed_keys and the forwarding_curve25519_key_chain, while these
fields are required there's really no upside in requiring them if they
are empty.

So create defaults if they are missing.
2021-11-25 10:20:09 +01:00
Damir Jelić
33b198d505 fix(crypto): Make sure we remove the unsigned object before signing 2021-11-24 15:56:32 +01:00
Damir Jelić
be70d38e2a fix(crypto): Use the from constructor for some maps with known values 2021-11-24 15:56:05 +01:00
Damir Jelić
1e70b4f804 fix(crypto): Automatically track your own user if the caller doesn't do so
Users of the crypto crate should mark all members that are part of an
E2EE room for tracking, this will of course mark your own user for
tracking.

If the crypto crate user doesn't have any E2EE rooms he may not add any
members to be tracked. The user might still want to inspect their own
E2EE devices and identities. This patch makes sure that our member is
tracked.
2021-11-24 15:21:50 +01:00
Benjamin Kampmann
9835c4ad92 Update to webpack5 2021-11-24 11:00:52 +01:00
Damir Jelić
a49a7fe1f9 fix(crypto): Clear the master key signatures when we verify our own user 2021-11-22 18:00:52 +01:00
Damir Jelić
fa42373cf8 Merge branch 'client-arc' 2021-11-22 16:27:27 +01:00
Damir Jelić
a8c36b4041 Merge branch 'fix-session-doc-example' 2021-11-22 16:24:31 +01:00
Damir Jelić
b91773a276 Merge branch 'store-upgrade-fix' 2021-11-22 16:23:53 +01:00
Damir Jelić
fbc01f015d fix(sdk): Use the correct restore method in an example 2021-11-22 15:44:35 +01:00
Damir Jelić
5d26e36e1f fix(crypto): Make sure we store the store version using the right key 2021-11-22 15:28:21 +01:00
Damir Jelić
c4f60dd163 fix(crypto): Only upload our own signature when verifying user identities 2021-11-22 12:33:18 +01:00
Jonas Platte
b4220bd824 Reduce the size of Client
… by moving all of its fields into an inner reference-counted type
rather than using reference counting for all fields individually.
Some fields are still refcounted individually and thus go through an
extra layer of indirection, but the size and clone simplification should
still make this change worthwhile.
2021-11-20 02:01:07 +01:00
Jonas Platte
73c5bfed28 Switch from futures-locks to async-lock 2021-11-20 02:01:07 +01:00
Jonas Platte
2456beaf88 Make Result alias more flexible 2021-11-20 00:00:08 +01:00
Jonas Platte
cc6f97bee9 Fix missing word 2021-11-20 00:00:08 +01:00
Jonas Platte
8f47e6ffe9 Remove copy-pasted module documentation
It doesn't seem right that both room and room_member have  the same
description. Also room_member is private and doesn't usually show up in
docs.
2021-11-20 00:00:08 +01:00
Jonas Platte
544b24b0ef Move some code out of client.rs
It is by far the biggest module of the matrix-sdk crate.
2021-11-20 00:00:08 +01:00
Jonas Platte
1e13e06e34 Make event-handling related Client fields private 2021-11-19 20:48:27 +01:00
Damir Jelić
5a4aa71f6a feat(base): Add a From login response implementation for the Session 2021-11-19 09:41:48 +01:00
Damir Jelić
6606703001 docs(base): Remove anyhow from an example since it isn't used 2021-11-19 09:12:51 +01:00
Andy Balaam
0c35d8890d Improve Session docs example 2021-11-18 17:14:34 +00:00
Andy Balaam
7d7bd97812 Document how to create a Session 2021-11-18 14:18:16 +00:00
Andy Balaam
f5ba9a5eea Update BackupMachine documentaton to refer to enable_backup_v1 2021-11-18 10:28:03 +00:00
Damir Jelić
2e4d5f25cb feat(crypto): Add a method to get the algorithm of the public backup key 2021-11-17 13:02:23 +01:00
Damir Jelić
534e50da57 fix(crypto): Rename the enable_backup method so we can add a v2 one 2021-11-17 13:02:23 +01:00
Damir Jelić
1ffa06884a fix(crypto): Rename the decrypt method on the RecoveryKey struct
The new backup algorithm reuses the same key but uses a different
construct to encrypt/decrypt room keys. This reflects that our decrypt
method uses the v1 algorithm.
2021-11-17 13:02:23 +01:00
Damir Jelić
670e212d9b docs(crypto): Fill out the docs for the backup related types 2021-11-17 13:02:23 +01:00
Damir Jelić
6fc703b4a3 fix(crypto): Fix a bunch of clippy warnings 2021-11-17 13:02:23 +01:00
Damir Jelić
33b7062515 fix(crypto): Fix a bunch of typos 2021-11-17 13:01:58 +01:00
Damir Jelić
a7bbeb7ef5 improvement(crypto): Add tests for the recovery key 2021-11-17 13:01:58 +01:00
Damir Jelić
34ec4ac3c9 improvement(crypto): Add tests for the backup machine 2021-11-17 13:01:58 +01:00
Damir Jelić
3f227de023 fix(crypto): Fix the backed up room key count in the memory store 2021-11-17 13:01:58 +01:00
Damir Jelić
a417aa23fa fix(crypto): Load the recovery key from the sled store 2021-11-17 13:01:58 +01:00
Damir Jelić
f8fdfd1613 fix(crypto): Add a proper exception when creating the Pk decryption object 2021-11-17 13:01:58 +01:00
Damir Jelić
1fdd560ff0 fix(crypto): Remove a unneeded clippy attribute 2021-11-17 13:01:58 +01:00
Damir Jelić
878969a5c4 docs(crypto): Add some docs for the backup related types 2021-11-17 13:01:58 +01:00
Damir Jelić
c6d073ebd7 fix(crypto): Remove some dead code 2021-11-17 13:01:58 +01:00
Damir Jelić
2b5ae869cd feat(crypto): Gossip the backup recovery key if requested 2021-11-17 13:01:58 +01:00