fix(trust): also pin() master keys before user-signing — clears pin violations #8
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!8
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?
Maximus@rpi5 found this directly in his crypto store: even after our PR #7
patch ran apply_trust_policy → identity.verify() → /keys/signatures/upload
landed cleanly, his outbound Megolm sessions STILL excluded the felinus
recipient. The reason: matrix-sdk-crypto's local
pinned_master_keyforfelinus didn't include our user-signing signature, while
master_keydid. That mismatch is treated as a "pin violation" — matrix-sdk-crypto
refuses to share Megolm session keys with a user whose master key has
"changed" since the first time we saw them.
When does this happen? When a user runs
bootstrap_cross_signingAFTERthe peer bridge has already done a sync that observed their
device-only-no-master-key identity. The peer's local store pinned that
earlier identity. Now the bootstrap creates a master key — from the
peer's perspective the identity has rotated. Pin violation. Outbound
encrypt skips them.
Fix: in apply_trust_policy, BEFORE verify(), call identity.pin() to
explicitly accept the current master key as the pinned identity. This
clears the violation. Then verify() does the cross-user user-signing
upload as before.
Both bridges need this patch deployed so each accepts the other's
post-bootstrap master key. Without it, peer encrypt-share decisions
silently exclude us forever even though the cryptographic trust chain
on the homeserver looks correct.
Empirical chain that revealed this:
STILL excluded G9MCQri1N2 from recipient sets. Direct probe showed
/keys/signatures/upload had landed cleanly server-side, but rpi5's
local pinned_master_key for felinus stayed un-updated. THIS commit
fixes that.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com