2 Commits
Author SHA1 Message Date
lucioandClaude Opus 5 1445d546a1 polish P1: carry the cipher scheme through the channels, diagnose a mismatch
ChannelConfig and BulkConfig carry MacCipherScheme; a change to it reopens
every connection the way a key change does. PeerConnection reads the
scheme's preamble length (16 legacy, 48 modern) instead of a hard-coded 48.

The diagnostic: the peer's opening bytes are kept until one packet has
framed. If the first packet fails framing under the configured scheme and
the same raw bytes frame under the other one, the connection closes with
.invalidKey(.cipherSchemeMismatch) and reports status
.cipherSchemeMismatch, so the menu names the setting to change rather than
blaming the security key. Costs one AES setup on a connection that was
going to fail anyway, and nothing at all on success.

The bulk channel needs no diagnostic: a transfer only starts with a peer
whose control connection already framed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-16 21:08:19 -07:00
lucioandClaude Opus 5 2276c20792 clipboard: bulk channel on the TCP port, pull/push/accept
Listener and dials ported from SocketStuff.cs:475-495, 1566-1666 and
Clipboard.cs:401-485, 1068-1099; the transfer from Clipboard.ShakeHand
(961-1066), ReceiveAndProcessClipboardDataCore (498-923) and
SocketStuff.SendClipboardData/SendFileEx/SendData (1673-1931).

The 64-byte DATA on this connection is raw, not framed (docs/protocol.md
§10.7 (a)): bytes 1..3 must be zero and are checked.

Verified on loopback in the scratchpad: pull of text, push of a file,
a 3 MB image across chunks, and an unauthorised peer refused.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-16 04:45:36 -07:00