Commit Graph

23 Commits

Author SHA1 Message Date
Yawning Angel
3c64e04e02 Add support for SOCKS4.
Despite the unfortunate scheme name, this really is SOCKS4, and not 4a,
as the torrc Socks4Proxy option only supports addresses and not FQDNs.

Part of issue #7.
2014-05-25 10:28:32 +00:00
Yawning Angel
92494597ce Wire in go.net/proxy, enabling SOCKS5 via TOR_PT_PROXY.
With tor patched to support 8402, obfs4 bootstraps via a SOCKSv5 proxy
now.  Other schemes will bail with a PROXY-ERROR, as the go.net/proxy
package does not support them, and I have not gotten around to writing
dialers for them yet (next on my TODO list).

Part of issue #7.
2014-05-25 09:14:14 +00:00
Yawning Angel
d5c3a25dec Parse TOR_PT_PROXY and support sending DONE/PROXY-ERROR.
Currently obfs4proxy is hardcoded to always PROXY-ERROR, despite a
valid proxy uri being passed in the env var.  Once the dialer portion
of the code is done, this will be changed.

Part of issue #7.
2014-05-25 08:01:11 +00:00
Yawning Angel
f04fd166ac Move the supplemental pt config routines to pt_extra.go 2014-05-25 07:27:48 +00:00
Yawning Angel
e77ddddf4d Add support for IAT obfuscation (disabled by default).
When enabled, inter-packet delay will be randomized between 0 and 10
ms in 100 usec intervals.  As experiences from ScrambleSuit (and back
of the envelope math based on how networks work) show, this is
extremely expensive and artificially limits the throughput of the link.

When enabled, bulk transfer throughput will be limited to an average of
278 KiB/s.
2014-05-23 05:23:36 +00:00
Yawning Angel
7dd875fe4c Revert "Use the new goptlib goodies."
This reverts commit 8d61c6bcc6.

On second thought, don't do this.  API not final, and some of the stuff
might not be a good idea after all.
2014-05-21 18:28:50 +00:00
Yawning Angel
8d61c6bcc6 Use the new goptlib goodies.
As of `15b960d55905877a840fe605a41a8139bffb5329` goptlib supports
IsClient, IsServer, and handling the StateLocation.

Yes this means you need to use goptlib out of git.
2014-05-21 09:38:37 +00:00
Yawning Angel
7c37109c48 Add support for a log scrubber and log a session id.
This fixes #6.
2014-05-21 00:47:54 +00:00
Yawning Angel
b50a8bdf24 Finish adding godoc comments to all public interfaces. 2014-05-21 00:26:25 +00:00
Yawning Angel
676e0428e7 Allow logging to be disabled (default).
Part of #6, still need to make logs nicer.
2014-05-20 17:12:19 +00:00
Yawning Angel
7709069617 Send the DRBG seed as a packetTypePrngSeed post server handshake.
This fixes #3, and brings the code to be on par with the delopyed
versions of ScrambleSuit in terms of features.
2014-05-15 20:21:46 +00:00
Yawning Angel
6f875c99a9 Load the drbg-seed from the ServerTransportOptions args.
This also adds the drgb-seed option to the `-gen` obfs4proxy output.
2014-05-15 19:08:03 +00:00
Yawning Angel
b9e3aedfb1 Make the output from "-gen" be more useful. 2014-05-15 06:49:11 +00:00
Yawning Angel
50cc180084 Use os.MkdirAll() for creating the pt state directory. 2014-05-15 06:12:31 +00:00
Yawning Angel
8e552dbd48 Remove a newline to make godoc work (No functional changes). 2014-05-14 10:01:50 +00:00
Yawning Angel
64212e1029 Add vim modelines to some files (No functional changes). 2014-05-13 09:56:25 +00:00
Yawning Angel
8daf42a13e Fix up import. 2014-05-13 07:01:25 +00:00
Yawning Angel
d2b2e383fd Fix copyLoop to break out the other goroutine on graceful exit.
This should fix sockets getting stuck in CLOSE_WAIT.
2014-05-13 03:19:55 +00:00
Yawning Angel
51a8dd5a86 Fix logging again.
On second thought instead of using log.Panicf(), panic() and do the
logging with recover().  This somewhat centralizes logging in
obfs4proxy, which will be easier to change when I invariably decide to
do logging differently in the future.
2014-05-12 23:04:39 +00:00
Yawning Angel
c3acefb7e5 Log and propagate errors between the 2 goroutines in copyLoop.
This fixes #1.
2014-05-12 05:08:04 +00:00
Yawning Angel
c2f1e8ecb7 Clean up the logging a bit. 2014-05-12 00:25:40 +00:00
Yawning Angel
68c48cb383 Run go fmt on obfs4proxy.go (No functional changes). 2014-05-12 00:06:52 +00:00
Yawning Angel
8e14ed44ad Move to a unified client/server binary, and fix bugs.
* The old and the busted: obfs4-[client,server].
 * The new hotness: obfs4client.
 * Add obfs4.ServerHandshake() that servers need to call after a
   successful return from Accept().  This allows implementations to
   move the handshake into a goroutine or whatever.
2014-05-12 00:02:24 +00:00