Commit Graph

3 Commits (5abad1571c7d0869e29d55ca01df83fef8cd4606)

Author SHA1 Message Date
Yawning Angel b3f0f51775 Move utils.go to csrand/csrand.go, and clean up the interface.
All of the obfs4 code except unit tests now uses the csrand wrapper
routines.
10 years ago
Yawning Angel 272fb852e7 Change the maximm handshake length to 8192 bytes.
* handhake_ntor_test now is considerably more comprehensive.
 * The padding related constants in the spec were clarified.

This breaks wireprotocol compatibility.
10 years ago
Yawning Angel fd4e3c7c74 Add replay detection to handshakes.
This is done by maintaining a map keyed off the SipHash-2-4 digest of
the MAC_C component of the handshake.  Collisions, while possible are
unlikely in the extreme and are thus treated as replays.

In concept this is fairly similar to the ScrambleSuit `replay.py` code,
with a few modifications:

 * There is a upper bound on how large the replay filter can grow.
   Currently this is set to 102400 entries, though it is unlikely that
   this limit will be hit.

 * A doubly linked list is also maintained parallel to the map, so the
   filter compaction process does not need to iterate over the entire
   filter.
10 years ago