Commit Graph

2142 Commits

Author SHA1 Message Date
Denis Kasak 1c36e62e2c fix: Unbreak encryption.
And add some docs and logging statements.

cb8a42a529 broke encryption because it
elided the call to `send_raw` from `send` and instead did a direct HTTP
request. Since event encryption is only called from `send_raw`, this
made all events cleartext.
2021-10-14 10:22:25 +02:00
Julian Sparber 0a92f7161a client: make sync_stream() return an infallible stream
This way the developer can decide what to do on an error
2021-10-11 18:33:06 +02:00
Damir Jelić 8af768bf30 chore(base): Remove the non-exhaustive patterns lint
The lint is only available on nightly, but requires to be enabled via a
feature, which is only available for nightly.
2021-10-11 11:06:32 +02:00
Damir Jelić 61375a6245 chore: Add a github action to check for typos 2021-10-11 09:49:27 +02:00
Damir Jelić 3c08b5cf09 chore: Fix a bunch of typos 2021-10-11 09:49:25 +02:00
Damir Jelić 498d7b4666 Merge branch 'dkasak/doc-improvements' 2021-10-11 09:47:21 +02:00
Damir Jelić 7cfa9dbf58 Merge branch 'dkasak/key-sharing-algorithm-rendering' 2021-10-11 09:46:43 +02:00
Damir Jelić 5aa6aeac16 Merge branch 'flow_id' 2021-10-05 20:47:33 +02:00
Jonas Platte b6261d014c Add custom event examples for Joined::{send,send_state_event} 2021-10-05 18:42:21 +02:00
Jonas Platte 8455164a69 Simplify command_bot example 2021-10-05 18:20:07 +02:00
Jonas Platte b959d4be29 Use new event type aliases 2021-10-05 18:20:07 +02:00
Jonas Platte 39d6ebdd53 Don't panic if serialization of user-provided events fails 2021-10-05 18:20:07 +02:00
Jonas Platte 0f52cd8039 Stop relying on enum deserialization for adding room_id 2021-10-05 18:20:07 +02:00
Jonas Platte 4a50561867 crypto: Simplify Account::parse_decrypted_to_device_event 2021-10-05 18:20:07 +02:00
Jonas Platte cb8a42a529 Upgrade to latest Ruma git main 2021-10-05 18:20:07 +02:00
Jonas Platte d16d21c54f crypto: Refactor ToDeviceRequest construction 2021-10-05 18:20:07 +02:00
Jonas Platte 339dfefb53 Replace qualified path with use (style consistency) 2021-10-05 18:20:07 +02:00
Jonas Platte b8e8cfd149 Fix clippy warnings 2021-10-05 18:20:07 +02:00
Jonas Platte a40cf26aa7 Fix formatting 2021-10-05 17:40:50 +02:00
Damir Jelić fe8ecbbeb8 Merge branch 'fix_lock_on_await' 2021-10-05 10:36:02 +02:00
Damir Jelić 2686e987a6 Merge branch 'dkasak/share-all-indices-with-own-trusted-devices' 2021-10-05 10:13:49 +02:00
Julian Sparber a3f078cb96 encryption: Expose FlowId on VerificationRequest
Fixes: https://github.com/matrix-org/matrix-rust-sdk/issues/367
2021-10-04 22:42:39 +02:00
Julian Sparber 82659142c5 crypto: Fix VerificationRequest::generate_qr_code()
We can't keep a lock on the `inner` therefore clone it. It's not pretty
but we do the same in `start_sas()`.
2021-10-04 17:04:09 +02:00
Denis Kasak 3c03c64778 docs(crypto): Reword.
- Bring the wording in line with the wording on the matrix_sdk crate.
- Style fixes.
- Formatting.
2021-10-04 14:53:30 +02:00
Denis Kasak fdbed7fbf8 docs(crypto): Add room key sharing decision tree to the docs. 2021-10-04 14:48:12 +02:00
Denis Kasak 759bc76f04 docs: More typo/style fixes. 2021-10-04 14:36:37 +02:00
Denis Kasak ab1657b811 docs: Flesh out intro section a bit.
- Mention subcrates.
- Point out `Client` as the central component.
2021-10-04 14:34:18 +02:00
Denis Kasak b219a347f6 Reword opening paragraph. 2021-10-04 13:15:22 +02:00
Denis Kasak bd82738630 Fix typo. 2021-10-04 13:06:50 +02:00
Amanda Graven 9829b45ce8 Specifiy edition in rustfmt.toml 2021-10-04 12:56:49 +02:00
Denis Kasak f2c0abeb58 Add decision tree rendering of the algorithm. 2021-10-04 12:51:16 +02:00
Denis Kasak 55731922e8 Add decision tree model of the key sharing algorithm.
And a tool to render it.

Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2021-10-04 12:49:16 +02:00
Denis Kasak 671efb2313 Await result. 2021-10-04 11:13:02 +02:00
Denis Kasak da052ed9aa clippy fix 2021-10-04 11:12:46 +02:00
Denis Kasak 49e722ffbf cargo fmt 2021-10-04 10:57:11 +02:00
Denis Kasak de2e2539b7 Write a test.
Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2021-10-04 10:51:31 +02:00
Denis Kasak 5f87ccdcd9 Explain return value in the docstring.
Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2021-10-04 10:51:31 +02:00
Denis Kasak bf2195b999 crypto: Share all indices with own trusted devices.
This fixes an edge case in the key sharing decision algorithm in which
your own trusted devices could be getting a limited session upon a
reshare. It also simplifies the algorithm a bit by bringing the check
for an own and trusted device to the start.

If the requesting device is a trusted/verified device of our own, we
share the session in full, regardless of whether we've previously shared
with that device and at which index. Otherwise, we do the "have we
shared previously" check via the outbound session and only share from
the index it was originally shared at, as before.

Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2021-10-04 10:45:25 +02:00
Damir Jelić 3042209cf6 crypto: Check that the event was encrypted for the right room 2021-09-21 17:27:31 +02:00
Damir Jelić 87728268e2 crypto: Don't borrow the plaintext to later clone it 2021-09-21 16:48:42 +02:00
Jonas Platte bbbd5648e0 Fix comment typos 2021-09-21 15:36:04 +02:00
Jonas Platte b813735dd2 Remove unused dev-dependency 2021-09-21 15:24:55 +02:00
Jonas Platte 871a245702 crypto: Avoid unnecessary event serialization 2021-09-21 15:20:02 +02:00
Jonas Platte f783fb9830 Fix typo: Missmatched => Mismatched 2021-09-21 15:19:21 +02:00
Damir Jelić fa5aea2ca1 Merge branch 'fix-anyhow-feature' 2021-09-21 14:54:40 +02:00
Jonas Platte 2128d0bfcc CI: Use Nightly Clippy 2021-09-21 13:12:46 +02:00
Jonas Platte 42061c9bf5 CI: Run clippy on more (Cargo) targets 2021-09-21 13:12:34 +02:00
Jonas Platte d0851c8a9e Fix new (Nightly) Clippy warnings 2021-09-21 13:11:53 +02:00
Jonas Platte 0817bc490e Add missing required-features for examples 2021-09-21 13:11:31 +02:00
Jonas Platte 3621b62418 Fix Client::register future not being Send under warp feature
Caused by https://github.com/tokio-rs/tracing/issues/1487.
2021-09-21 13:07:40 +02:00