mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-09 08:14:42 +00:00
Cut the net-new inbound handshake (a fresh msg1 that promotes to a new peer, plus the at-capacity reject) over from the inline handle_msg1 logic to the per-peer control machine. handle_msg1 still classifies via establish_inbound and still owns the Noise wire step, the late ACL check, and the promote_connection registry surgery; for the net-new path it now builds the machine, steps it, and executes the returned actions. Authorization is interposed between two machine steps so the session index is allocated only after the ACL check passes: a rejected or unauthorized msg1 consumes no index, matching the prior order exactly. The msg2 wire bytes, the index-allocation sequence, and the reject metrics are all byte-neutral. Restart, resend, rekey-respond, and the other reject arms stay inline unchanged; they move to the machine once outbound establish is cut over and every promoted peer has a machine. Also fills in the executor's send-failure and promote-failure cleanup so a mid-establish error tears the leg down and frees its index exactly as before.