fix(trust): also user-sign other users' master keys in apply_trust_policy #7
No reviewers
Labels
No labels
agent:felinus
agent:human
agent:maximus
priority:p0
priority:p1
priority:p2
priority:p3
status:blocked
status:needs-review
status:wip
type:chore
type:docs
type:feat
type:fix
type:perf
type:refactor
type:test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jmz/matrix-bridge!7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "kitty/sync-wedge-resilience-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
matrix-sdk-crypto's outbound Megolm-key-share gate requires that the
sender has user-signed the recipient's cross-signing master key —
device-level local verification alone is not enough. Without this,
two bridges can have:
calling
device.verify()),automatic-room-key-forwardingfeature enabled,…and Megolm session keys still won't flow between them. Empirically
verified across both bridge instances on 2026-05-02: even after
bootstrapping cross-signing for both
@claudius-felinusand@claudius-maximus, post-bootstrap test messages from one bot to theother still arrived as UnableToDecrypt.
Fix: in
apply_trust_policy(Tofu/All branch), for every other roommember, in addition to the existing
device.verify()loop, also callUserIdentity::verify()once on the user's identity if it'sunverified.
UserIdentity::verify()performs the user-signing —generates a signature with our user-signing key against the other
user's master key, uploads it via
/keys/signatures/upload. Afterboth sides do this on next sync, matrix-sdk-crypto's outbound-share
check sees mutual user-signing and lets the Megolm session key flow.
Operational caveat: this fix must be deployed on BOTH bridges
participating in the room. One-sided user-signing only establishes
trust in one direction. The setup-once cost: a single sync cycle
after deploy.
Defensive: no-ops if the other user has no cross-signing identity
yet (e.g. they haven't run
bootstrap-cross-signing), and no-ops ifwe've already user-signed them (matrix-sdk-crypto's
is_verified()check). All errors are logged at warn level and skipped — one bad
identity can't break the whole policy run.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com