[ER-59] E2EE: Send media keys via to_device message #1281
Labels
EPIC
T-Enhancement
New features, changes in functionality, performance boosts, user-facing improvements
Add to-device key distribution
In addition to sending media keys as events to the room, send them via to_device events encrypted with Olm as a primary way of sending the keys, then keep the room events as backup. Add a posthog event to track when the keys don't arrive via to_device. This will allow us to migrate away from using room events in the long term as they cause the media key to be saved in the room history.
Prerequisits:
Production ready requirements
Tasks
Iterations: are based on Temp: see: https://excalidraw.com/#room=b7556403b8947d5ee7ac,duF48bj2SbmRTsa3ivmLFA
Iteration 1: "change transport" and "make it backwards compatible"
Use hughs work as reference
MatrixRTC: Introduce key transport abstraction as prep work for to-device encryption matrix-org/matrix-js-sdk#4773
use the to-device messages instead of the room event. #3155
add benchmarking (might be another PR)Not part of Iteration 1, see iteration 2sendAndEncryptToDevice
message for embedded and stand aloneAdd option to enable to-device-encryption #3167
Discuss how we do the transition with backwards compatibility
toDeviceAndRoomKeyTransport
matrix-org/matrix-js-sdk#4792RoomAndToDeviceKeyTransport
#3185Iteration 2: "to device message format"
Iteration 3: "encryption error cases and security"
sendQueue
) matrix-org/matrix-js-sdk#4793 Allow the js-sdk to return errors if todevice sending failed.Other Parallelize tasks (optional)
Expose encryption information (
DecryptionInfo
) of to device messages. This is needed to let the widget know if a to-device message can be trusted. Is save in terms of: signed, not leaked to the HS in plaintext ... (maybe there is workaround)Refactor the
EncryptionManager
MatrixRTC: Refactor | Introduce a new Encryption manager (used with experimental to device transport) matrix-org/matrix-js-sdk#4799getChild
) toLogSpans
matrix-org/matrix-js-sdk#4807BasicEncryptionManager
andEncryptionManager
) @BillCarsonFrBasicEncryptionManger
intoNewEncryptionManager
(maybe?)Playwright key sharing tests
Prototype:
The text was updated successfully, but these errors were encountered: