mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-09 08:14:42 +00:00
7bc5b21c3ab5a541cdb0b41ea8e2e82f2d21c030
When both nodes simultaneously initiate connections, each promotes its inbound handshake first, leaving both sides with mismatched Noise sessions and session indices. Resolve this in handle_msg2 using the existing tie-breaker (smaller node_addr's outbound wins): - Winner (smaller node): swaps ActivePeer to outbound session + indices via new replace_session() method - Loser (larger node): keeps inbound session and original their_index (already references winner's outbound our_index from msg1) Key insight: the loser must NOT update their_index from msg2, because the msg2 sender_idx carries the winner's inbound index which becomes stale after the winner swaps. Defer outbound connection cleanup from promote_connection() to handle_msg2() so outbound session state is available for the swap. Verified with live two-node test over UDP in network namespaces: both nodes connect, exchange TreeAnnounce, and converge to spanning tree within ~2s.
FIPS Documentation
| Directory | Description |
|---|---|
| design/ | Protocol design specifications and analysis |
Languages
Rust
83.6%
Shell
11.7%
Python
4.2%
PowerShell
0.2%
Makefile
0.1%