summaryrefslogtreecommitdiff
path: root/handshake_ntor.go
AgeCommit message (Collapse)Author
2014-08-17Massive cleanup/code reorg.Yawning Angel
* Changed obfs4proxy to be more like obfsproxy in terms of design, including being an easy framework for developing new TCP/IP style pluggable transports. * Added support for also acting as an obfs2/obfs3 client or bridge as a transition measure (and because the code itself is trivial). * Massively cleaned up the obfs4 and related code to be easier to read, and more idiomatic Go-like in style. * To ease deployment, obfs4proxy will now autogenerate the node-id, curve25519 keypair, and drbg seed if none are specified, and save them to a JSON file in the pt_state directory (Fixes Tor bug #12605).
2014-06-25Change the import paths to point to the tp.o repository.Yawning Angel
2014-06-01Move the server keypair generation to right after Accept().Yawning Angel
Instead of threading the code, move the keypair generation to right after Accept() is called. This should mask the timing differential due to the rejection sampling with the noise from the variablity in how long it takes for the server to get around to pulling a connection out of the backlog, and the time taken for the client to send it's portion of the handshake. The downside is that anyone connecting to the obfs4 port does force us to do a bunch of math, but the obfs4 math is relatively cheap compared to it's precursors. Fixes #9.
2014-06-01Generate client keypairs before connecting, instead of after.Yawning Angel
Part of issue #9.
2014-05-24Move utils.go to csrand/csrand.go, and clean up the interface.Yawning Angel
All of the obfs4 code except unit tests now uses the csrand wrapper routines.
2014-05-23Change the maximm handshake length to 8192 bytes.Yawning Angel
* handhake_ntor_test now is considerably more comprehensive. * The padding related constants in the spec were clarified. This breaks wireprotocol compatibility.
2014-05-22Add replay detection to handshakes.Yawning Angel
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.
2014-05-21Finish adding godoc comments to all public interfaces.Yawning Angel
2014-05-20Tweak the obfs4 handshake code.Yawning Angel
* Fixed where the code wasn't ensuring that the MAC_[C,S] was present. * Optimized the server side to only look at the tail of the (possibly incomplete handshakeRequest).
2014-05-16Treat the PrngSeed frame as part of the handshake.Yawning Angel
Clients will now always add 87 bytes of padding to the clientRequest, and Servers will always send the PRNG seed frame unpadded, and bundled with the serverResponse. Why 87 bytes? The amount of data that the server sends is 87. This fixes #5.
2014-05-16Validate that the padding length is greater than the minimum.Yawning Angel
2014-05-16Change the handshake wire format.Yawning Angel
* HMAC-SHA256 -> HMAC-SHA256-128. * Mark/MAC are now both caluclated using Public Key | NodeID. This breaks wire protocol compatibility.
2014-05-13Add preliminary support for packet length obfuscation.Yawning Angel
The same algorithm as ScrambleSuit is used, except: * SipHash-2-4 in OFB mode is used to create the distribution. * The system CSPRNG is used when sampling the distribution. This fixes most of #3, all that remains is generating and sending a persistent distribution on the server side to the client.
2014-05-12Close connections that fail to authenticate after a while.Yawning Angel
Like ScrambleSuit, a random interval between 1x and 5x of additional data from the peer is read and immediately discarded before closing. Additionally, obfs4 will close off invalid connections anywhere between 0 and 60 seconds after it determines that the incoming connection will never complete the handshake successfully.
2014-05-09Initial import.Yawning Angel