Repository navigation
fix(lan): pairing ignores a key's stored name; sharing restarts on a new key - #260
Merged
Merged
Conversation
…n a new key Adding a PC failed in both directions with "closed before the code step" on one side and "unexpected add-reply at connecting" on the other. Two causes, both reproduced by e2e tests that failed first: - A key made before names were capped at 40 (#124) still carries its longer name. Pairing sent the stored key as it was, and every receiver ran the import check, which refuses names over 40. Pairing saves a key under the name the user clicked, so its own name is never read: it now sends keys without one (parseKeyText still accepts that, so v0.19.3 receivers do too) and reads keys while ignoring it. .diffbrokey import keeps the 40 rule. - Sharing captured the identity at startup. After a key reset it kept announcing and pairing with the old key, and would have signed Stop sharing notices with a retired key, which may only decrypt. Writing the identity now notifies a listener, and sharing restarts when the fingerprint changed. The trust refresh timer no longer piles up across restarts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJaGuL4V5ghYxXSGoyYU8n
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.
Fixes "Connection lost" when adding a PC, found from the logs on both machines:
add f84018a8: closed before the code stepunexpected add-reply at connectingThe connection itself worked. Each side was rejecting the other's key.
1. Long key names (from before #124). The Mac's key dated from before key names were capped at 40 characters, and carried an 80-character name. Pairing sent the stored key as it was, and every receiver ran the import check, which refuses names over 40.
.diffbrokeyimport keeps the 40-character rule from improvement(keys): require a key name of at most 40, focus it, and keep contact names distinct #124.2. A key reset didn't reach network sharing. Sharing captured the identity once, at startup. After a reset it kept announcing and pairing with the old key, which is why resetting both keys changed nothing. It would also have signed Stop sharing notices with a retired key, which may only decrypt.
identityEvents.js), and sharing restarts when the fingerprint changed.Tests, each seen failing first:
Another testing gap this exposed: e2e only ever used brand-new keys, so data created under older rules was never exercised. The first test now covers the case that bit here.
Verified:
npm run checkpasses.make e2e: 799 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01PJaGuL4V5ghYxXSGoyYU8n