Commit Graph

2236 Commits

Author SHA1 Message Date
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
Damir Jelić
2db52eed7c feat(crypto): Request the recovery key when we request secrets 2021-11-17 13:01:58 +01:00
Damir Jelić
656edce75a improvement(crypto): Make the backup logging prettier 2021-11-17 13:01:58 +01:00
Damir Jelić
4c021dea5e fix(crypto): Correctly reset the backup state of room keys 2021-11-17 13:01:58 +01:00
Damir Jelić
bbd76dafa0 fix(crypto): Fix a bunch of clippy warnings 2021-11-17 13:01:58 +01:00
Damir Jelić
4f2c91d848 feat(crypto): Add a method to decrypt messages using the recovery key 2021-11-17 13:01:58 +01:00
Damir Jelić
6f5b6900d6 fix(crypto): Flush when we ugprade the DB 2021-11-17 13:01:58 +01:00
Damir Jelić
eddc7bd6af feat(crypto): Add a method to check the signature of a backup version 2021-11-17 13:01:58 +01:00
Damir Jelić
dfef6370b6 feat(crypto): Add a method to verify uploaded backups 2021-11-17 13:01:58 +01:00
Damir Jelić
b5babdb6c4 fix(crypto): Don't load all room keys when backing up 2021-11-17 13:01:58 +01:00
Damir Jelić
df53eb00ab fix(crypto): Fix a deadlock when generating the backup request 2021-11-17 13:01:58 +01:00
Damir Jelić
63915171fc feat(crypto): Add a method to check if backups are enabled 2021-11-17 13:01:58 +01:00
Damir Jelić
4873914d4d feat(crypto): Initial support for server-side backups of room keys 2021-11-17 13:01:44 +01:00
Damir Jelić
f069387d58 docs(sdk): Add an example to the restore_login method 2021-11-15 16:15:05 +01:00
ftilde
8815c05108 Refactor Joined::send_attachment
Instead of manually modifying *EventContent structs, the ruma
constructors *::encrypted and *::plain are used now depending on whether
encryption should be used for the attachment or not.
2021-11-13 01:39:00 +01:00
ftilde
dfc2ed7a33 Prefer MediaType::Encrypted if url and file are present
Some clients (including those using matrix-rust-sdk currently) may add
encrypted file info as well as the url to the encrypted blob to the
*EventContent. Interpreting the presence of an url as an indicator of
unencrypted message (like was done before) would result in access to the
encrypted blob in `get_media_content`.

Fixes #406.
2021-11-13 01:39:00 +01:00
Jonas Platte
38a8253aa8 Turn register_event_handler(_context)? examples into proper doctests
Previously, they didn't actually run the methods they were showing the
use of.
2021-11-12 12:39:07 +01:00
Jonas Platte
5fed5cdeed Allow adding custom event handler context 2021-11-12 12:39:07 +01:00
Jonas Platte
df50d59de2 Update signature of AppService::register_event_handler
It no longer requires a mutable `AppService` and can also be chained,
like `Client::register_event_handler`.
2021-11-11 19:28:40 +01:00
Damir Jelić
1651952903 docs(sdk): Remove a bunch of unwraps from some doc examples 2021-11-11 16:58:43 +01:00
Damir Jelić
33a43af20e improvement(crypto): Use a type for the result of the room key import method 2021-11-11 16:57:31 +01:00
Damir Jelić
6a66a67454 fix(crypto): Fix the importing of exported room keys 2021-11-11 16:05:14 +01:00
Jonas Platte
83b908754e Remove unused dependencies
Found by cargo-udeps.
2021-11-10 21:43:56 +01:00
Jonas Platte
02b0ed2b42 Reduce dependencies on futures-* crates 2021-11-10 20:39:35 +01:00
Jonas Platte
c124cf5b62 Remove unnecessary use of future::ready 2021-11-10 20:39:03 +01:00
Jonas Platte
dfdf794199 Remove unnecessary use of TryFutureExt 2021-11-10 20:12:56 +01:00
Damir Jelić
df2c0bd6e9 docs(sdk): Fix a typo in the enable_encryption method 2021-11-09 19:52:46 +01:00
Damir Jelić
2e04a3753d Merge branch 'one-time-key-generationf-fix' 2021-11-09 13:50:08 +01:00
Damir Jelić
e1e864c606 fix(crypto): Save the account if we created a new key upload request 2021-11-09 12:30:48 +01:00
Damir Jelić
7f3067553b fix(crypto): Don't generate new one-time keys unless the existing ones are uploaded
This is helpful if the caller doesn't have propper request retrying.
Calling the outgoing_requests() method without actually uploading
all the requests would end up generating too many one-time keys and
removing some one-time keys that weren't used yet.

This would manifest itself down the line as undecryptable to-device
messages.
2021-11-09 11:45:20 +01:00
Julian Sparber
253d6c9af8 matrix-qrcode: Use GenericImage and GenericImageView trait
This changes `QrVerificationData::from_luma()` to accept any struct that
implements GenericImage and GenericImageView.
This way we don't force a specific container for the ImageBufffer, hence
the developer doesn't necessarily need to copy the image data into a
Vec<u8>.
2021-11-09 11:33:38 +01:00
Damir Jelić
1f1ae0059e docs: Remove the now unneeded doc cfg attributes 2021-11-09 10:43:42 +01:00
Damir Jelić
05a190ee5a docs(sdk): Add an example that prints out the SAS emojis 2021-11-08 17:17:42 +01:00
Damir Jelić
ed561f7b9e improvement(crypto): Use a struct for the SAS emoji/description pairs 2021-11-08 17:17:14 +01:00
Damir Jelić
fba12b3926 docs(sdk): Explain how room keys work in the encryption module 2021-11-08 15:32:51 +01:00
Damir Jelić
1b2ef50ded docs(sdk): Explain why it may be problematic to manually verify devices 2021-11-08 15:32:51 +01:00
Damir Jelić
c79481c6fa docs(sdk): Clarify what it means for a device to be verified 2021-11-08 15:32:51 +01:00
Damir Jelić
f5b98a62ab docs(sdk): Describe the ways we can restore a client 2021-11-08 15:32:51 +01:00
Damir Jelić
f5a6972feb improvement(crypto): Rename the EncryptionInfo struct for attachments 2021-11-08 15:32:51 +01:00
Damir Jelić
1faaba39c7 docs(sdk): Explain how cross signing helps a bit better 2021-11-08 15:32:51 +01:00
Damir Jelić
e58eb70924 chore: Switch to the 2021 edition 2021-11-08 15:32:51 +01:00
Damir Jelić
4bfc1041cc docs(sdk): Improve an entry in the e2ee failure table 2021-11-08 15:32:51 +01:00
Damir Jelić
b6f7e85964 feat(sdk): Add a method to enable encryption for a room 2021-11-08 15:32:51 +01:00
Damir Jelić
b9b02ff167 docs(sdk): Add another entry to the failure table 2021-11-08 15:32:51 +01:00
Damir Jelić
1aba90cd0b docs(sdk): Consistent headings 2021-11-08 15:32:51 +01:00