REALITY.5d: serve the hand-rolled flight on the relay's authed path (last of REALITY.5) #87
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/yip!87
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/reality-5d-wire-server-flight"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
REALITY.5d — wire the hand-rolled server flight into the relay
Stacked on #86 (REALITY.5c). Base is
feat/reality-5c-server-flight-emit; review the 5d delta here, merge after #86. PR 4 of 4 — the LAST of REALITY.5 (#76), and the last anti-DPI item.The relay's authed REALITY path now serves the dest-faithful hand-rolled flight it can build (5b ServerHello + 5c encrypted flight), replacing the BoringSSL
SslAcceptor. After this, an authed connection to the relay is byte/length-indistinguishable from a genuine Chrome↔destTLS 1.3 session end to end — closing the passive-DPI gap REALITY.3 explicitly left open for the authed path.What's here (all
yip-rendezvous)ClientHelloInfo.key_share_mlkem_x25519: the x25519 bundled in the client's group-4588 key_share entry (mlkem_ek(1184) ‖ x25519(32)), fail-closed. The authed path keys the 4588 hybrid DH against this (and the standalone0x001dshare for group 29) — correct-by-construction, not relying on the client reusing one ephemeral.handle_connection+read_and_classify+into_decoy+run_tunnelnow flow anyAsyncRead+AsyncWrite+Unpin+Sendstream, so ayip_utls::RealityStreamruns through the same relay logic as anSslStream(the non-REALITY relay-Trojan path is unchanged).run_reality_conn'sDecision::Accept): look up the captured template + fields for the SNI → forge the leaf (forge_leaf, SPKI =derive_cert_key(shared), natural size) →emit_server_hello(5b) and write it →servethe 5c flight underHANDSHAKE_TIMEOUT→ pump the tunnel. The deadbuild_forged_acceptor*/CacheEntry.acceptor/RealityCertCache.keyare removed.The splice-vs-drop fail-safe boundary
Splicing forwards a pristine connection to the real
dest(a prober sees a genuine site) — but only works before we've written our own bytes. So: every failure before the ServerHello write (no template, unsupported group, missing client share, forge/emit error, OS-rng failure) → splice; every failure after (serve error/timeout/IO) → drop (the client's 4b fallback covers it). The final review traced every early-return and confirmed the boundary holds in both directions.Design decisions
forge_leafdrops, so a forged flight is reliably smaller than dest's and fits the captured record budget.FlightTooLarge→ splice is the fail-safe if it ever doesn't.servebounded byHANDSHAKE_TIMEOUT(its CCS-drain is otherwise unbounded); anti-replay unchanged, runs before the branch.The gate — a live end-to-end money test
bin/yipd/tests/run-netns-reality-5d.sh(ran under sudo, PASS): a real yipd client dialingreality://…&verify=ontunnels A→B through the relay whose authed path hand-rolls the flight — relay-forwarded=2106 packets (that counter is reachable only via the authed tunnel path, so >0 proves the 5b+5c+5d handshake completed and the 4b binding verified). A wrong-key client fails closed (0 packets, no retry-storm). The dest is a localopenssl s_server -tls1_3(hermetic). Wired into CI.Scope / non-goals
boringdep (the relay-Trojan front +extract_fieldsstill use it).yip_utlsis untouched.Follow-ups (non-blocking, from the final review)
Error::MessageTooLarge, u24-helper extraction).Final whole-branch review (opus): READY WITH FOLLOW-UPS — splice-vs-drop correct in both directions, no fail-open / no panic-on-input / no dangling reference,
yip_utlsuntouched,forbid-unsafe/ noas/ no bare#[allow].With this, REALITY.5 (5a/5b/5c/5d) is complete — the authed REALITY path is end-to-end dest-faithful.