Page MenuHomePhorge

Send only relevant ciphertext to each device when sharing room keys
ClosedPublic

Authored by tusooa on May 11 2024, 4:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 5, 7:34 PM
Unknown Object (File)
Thu, Sep 5, 11:05 AM
Unknown Object (File)
Thu, Sep 5, 7:44 AM
Unknown Object (File)
Sat, Aug 31, 8:26 AM
Unknown Object (File)
Thu, Aug 29, 1:53 AM
Unknown Object (File)
Mon, Aug 26, 11:26 PM
Unknown Object (File)
Mon, Aug 26, 10:50 PM
Unknown Object (File)
Mon, Aug 26, 9:28 PM
Subscribers
None

Details

Summary

This commit changes the key sharing workflow so that we only send to some device the ciphertext for that specific device. This means a device will now only receive room keys encrypted for it, and no longer receive ciphertext for other devices.

Some clients, like Element Android or Element iOS, only checks the first kv-pair of the ciphertext map in an olm-encrypted event. This fixes the problem where these clients cannot properly parse our room key events.

Type: add

BUG: https://iron.lily-is.land/T45

Test Plan

Verify unit tests pass.

Build kazv against libkazv at this commit.
Run kazv and rotate the megolm session of some room (by going into an encrypted room, going to some user's UserPage, and changing the trust level of one of their devices from Unseen to Blocked then back to Unseen).
Send a message to that room.
Verify, from an Element Android client, that you can receive that message and no white shield ("The authenticity of this message cannot be verified on this device" indicator) appears.

Diff Detail

Repository
rL libkazv
Lint
Lint Not Applicable
Unit
Tests Not Applicable