-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document chain_index in the m.room_key content #1249
Comments
part of #501 |
Tried to track this one down and I can find where it is added to the event in the JS SDK code, but not where it is used. Also, I think it was added in a pretty old commit matrix-org/matrix-js-sdk@89d8133#diff-024555cb57c92e1a32d639aab9f8cde3R451. Could it be just a legacy field? |
Have just tried to remember what is going on here, and:
yes, it is. Background: the megolm ratchet key increments with each message, and each message has an index which tells you how far you need to advance the ratchet, in case you miss any messages. When you receive a new ratchet key, it's possible that it is not starting at index 0, so you need to know the index it does start at. This is the However, the chain_index is now included in the serialised format of the ratchet key, so there is no need for it to be sent out of band. (The relevant change to the olm library is https://git.matrix.org/git/olm/commit/?id=e0b5197). When we made this change, we kept sending the chain_index out of band for older clients. It should probably now be removed from the js-sdk; either way, there is no need for it to be sent by new clients. |
Thanks for the explanation! Shouldn't this be closed then? |
probably! |
This field has been deprecated for quite a while and is not used anymore by Matrix clients. The Olm message index is instead embedded in the serialized ratchet key format (since https://gitlab.matrix.org/matrix-org/olm/-/commit/e0b5197). Also see matrix-org/matrix-spec-proposals#1249 (comment).
Example of an
m.room_key
event received in theto_device
messages. This the decrypted value of thebody
parameter of am.room.encrypted
event with algorithmm.olm.v1.curve25519-aes-sha2
.The text was updated successfully, but these errors were encountered: