Secure connection with noise encrypted traffic#46
Conversation
|
Read through the diff carefully. The direction looks right and the implementation is careful: Note: this is a read-only review — I did not get a Blocking1. The handshake now runs in its own if sockets.lock().await.len() >= max_sockets as usize {is almost always false at accept time, because the pool is still empty while the handshakes are in progress. So anyone who knows a tunnel's port can open thousands of connections and hold a file descriptor plus snow state for up to A 2. Trusting the server key means trusting the API channel
So the guarantee is real against a passive observer on the tunnel port, but not against an active attacker, and the README currently says "all tunnel connections between client and server are encrypted" without that qualifier. At minimum this deserves an explicit note that the API must be served over TLS for the handshake to mean anything. Better would be an option to supply the server's public key out of band (a 3. The session token isn't bound to whoever registered the subdomain
The doc comment on Worth considering4. The keypair is generated per process ( Every restart invalidates every live tunnel's pinned key. Clients do recover through re-registration, but the handshake-failure path sleeps 10s per attempt and has to wait out 5. The server always writes 6. A rejection is indistinguishable from a network drop A wrong token gets a silent close, so the client loops on 7. If the server ever fails to close the garbage connection, the 8. It is a TOCTOU: the port is released and re-bound later on another thread. Two tests in the same binary can collide, and the server thread Nits
Interaction with #47Both PRs rewrite |
Fix #33