Commit Graph

283 Commits

Author SHA1 Message Date
Nicolas Werner ebd5bc3d24
refactor: make room nullsafe 2021-10-28 00:54:25 +02:00
Nicolas Werner fb0a84d7b2
refactor: make client nullsafe 2021-10-25 16:34:02 +02:00
Nicolas Werner 17fd1f22b3 refactor: make event nullsafe 2021-10-25 10:10:25 +00:00
Krille Fear d2ee73f96f chore: Bump version 2021-10-25 11:19:45 +02:00
Krille Fear 7a85d52d93 fix: Remove unnecessary null check 2021-10-25 11:11:55 +02:00
Nicolas Werner 60956bde00 chore: port the remaining encryption files to nullsafety 2021-10-13 13:58:21 +00:00
Lukas Lihotzki a7818bbd0f refactor: null safety for all utils 2021-10-05 15:41:25 +02:00
Lukas Lihotzki 4bd659fd56 style: remove unneeded trailing comma 2021-09-30 15:53:43 +02:00
Lukas Lihotzki 85004e1faf refactor: capture member variables as finals 2021-09-30 15:53:43 +02:00
Lukas Lihotzki 41d905ca60 refactor: use more ?. 2021-09-30 15:53:43 +02:00
Nicolas Werner 71e5ec1bb5 style: use map entry with explicit types over cast 2021-09-30 12:58:37 +00:00
Nicolas Werner 6f7f7100e1 fix: use explicit type in fold instead of cast 2021-09-30 12:58:37 +00:00
Nicolas Werner 7dd176c278 fix: apply review feedback 2021-09-30 12:58:37 +00:00
Nicolas Werner 08bbb3f6f5 fix: prefer ! over ? 2021-09-30 12:58:37 +00:00
Nicolas Werner d15c71e5b3 fix: pre vs postcrement confusion 2021-09-30 12:58:37 +00:00
Nicolas Werner e5682fcb91 refactor: remove clientid from encryption code 2021-09-30 12:58:37 +00:00
Nicolas Werner 1c838e3be8 fix: Cleanup nullsafe encryption a bit 2021-09-30 12:58:37 +00:00
Nicolas Werner a196b53219 refactor: nullsafe encryption 2021-09-30 12:58:37 +00:00
Krille Fear 62fe7a1704 fix: New verification requests on requesting history
If requesting history happens to contain a m.key.verification.request we currently create a new key verification object and push it to the client.
This fixes it.
2021-09-27 14:51:25 +02:00
Jayesh Nirve 77ca7523d0 refactor: remove unused clientId 2021-09-24 16:05:05 +02:00
Sorunome b41c7b1bc6
fix: Don't re-play m.dummy to_device events
If both ends had m.dummy events queued as last messages an an olm
session corrupted, then the clients landed in an infinite game of
ping-pong. It was so stable, that the clients could have won the
ping-pong world championships!
2021-09-21 10:05:51 +02:00
Sorunome fe9145d580 fix: missing null check 2021-09-18 07:50:45 +00:00
Sorunome 0611ea1495
fix: Auto-reply key requests 2021-09-16 22:14:41 +02:00
Christian Pauly 00771fc209 refactor: _updateUserDeviceKeys method 2021-09-13 14:58:07 +02:00
Nicolas Werner e000fbf9be fix: compilation against newer matrix_api_lite 2021-09-10 16:40:40 +02:00
Christian Pauly 630203e7b6 fix: Check if database got disposed in keyManager 2021-09-03 15:05:34 +02:00
Christian Pauly 9c1f79359e refactor: Replace all logic regarding sortOrder
The current implementation of sortOrder can be made way more easier now
by just keeping the sortOrder of the list
and the timelineFragments in the hiveStore. This needed a huge
change but mostly removes a lot of code which can be done
way more easy now. This also needed some rewriting of the setState logic and changes to
the prevEvent calculation. This solution should also be more stable.
More information:
https://www.reddit.com/r/fluffychat/comments/pfnlhq/the_sort_order_of_matrix_timelines/
2021-09-02 07:13:38 +00:00
Christian Pauly fb62307730 fix: Check if client is disposed in a callback
This fixed an edge case in the tests.
2021-09-02 06:43:06 +00:00
Christian Pauly 9b7474e2f2 refactor: Update to dart 2.12 and opt out in all files
This also adds some missing license headers, I have detected while
using license header search&replace to add the
null safety opt out
2021-08-18 08:09:39 +02:00
Sorunome 98b0bd4322 feat: Add a way to get a verification request by its transaction id
A client might find the need to get the verification request object by
its transaction id, to be able to e.g. display for in-room verification
an "accept verification request" button easily.
2021-08-17 15:03:30 +00:00
Marcus f91f662c75 chore: update to matrix_sdk_lite 0.4.1 2021-08-05 12:10:45 +00:00
Nicolas Werner 08c808562b fix: Typo in key backup requests
This may lead to messages not decrypting after interactive verification,
which would make the user manually press the request keys button.
2021-08-03 13:18:15 +00:00
Nicolas Werner 162436cc8d fix: accidental OTK uploads on internal fakeSync 2021-08-02 20:52:09 +02:00
Christian Pauly e8d511a371 fix: Missing null checks in syncUpdate handling 2021-07-27 10:49:50 +02:00
Lukas Lihotzki 46b2f8898e fix: use TryGet.optional 2021-07-26 15:33:36 +02:00
Lukas Lihotzki 8665f092f4 chore: matrix_api_lite 0.4.0 2021-07-26 14:54:22 +02:00
Nicolas Werner 179f73db3a fix: Upload OTKs if the otk_count field is missing
fixes #180
2021-07-26 09:47:05 +02:00
Christian Pauly 209035ffbd refactor: Use official Dart isolates
The isolates package is discontinued and not compatible
with the newest Dart version.
dart:isolate is not an option because importing this
library makes it impossible to run the matrix
SDK on dart web native. It just won't
build. So we now just depend on
that the flutter app pass through the compute method.
2021-07-21 12:34:43 +02:00
Christian Pauly 99c900be9c fix: Add missing null check
With Synapse 1.38 SyncUpdate.accountData is null if it is empty.
2021-07-19 09:18:23 +02:00
Christian Pauly 69b52ba85b refactor: Move pedantic to dev_dependencies
The unawaited method from the pedantic package was a historic solution
for the case that you dont want to await a future in an async function.
But now we can do this with just a comment which
is the recommended way to do this now.
This makes it possible to have pedantic as a dev_dependency which means just one dependency less.
2021-06-18 10:15:59 +02:00
Christian Pauly c0c7f68bf3 chore: Rename to matrix 2021-06-18 09:58:25 +02:00
Christian Pauly 9631cea83a feat: Add toJson method for StoredInboundGroupSession 2021-06-01 12:51:17 +02:00
Christian Pauly c3d47b16c6 CI: Use correct image 2021-05-25 10:46:34 +02:00
Christian Pauly c66e35c16c refactor: Create a clean database API 2021-05-20 07:36:03 +00:00
Lukas Lihotzki c196610998 chore: operation names from OpenAPI spec 2021-05-12 13:56:16 +02:00
Lukas Lihotzki fdf650abd5 refactor: avoid if-condition based on bit value 2021-04-26 18:48:54 +02:00
Lukas Lihotzki b4f755388a refactor: high-level loops 2021-04-19 18:58:59 +02:00
Christian Pauly ffef732103 refactor: enable more linter rules
enable prefer_final_locals and prefer_final_in_for_each linter rules
2021-04-14 10:29:29 +02:00
Lukas Lihotzki 545ce26e39 style: fix format and lint 2021-04-12 14:49:03 +02:00
Lukas Lihotzki 761138a56d refactor: use OpenSSL for AES 2021-04-12 14:49:01 +02:00
Lukas Lihotzki 7faf05fe90 refactor: selectable hash for pbkdf2 2021-04-12 14:48:38 +02:00
Lukas Lihotzki a25d1932ee fix: fast pbkdf2 with OpenSSL 2021-04-12 14:48:38 +02:00
Lukas Lihotzki 285b14912a chore: null safe crypto dependencies 2021-04-12 14:48:36 +02:00
Lukas Lihotzki 08043c06f4 refactor: high-level loops 2021-04-01 12:51:45 +02:00
Christian Pauly 0ceb2b26df refactor: Constants names 2021-03-30 12:43:50 +02:00
Christian Pauly 9012ce6b2c fix: Display errors from isolates in the logs 2021-03-17 09:46:13 +01:00
Christian Pauly 0a9f8497e2 chore: Make bootstrap logs more chatty 2021-03-17 08:22:22 +01:00
Krille Fear 9bef8452d3 docs: Clean up dart documentations
Changing to `code` blocks where it cant be resolved to [stuff] things.
2021-03-16 12:32:21 +00:00
Krille Fear 57fde98fec Merge branch 'soru/less-sql-statements' into 'main'
chore: Reduce needed database accessess

See merge request famedly/famedlysdk!666
2021-03-09 18:12:40 +00:00
Sorunome c76dc0daa2
chore: Reduce needed database accessess 2021-03-09 18:28:58 +01:00
Sorunome 7ef288ec91
fix: A few ssss fixes 2021-03-09 18:28:42 +01:00
Krille Fear 44ca96e544 refactor: Update pedantic
This enforces to NOT use curly braces in Strings where not needed
and not await non-future variables.
2021-03-09 17:28:04 +00:00
Krille Fear 0d8bddf708 Merge branch 'soru/fallback-keys' into 'main'
feat: Add fallback keys support

Closes #136

See merge request famedly/famedlysdk!653
2021-03-03 07:38:32 +00:00
Sorunome 498c7825a5
feat: Add fallback keys support 2021-03-02 16:17:32 +01:00
Christian Pauly c9d3c327f6 refactor: Deprecate eventType in EventUpdate 2021-02-26 13:06:02 +01:00
Sorunome 34b15e45fc
fix: Better logic when to auto-trigger self-sign 2021-02-13 15:03:10 +01:00
Sorunome 6c2fc1679a
feat: Auto-selfsign and auto-cache when opening ssss keys 2021-02-13 14:55:09 +01:00
Krille Fear 6d7ab8e1d4 Merge branch 'soru/cancel-broadcast-verify' into 'main'
fix: Allow to broadcast cancels during key verification

See merge request famedly/famedlysdk!643
2021-02-10 12:44:21 +00:00
Sorunome 2d70360a8d
fix: Better detection if x-signing and megolm backup is enabled 2021-02-10 13:35:45 +01:00
Sorunome d07b663866
fix: Allow to broadcast cancels during key verification 2021-02-10 13:05:09 +01:00
Sorunome d373a06aa2
fix: Add to_device queue to prevent olm session corruptions 2021-02-08 14:57:19 +01:00
Christian Pauly bd4c4a6131 chore: Add more bootstrap logging 2021-02-04 15:33:27 +01:00
Sorunome 0462863ce6
fix: Cache ssss keys if using an existing ssss in bootstrapping 2021-02-03 14:47:42 +01:00
Sorunome 8a4af0c0ea
chore: add keyOrPassphrase to cross-signing selfVerify 2021-02-03 13:02:38 +01:00
Sorunome 0c4db25d05
feat: Add a way to string-encode a recovery key 2021-02-03 11:34:56 +01:00
Sorunome 650484c306 Merge branch 'krille/olmerrorhandling' into 'main'
change: Olm exception handling

See merge request famedly/famedlysdk!633
2021-02-03 10:09:43 +00:00
Christian Pauly 9fac03639e change: Olm exception handling 2021-02-03 11:01:01 +01:00
Christian Pauly ad39e3af25 chore: More try catch in bootstrap 2021-01-29 11:18:18 +01:00
Sorunome a35266f1e4
feat: Replay last sent olm message on olm session recovery from other device 2021-01-20 12:50:52 +01:00
Sorunome fddced2b3a
fix: Properly handle initial device key uploading failures and better handle OTK upload failures 2021-01-12 12:56:23 +01:00
Christian Pauly 8b13df8c9d refactor: Add json parsing for encryption and encrypted content 2021-01-08 13:26:25 +01:00
Christian Pauly 39b776716c refactor: Olm Exceptions 2021-01-07 12:53:49 +01:00
Christian Pauly 88403d19ba fix: Dont run background task after logged out 2021-01-05 15:15:39 +01:00
Krille Fear 2efe404e13 Merge branch 'soru/disable-master-autoverify' into 'main'
fix: Disable auto-verify own master key for now

See merge request famedly/famedlysdk!602
2021-01-05 13:58:37 +00:00
Sorunome a0f7dd4732
fix: Disable auto-verify own master key for now 2021-01-05 14:54:40 +01:00
Christian Pauly e806bb9770 refactor: Add verbose logs and refactor something 2021-01-05 14:44:15 +01:00
Christian Pauly 9ffecd845a chore: Update license header 2021-01-04 10:34:50 +01:00
Christian Pauly e450a09fb5 refactor: External matrix api 2021-01-04 10:26:29 +01:00
Sorunome 734ec0357b
fix: Throw an error if all existing olm sessions are corrupted 2020-12-31 10:45:22 +01:00
Sorunome 08dcce6225
chore: Add more debugging logs 2020-12-30 18:50:40 +01:00
Sorunome add19c73a0
fix: Load multiple olm sessions from the database at once for increased performance 2020-12-30 12:52:54 +01:00
Sorunome 6723c01a31
feat: Lazy-send room keys, chunked and sorted by importance 2020-12-29 14:46:36 +01:00
Sorunome 68afe362ce
feat: Start megolm sessions while typing 2020-12-28 16:14:07 +01:00
Sorunome ccd03ecd22
fix: Various small e2ee fixes 2020-12-28 14:49:55 +01:00
Sorunome 768baa7602
chore: Implement a proper deep-copy function for json maps 2020-12-28 14:35:21 +01:00
Christian Pauly 79fe7b0878 refactor: Replace some magic strings 2020-12-23 12:14:16 +01:00
Sorunome b00a9e8834
feat: Better determine which devices to encrypt to 2020-12-21 15:26:46 +01:00
Sorunome dfd88277b9 Merge branch 'soru/autoreply-more-key-requests' into 'main'
feat: Auto-Share megolm sessions with other users we know for a fact are...

Closes #127

See merge request famedly/famedlysdk!570
2020-12-21 14:08:17 +00:00
Sorunome df1c249011
feat: Auto-Share megolm sessions with other users we know for a fact are allowed to see said message 2020-12-21 14:41:44 +01:00
Christian Pauly cd4dafcd45 chore: Nicer logs in tests 2020-12-21 14:21:12 +01:00
Christian Pauly 57286d4c28 feat: Use logger package 2020-12-19 12:04:25 +00:00
Christian Pauly fbd7393fce fix: Dont create new megolm session if one is creating 2020-12-17 12:55:08 +01:00
Christian Pauly 3856b618e8 refactor: Encryption errors 2020-12-15 08:24:55 +01:00
Christian Pauly 6657e073a0 refactor: Follow up clean up bootstrap 2020-12-11 09:57:45 +01:00
Christian Pauly b563aec7bb refactor: Add secretstoragekeycontent 2020-12-10 11:03:45 +01:00
Sorunome 49f0679fbf feat: Add bootstrapping 2020-12-10 08:13:24 +00:00
Christian Pauly bec1761172 refactor: content parsing 2020-11-30 15:34:46 +01:00
Christian Pauly 323b203718 refactor: algorithm types 2020-11-30 14:26:31 +01:00
Sorunome 15d817023d
feat: Decrypt events on megolm key receiving better 2020-10-31 12:08:49 +01:00
Sorunome 5924e57cf1
feat: Add broadcast to-device verification 2020-10-30 11:40:19 +01:00
Sorunome 955fb747c2
fix: Only look at online keybackup for automated requests 2020-10-28 11:27:36 +01:00
Sorunome 412da6ae0c
fix: Properly rotate megolm session on device changes 2020-10-26 11:55:47 +01:00
Sorunome 343c26b3ed fix: Decrypt last message on received megolm key 2020-10-26 07:49:02 +00:00
Christian Pauly 66e590073e refactor: Event Update Type 2020-10-22 13:01:35 +02:00
Sorunome 090f0c326c
fix: Do not require unrequired field in supported versions response 2020-10-19 18:10:07 +02:00
Sorunome d116a52ea9
fix: Better handle olm session recovery 2020-10-17 12:03:54 +02:00
Sorunome ae79af6ea8
fix: store timestamps in milliseconds to fix decrypt error 2020-10-04 12:12:03 +02:00
Sorunome ab97c596ac
chore: Add better debug logging for corrupt sessions 2020-09-28 10:58:24 +02:00
Sorunome 86a4f90a5a
fix: Run automated key requests in root zone 2020-09-21 18:11:14 +02:00
Sorunome 70939a7c9c
fix: Message index replay attack check 2020-09-21 10:24:15 +02:00
Sorunome f6259efa59
fix: Better handle online key backup 2020-09-18 12:25:25 +02:00
Sorunome 5d5c7fa8b4
fix: Catch all root zone exceptions 2020-09-17 12:59:40 +02:00
Christian Pauly 0871e218d1 refactor: Json signature check 2020-09-16 12:29:21 +00:00
Christian Pauly df2cfb3faf fix: Ask only own devices on automated key requests 2020-09-16 13:42:05 +02:00
Sorunome cb1ec86b32
feat: Periodically fetch ssss secrets from other devices 2020-09-10 14:46:30 +02:00
Sorunome 2c7ae759f8
fix: Remove potential race conditions and database issues with OTK upload 2020-09-10 14:07:25 +02:00
Sorunome bbc1b63695
feat: Auto-verify own master key, if there is a valid signature chain within the same account 2020-09-10 13:04:24 +02:00
Sorunome 64b8e01444 fix: Handle duplicate indexes properly 2020-09-10 10:48:59 +00:00
Sorunome 99d536b14f
feature: Upload to online key backup 2020-09-09 09:53:26 +02:00
Sorunome 8a104b34ff
fix: potentially fix SSSS passphrase not working for some accounts 2020-09-07 16:31:29 +02:00
Sorunome 5863c8e168
fix: Run advanced things in database handling in their own separate zone 2020-09-06 15:06:41 +02:00
Sorunome ea59c4bd94
refactor(keybackup): Update database for stored megolm keys to prepare for proper online key backup 2020-08-17 09:10:51 +02:00
MTRNord 26586b6f02
style: Change package:famedlysdk imports to relative imports
Changing the imports from `package:famedlysdk` to relative imports allows us to easier move the files

Took 2 minutes
2020-08-13 10:40:39 +02:00
Christian Pauly fb9b505988 Krille/make client extend matrixapi 2020-08-11 16:11:51 +00:00
Christian Pauly c184dfba6b Don't show potential session keys in logs 2020-08-10 10:42:14 +02:00
Christian Pauly 6170c79fe1 Improve logging 2020-08-06 09:35:02 +00:00
Sorunome 18a790be84 put key request in try...catch 2020-08-01 07:06:39 +00:00
Christian Pauly 5bf52664e1 Merge branch 'soru/key-verification-fixes' into 'master'
some key verification fixes and temporarily disable transactions

See merge request famedly/famedlysdk!403
2020-07-30 08:33:44 +00:00
Sorunome 69431a1aff
some key verification fixes and temporarily disable transactions 2020-07-30 09:57:45 +02:00
Sorunome 6915781e6a
Prevent m.relates_to to be removed from the status=1 object in encrypted rooms 2020-07-29 11:43:27 +02:00
Sorunome 14c8377a2f
make sure that no http requests are done inside of /sync 2020-07-26 07:54:03 +02:00
Sorunome 2214ac2d0a fixes a racing condition in key verification 2020-07-20 06:31:05 +00:00
Sorunome fd406987c1 Better validate event contents 2020-06-29 12:02:18 +00:00
Sorunome fb48837d08
update function call 2020-06-24 09:30:25 +02:00
Sorunome b109e75962
also restore on broken olm session 2020-06-24 09:27:36 +02:00
Sorunome f833511e38
fix tests 2020-06-24 09:27:35 +02:00
Sorunome 68fac1e112
pick the correct session when encrypting to_device events 2020-06-24 09:27:32 +02:00
Sorunome f79a85ca71
Merge branch 'master' into soru/cross-signing 2020-06-24 09:26:22 +02:00
Sorunome 439f6f0aa0
Fix some olm sessions not being loaded from database 2020-06-23 11:42:01 +02:00
Sorunome 48c03865a2
make auth_data just a json object 2020-06-23 08:30:50 +02:00