Skip to content

Clarify historical key sharing#2410

Open
HarHarLinks wants to merge 8 commits into
matrix-org:mainfrom
HarHarLinks:patch-9
Open

Clarify historical key sharing#2410
HarHarLinks wants to merge 8 commits into
matrix-org:mainfrom
HarHarLinks:patch-9

Conversation

@HarHarLinks

@HarHarLinks HarHarLinks commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

See https://github.com/matrix-org/matrix-spec/pull/2399/files#r3560365639

We understand there is an introductory paragraph to the use case, but we think it is setting the rest of the section up for confusion given

  • that there is no clear requirement level for historical key sharing in general stated (only different aspects about how to create the key bundles etc)
  • how fuzzy the spec is in general towards proper RFC 2119 usage.

Our reading of the spec is that for some reason there is an exemption for rooms that are currently not using shareable history, but by default ("otherwise") shareable keys hence may not not [sic!] be shared, i.e. MUST be shared. We think stating that outright clarifies this requirement a lot.

Further the way the exemption was defined was hard to grasp for a group of us, hence an attempt of a slightly more verbose approach.

Finally the error codes for withholding keys were missing a reference to when to choose which one.

Pull Request Checklist

Preview: https://pr2410--matrix-spec-previews.netlify.app

@HarHarLinks HarHarLinks mentioned this pull request Jul 10, 2026
3 tasks
@HarHarLinks

HarHarLinks commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author
  • normative text explaining m.blacklisted, m.unverified, m.unauthorised, m.unavailable, m.no_olm, m.history_not_shared
  • rework the paragraph "Alice’s client MAY choose not to share ..."

Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
@HarHarLinks
HarHarLinks marked this pull request as ready for review July 14, 2026 11:27
@HarHarLinks
HarHarLinks requested review from a team and zecakeh as code owners July 14, 2026 11:27
Comment thread content/client-server-api/modules/end_to_end_encryption.md Outdated
Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
@HarHarLinks
HarHarLinks requested a review from richvdh July 15, 2026 17:46
Comment on lines +1613 to +1615
Marking keys as [shareable](#shareable-encryption-sessions) essentially serves as
precomputation of which keys Bob needs to decrypt all messages he can see, as
defined by the room's history visibility.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure this is a helpful way of thinking about things? When Charlie sends a message in a room and marks it as shareable, he may not even know who Bob is, and no computation seems to be required. I really don't think that Charlie is "precomputing" anything?

[Also, it's a long time since Bob was mentioned, so we need to reintroduce him here. Admittedly that's a problem to some extent with the existing text, but at least we have Alice inviting Bob in the next paragraph at the moment.]

I suggest removing this paragraph.

Comment thread content/client-server-api/modules/end_to_end_encryption.md Outdated
Comment thread content/client-server-api/modules/end_to_end_encryption.md Outdated
Comment thread content/client-server-api/modules/end_to_end_encryption.md Outdated
@HarHarLinks

Copy link
Copy Markdown
Contributor Author

Only room keys which were marked as "shareable" by the creator of the
encryption session should be shared with new users.

Would you agree this should instead say

 Only room keys which were marked as "shareable" by the creator of the 
 encryption session MUST be shared with new users. 

(or less normative must)

given that further down defines

containing the sessions she is aware of in the room. Alice MUST include
only [shareable encryption sessions](#shareable-encryption-sessions) in the

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@richvdh

richvdh commented Jul 20, 2026

Copy link
Copy Markdown
Member

Only room keys which were marked as "shareable" by the creator of the encryption session MUST be shared with new users.

That materially changes the emphasis: it implies that keys not marked as shareable can (and indeed probably should) be shared, which is obviously not what we mean.

If you wanted to strengthen this, it would need to say:

Room keys which were not marked as "shareable" by the creator of the 
encryption session MUST NOT be shared with new users. 

... however, that's an odd thing to say before describing sharing keys in general.

I think the current text is adequate, given (as you note) it's described more formally later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants