chiark / gitweb /
server/peer.c, etc.: Introduce who-goes-there protocol.
If a laptop (say) has been asleep for a short while, then its peer has
likely forgotten about it, but it will wait for a ping-timeout cycle
before attempting to reconnect.
Introduce a new protocol to speed this up.
* When a packet which contains a ciphertext (e.g., `MSG_PACKET',
`MISC_EPING') is received from an unknown sender, then send back a
`MISC_WGT' (`who-goes-there') message quoting a prefix of the
offending packet. These are rate-limited so that TrIPE can't be
used as an amplifier. (Under adverse circumstances, we fall back to
the old timeout mechanisms.)
* When a `MISC_WGT' packet is received, we check to see whether the
peer is configured with a `knock' string, and the quoted prefix
matches a message we sent to that peer recently. If so, we try to
restart the key-exchange protocol. Hence, an adversary who can't
read the wire has very little chance of proviking a pointless
key-exchange. The 20 s cooling-off period still applies, so even an
adversary who /can/ read the wire can't do too much harm.