Commit graph

287 commits

Author SHA1 Message Date
Bruno Windels 62b3a67e33 write unit tests for correctly reading history visibility when needed 2022-07-28 17:09:41 +02:00
Bruno Windels 319ec37864 fix typos preventing to load the history visibility 2022-07-28 11:44:50 +02:00
Bruno Windels 0df66b5aea track room before listing user ids when sharing key 2022-07-27 12:06:55 +02:00
Bruno Windels f18520a2fe let loadMembers use own txn in case members haven't been fetched yet
if they haven't, it will need a network request, meaning that the txn
will get closed, so we can't reuse it afterwards
2022-07-27 11:39:50 +02:00
Bruno Windels 50b6ee91d7 don't need history visibility here 2022-07-27 11:39:36 +02:00
Bruno Windels 544afef902 test adding and removing when tracking multiple rooms 2022-07-26 17:41:26 +02:00
Bruno Windels dd878bb8d6 also take rejecting invites into account to remove user identity 2022-07-26 16:58:07 +02:00
Bruno Windels dea3852425 add some tests for sharing keys with invitees 2022-07-26 16:57:28 +02:00
Bruno Windels 4c17612b05 allow passing txn to loadMembers so we can do it as part of sync txn
to rewrite useridentities upon receiving new history visibility
2022-07-26 16:53:02 +02:00
Bruno Windels a23df8a545 pass history visibility to device tracker
and delegate adding and removing members to share keys with to it
2022-07-22 17:49:59 +02:00
Bruno Windels 17f42f523a add write method for when history visibility changes
also returning added and removed user ids
2022-07-22 17:49:26 +02:00
Bruno Windels f6011f3f34 take history visibility into account in device tracker
and return added and removed userids to their userIdentity for the given
room, so room encryption can share and discard the keys for them
2022-07-22 17:48:26 +02:00
Bruno Windels 86c0e9e669 logic for whether a key should be shared by membership and h. visibility 2022-07-22 17:46:53 +02:00
Bruno Windels f337940202 this migration shouldn't be needed anymore
and undoes the export of addRoomToIdentity, which is somewhat internal
2022-07-22 17:46:29 +02:00
Bruno Windels c8a8eb10b5 get user ids for sharing a new key when the message is sent
rather than when the key happens to get sent
2022-07-20 15:21:33 +02:00
Bruno Windels d79e5f7806 create key share operations for invitees when history visibility=invited 2022-07-20 15:20:23 +02:00
Bruno Windels c62c8da10b fix changed key not being ignored 2022-05-31 13:39:35 +02:00
Bruno Windels bc51644868 reassignment is not used later on, remove 2022-05-31 13:39:23 +02:00
Bruno Windels 3d3d590334 add failing test for device with changed key being returned 2022-05-31 13:39:05 +02:00
Bruno Windels 11d7535c23 add some basic tests (with mock utils) for DeviceTracker 2022-05-31 13:38:34 +02:00
Bruno Windels b6d9993ed0 remove unused import 2022-03-01 17:08:49 +01:00
Bruno Windels 8adc5a9fae these were public actually 2022-02-18 17:24:55 +01:00
Bruno Windels 3f9f0e98c7 remove unused olm property in SenderKeyDecryption 2022-02-18 17:21:27 +01:00
Bruno Windels 82299e5aea
Update src/matrix/e2ee/olm/Decryption.ts
Co-authored-by: R Midhun Suresh <hi@midhun.dev>
2022-02-18 17:18:33 +01:00
Bruno Windels 3330530f68
Update src/matrix/e2ee/DecryptionResult.ts
Co-authored-by: R Midhun Suresh <hi@midhun.dev>
2022-02-18 17:18:25 +01:00
Bruno Windels 620409b3f0 fixup: ctor argument order
as it was an object before, order didn't matter
2022-02-18 17:17:24 +01:00
Bruno Windels 78e0bb1ff0 replace isPreKeyMessage with const enum 2022-02-18 17:00:56 +01:00
Bruno Windels 347edb5988 remove unused storage property 2022-02-18 16:47:47 +01:00
Bruno Windels e3e90ed167 convert olm/Encryption to TS 2022-02-16 18:00:13 +01:00
Bruno Windels eb5ca200f2 missed rename here 2022-02-16 18:00:03 +01:00
Bruno Windels a4fd1615dd convert decryption 2022-02-15 18:21:29 +01:00
Bruno Windels 74c640f937 convert Session 2022-02-15 18:21:12 +01:00
Bruno Windels 7aeda70ff6 convert DecryptionResult 2022-02-15 18:20:14 +01:00
Bruno Windels 348de312f9 draft code in matrix layer to create room 2022-02-02 10:19:49 +01:00
Bruno Windels 00c5e747d2 log total backed up keys during flush operation 2022-02-01 12:30:45 +01:00
Bruno Windels 02f06724d0 don't block reenabling 4s if already enabled 2022-02-01 11:26:00 +01:00
Bruno Windels 9c599d53aa allow to inject max delay in key backup 2022-01-31 17:31:01 +01:00
Bruno Windels 62acd458c6 also ask for new key if backup version is not found 2022-01-31 17:30:51 +01:00
Bruno Windels 17275a5390 backup 200 keys per request 2022-01-31 17:30:15 +01:00
Bruno Windels 830786b2fd fixes and cleanup 2022-01-31 16:26:14 +01:00
Bruno Windels 6541aacf98 don't discount already finished keys in total for previous iterations 2022-01-31 16:23:48 +01:00
Bruno Windels a757fb3696 better error handling in key backup, cleanup and not overuse observables 2022-01-31 14:37:05 +01:00
Bruno Windels ae5cc17290 mark all inbound sessions to be backed up again when changing version 2022-01-31 14:36:04 +01:00
Bruno Windels 7d3e3b992b some more typing 2022-01-28 13:14:38 +01:00
Bruno Windels c47bdd5715 flush key backup when creating a new room key 2022-01-28 13:14:11 +01:00
Bruno Windels b692b3ec4f move key backup operation and flush bookkeeping inside KeyBackup
so we can flush from other places than Session
2022-01-28 13:13:23 +01:00
Bruno Windels ebc7f1ecd7 needs to be awaited 2022-01-28 13:11:52 +01:00
Bruno Windels a499689bd8 also write room key that we create ourselves with RoomKey infrastructure
so all keys are written in one place and the flags are always correct
2022-01-28 13:10:48 +01:00
Bruno Windels c81dde53e7 store key source in inbound session 2022-01-28 10:03:30 +01:00
Bruno Windels dd2b41ff95 use backup flag in key backup rather than separate store 2022-01-27 16:07:18 +01:00