Repository navigation
fix(#308): ping/pong as plaintext — sidestep pair-handshake asymmetry - #317
Merged
Merged
Conversation
Found via stderr in /tmp/airc-connect-*.log:
[airc:monitor] dropping encrypted msg from <peer>: missing pubkey/privkey for decrypt
Pair handshake stores x25519 pubkeys ASYMMETRICALLY. Continuum had my
pubkey (could encrypt PONG to me); I didn't have theirs (couldn't
decrypt). monitor_formatter dropped the encrypted PONG silently with
that stderr line, auto-pong looked like it never fired, cmd_ping
timed out forever.
For [PING:uuid] / [PONG:uuid] specifically, encryption adds zero
security value — the body is a public uuid with no secret content.
Plaintext sidesteps the asymmetry entirely for control traffic.
Changes:
- cmd_send: new --plaintext flag (skips envelope-layer wrap regardless
of recipient's stored pubkey).
- cmd_ping: routes via #general --plaintext (was just #general).
- monitor_formatter auto-pong: subprocess argv now includes --plaintext.
The bigger pubkey-symmetry bug (peer record A.json missing x25519_pub
after handshake) is filed separately — this fix unblocks the ping
demo loop without depending on that fix.
TDD: test_monitor_formatter.py asserts auto-pong argv contains
--plaintext (regression guard against re-introducing encrypted control
traffic). test_ping_addressed_to_someone_else_does_not_fire_pong +
test_pong_is_suppressed_not_repeated + test_broadcast_ping_does_not_fire_pong
+ test_heartbeat_line_is_swallowed_no_stdout_output cover surrounding
contracts.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Stderr smoking gun:
[airc:monitor] dropping encrypted msg from <peer>: missing pubkey/privkey for decrypt. Pair handshake stored x25519 pubkeys asymmetrically — pong was encrypted, recipient couldn't decrypt, silently dropped, cmd_ping timed out. Force ping/pong plaintext (zero security value in encrypting a public uuid). New--plaintextflag on cmd_send. TDD coverage in test_monitor_formatter.py.