pub fn accept_connect(
connect: &[u8],
s: &StationSession,
) -> (Result<Client, HandshakeError>, Vec<u8>)Expand description
Checks a CONNECT, and returns the verdict with the HELLO to send. It checks, in macula’s order: the frame, the carried keys and the proof’s length, that each key serves one purpose, the puzzle on the derived node_id before any signature, the CONNECT binding and status statement, and the proof against the challenge this station sent and the leaf it presented. A refusal is the local close reason, and the HELLO refuses with one coarse code.
A station with v5 answers version 4 and 5, HELLO in the CONNECT’s
version; in version 5 it signs the session proof only once every check has
passed. Without it, a v5 CONNECT is refused unsupported_version in
version 4, as an old station refuses it.