Repository navigation
audit: enforce declared size, pin PQ curve, gate relay-status, drop dead code - #36
Merged
Merged
Conversation
…ead code
Follow-up to the production-readiness audit. Each change is empirically
verified (race suite, golangci-lint, deadcode -test all green).
- transfer: enforce the sender's declared FileInfo.Size in the receive
loop. A PAKE-authenticated but misbehaving sender could advertise a
small size yet stream unbounded chunks (the root-hash check only runs
after the loop), exhausting the receiver's disk. Streaming items are
exempt by design.
- quicconn: pin CurvePreferences to {X25519MLKEM768, X25519} explicitly
instead of relying on Go's default ordering, so a toolchain default
change or GODEBUG=tlsmlkem=0 can't silently downgrade the advertised
post-quantum exchange. New TestNegotiatesPostQuantum asserts two peers
land on the hybrid on the wire.
- server: bearer-gate /v1/relay/status with the session role token,
matching /v1/relay/allocate. A third party who only sniffed the
session_id could previously probe eviction state; missing session and
unauthorized caller now both return "unknown" (no existence oracle).
- cli: reject `--connect default,<pw>` (stray password was silently
dropped) and add --exclude/--mode to the --connect conflict list.
- dead code: remove three production methods with no production caller
(connpath.Info.Glyph — logic was duplicated inline in printPath;
signaling.Client.Health — Docker probe uses a raw http.Get;
quicconn.Listener.LocalAddr) and their now-redundant tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Follow-up to a senior production-readiness audit of the project. Each change is empirically verified — the full
-racesuite,golangci-lint, anddeadcode -testare all green.Findings addressed
FileInfo.SizebytesWritten + len > info.Sizefor non-streaming files; streaming items (stdin/--text) stay exempt by design.connpath.Info.Glyph(its logic was duplicated inline inprintPath),signaling.Client.Health(the Docker probe uses a rawhttp.Get), andquicconn.Listener.LocalAddr, plus their now-redundant tests.--connect default,<pw>silently dropped the passwordE024 — --connect default takes no password.--connectconflict list omitted--excludeexcludeandmode(both transfer-only) to the conflict list.CurvePreferences = {X25519MLKEM768, X25519}explicitly in both TLS configs so a toolchain default change orGODEBUG=tlsmlkem=0can't silently downgrade the advertised PQ exchange. NewTestNegotiatesPostQuantumasserts two peers land on the hybrid on the wire./v1/relay/statuslacked per-session auth/v1/relay/allocate. A third party who only sniffed thesession_idcould previously probe eviction state; missing-session and unauthorized callers now both return"unknown"(no existence oracle).Verification
go build/go vet— cleango test -race -count=1 ./...— all 18 packages pass, 0 races (incl. the 40s e2e suite)golangci-lint run— 0 issuesdeadcode -test ./...— clean (the CI gate)--connect host,pw/--connect defaultstill workNotes
Health()forCreate()in two transport-error tests madeinternal/signalinghang under-race(a POST-with-body teardown left the test's hanging server handler alive, blockinghttptest.Close). Switched those to the bodylessRelayStatusGET.🤖 Generated with Claude Code