The session id is the initiator's group id; remove the client-id-pair hash - #121
Merged
Merged
Conversation
active_session_id() and its SessionId type returned SHA-256(min(a,b)‖max(a,b)) over the two client ids — no seed. That is a participant-pair fingerprint, not a session id: computable from the public ids and identical across every session the pair opens. The real session id is the initiator's randomly-generated group id (fresh per session, and shared: the initiator's send group is the acceptor's receive group), read via send_group_id / receive_group_id. Tests assert this, including that two sessions between the same pair get different ids. Nothing downstream used the accessor (the wrapper never forwarded it, AbstractTwoMLS and the app key on group ids). The stored field is dropped from the live session; its archive slot stays vestigial (byte_vec, written empty, ignored on decode) so a released 0.14 (v2) archive still decodes under the v3 migration — an Option there would break it, since mls-rs-codec prepends a presence byte a v2 blob's byte_vec does not have. Binding contract 31 -> 32; two FFI symbols removed, binding re-synced. No wire (archive stays v3) or error-variant change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 86dff6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
active_session_id()and itsSessionIdtype returnedSHA-256(min(a,b) ‖ max(a,b))over the two client ids, with no seed. That's a participant-pair fingerprint, not a session id: anyone holding the two public client ids can compute it, and it's identical across every session the pair ever opens. Both are removed, finishing what contract 31 began (dropping the freederive_session_id).The real session id is the initiator's randomly-generated group id — fresh per session, unpredictable, and already shared, because the initiator's send group is the acceptor's receive group. Read it with
send_group_id()(initiator) /receive_group_id()(acceptor); both name the same value and it survives archive restore. The tests now assert this, including the property the old hash could never have — two sessions between the same pair get different ids.Nothing downstream breaks (verified against
germDM-ios-refresh@dev-3.0.9, which pins AbstractTwoMLS 0.8.0 / TwoMLSPQ 0.14.0): the vended Swift wrapper never forwarded the accessor, AbstractTwoMLS never references it (keys onreceiveGroupId), and the app derives its id from group ids (listenGroupId/sendGroupId).Archive compatibility. The stored field is dropped from the live session, but its slot stays vestigial in
SessionArchive— abyte_vecwritten empty from v3 on, read and ignored on decode — so a released 0.14 (v2) archive still decodes under the v3 migration. It can't be madeOptionor removed:session_idsits mid-struct, and mls-rs-codec'sOptionprepends a presence byte that a v2 blob'sbyte_vec(a varint length) doesn't have, so decode would misread the length as an out-of-range discriminant and fail. The v2 migration and downgrade-tamper tests confirm real 0.14 blobs still restore.Binding contract 31 → 32 — two FFI symbols removed, vendored binding re-synced. No wire change (archive stays v3), no error-variant change. Book + contract history updated.
🤖 Generated with Claude Code