element-hq / element-hq/element-x-ios

E2EE Keys shared on being invited to a room are ignored.

Open
#1,842 2 comments 0 reactions 0 assignees View on GitHub
O-Occasional S-Critical T-Enhancement X-Needs-Rust
Dominant language
Swift
Stars
945
Forks
372
Avg merge
21h 42m
Merged PRs (30d)
67

Description

### Steps to reproduce

1. Invite a user on EX to a room from EW
2. EW shares the keys to them they need to decrypt the history
3. EX promptly ignores those keys with errors like:

`2023-10-01T23:58:41.991407Z WARN matrix_sdk_crypto::gossiping::machine: Received a forwarded room key that we didn't request sender_key="curve25519:dDzGIsdDzjt2uWgLDg0U05v2s0NAdjiqYpYjryPa7To" room_id="!kCCQTCfnABLKGGvQjo:matrix.org" session_id="gPbOMSzHA67qrteCF3gi3/6VfWgcqSLgpF+N9aFZKqU" sender_key="curve25519:dDzGIsdDzjt2uWgLDg0U05v2s0NAdjiqYpYjryPa7To" algorithm="m.megolm.v1.aes-sha2" | crates/matrix-sdk-crypto/src/gossiping/machine.rs:978 | spans: root > sync_stream{conn_id="encryption" with_e2ee=true} > sync_once{pos="141"} > handle_response > preprocess_to_device_events > receive_sync_changes > receive_to_device_event{sender="@matthew:matrix.org" event_type="m.room.encrypted" message_id="98b4e05a-9cc4-440e-96d5-5c99a2fe1d67"} > handle_decrypted_to_device_event{sender_key="curve25519:dDzGIsdDzjt2uWgLDg0U05v2s0NAdjiqYpYjryPa7To" event_type="m.forwarded_room_key"}`

### Outcome

#### What did you expect?

Users should be able to read history when invited to a room.

#### What happened instead?

Undecryptable history, UISIs everywhere.

N.B. this is not the same as https://github.com/vector-im/element-x-ios/issues/1496 - where EX fails to send keys; here the problem is EX ignoring keys.

### Your phone model

_No response_

### Operating system version

_No response_

### Application version

396

### Homeserver

_No response_

### Will you send logs?

Yes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.