mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-11-27 00:04:34 +00:00
50e3a3aa06e61bfee4f8109e1d1cd8245bd2a7d7
A server past its hello budget dropped the hello, so a flood of forged hellos kept every new socket from its welcome until it fell back to plaintext. The server now answers such a hello with a cookie, a MAC of the client's address, and takes the same hello again with the cookie attached, which proves the address can receive: WireGuard's cookie reply under load and QUIC's Retry (RFC 9000 8.1.2). The reply echoes part of the hello's enc, so only one who saw the hello can forge it, and it is shorter than any hello. The client keeps the cookie for two minutes and attaches it to its hellos; the cookie is bound to the address, not the socket, as QUIC's tokens are, so a one-off socket may carry it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
Languages
Rust
100%