From 8a14a9fbdf155e22d8db23fcd9860681cd593e77 Mon Sep 17 00:00:00 2001 From: Mark Mennell Date: Tue, 11 Aug 2026 09:46:31 +1000 Subject: [PATCH] Terminate on unsupported challenge version instead of sending code 2 A challenger's next read after sending CHALLENGE is exactly the 32-byte CHALLENGE-RESPONSE hash, so a response code written into that stream is indistinguishable from the start of a hash. Close without responding (SPEC SS10.5); code 2 remains for unsupported MESSAGE versions, where the peer's first read is always a response code. Co-Authored-By: Claude Fable 5 --- cmd/fmsgd/host.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/fmsgd/host.go b/cmd/fmsgd/host.go index 63825fc..f582886 100644 --- a/cmd/fmsgd/host.go +++ b/cmd/fmsgd/host.go @@ -693,9 +693,9 @@ func readVersionOrChallenge(c net.Conn, r *bufio.Reader, h *FMsgHeader) (bool, e if challengeVersion == 1 { return true, handleChallenge(c, r) } - if err := sendCode(c, RejectCodeUnsupportedVersion); err != nil { - log.Printf("WARN: failed to send unsupported version response: %s", err) - } + // TERMINATE without responding (SPEC §10.3/§10.5): the challenger's + // next read is exactly the 32-byte CHALLENGE-RESPONSE hash, so a + // response code here would be indistinguishable from hash bytes. return false, fmt.Errorf("unsupported challenge version: %d", challengeVersion) } if v != 1 {