Commit Graph

74 Commits (efdc692691f7b288a8e4b0ca803514873c23abad)

Author SHA1 Message Date
Yawning Angel efdc692691 obfs4: Clean up and modernize the codebase
While the thought of dealing with this codebase makes me reach for the
Benzodiazepines, I might as well clean this up.
11 months ago
Yawning Angel b8da220f08 build: Bump the version to 0.0.15-dev 1 year ago
Yawning Angel 336a71d6e4 build: Do the release ritual for obfs4proxy-0.0.14 2 years ago
Yawning Angel f63befd107 build: Bump the version to 0.0.14-dev 2 years ago
Yawning Angel 77af0cba93 build: Do the release ritual for obfs4proxy-0.0.13 2 years ago
Yawning Angel cbf3f3cfa0 Bump the version to 0.0.13-dev 2 years ago
Yawning Angel a564bc3840 Do the release ritual for obfs4proxy-0.0.12 2 years ago
Yawning Angel c357dd56df Bump the version to 0.0.12-dev 5 years ago
Yawning Angel b5a9f3c5d2 Do the release ritual for obfs4proxy-0.0.11 5 years ago
Yawning Angel a8288437e3 Update my e-mail address (no functional changes) 5 years ago
Yawning Angel 9a12019f5a Bump the version to 0.0.11-dev 5 years ago
Yawning Angel f58291912a Do the release ritual for obfs4proxy-0.0.10 5 years ago
Yawning Angel 2ff57980e2 Bump the version to 0.0.10-dev 5 years ago
Yawning Angel 8a19b4fcb1 Do the release ritual for obfs4proxy-0.0.9 5 years ago
Yawning Angel f8bf80479f Bump the version to 0.0.9-dev 5 years ago
Yawning Angel 98730f287c Do the release ritual for obfs4proxy 0.0.8. 5 years ago
Yawning Angel 5b4397bff8 Clean up static analysis warnings
Mostly but not entirely discarding error return values of things that
can not possibly fail despite the API returning errors.
5 years ago
Yawning Angel 70d0e90c86 Change the canonical upstream repo location to gitlab
This commit changes the upstream repo location to:
  https://gitlab.com/yawning/obfs4.git

Additionally all the non-`main` sub-packages now have an import
comment annotation.  As a matter of courtesy, I will continue to
push to both the existing github.com and git.torproject.org repos
for the foreseeable future, though I reserve the right to stop
doing so at any time.
5 years ago
Yawning Angel 97a875ec3c Bump the version to 0.0.8-dev, signifying development towards 0.0.8. 8 years ago
Yawning Angel 8256fac93c Do the release ritual for obfs4proxy 0.0.7. 8 years ago
Yawning Angel 1df5c8ffe8 Bump the version to 0.0.7-dev, signifying development towards 0.0.7. 9 years ago
Yawning Angel 896a98c427 Do the release ritual for obfs4proxy-0.0.6. 9 years ago
Yawning Angel e52258edac Make establishing outgoing connections the transport's responsibility.
ClientFactories now have a Dial() method instead of a WrapConn()
method, so that it is possible to write something like meek-client
using the obfs4proxy framework.

This breaks the external interface if anyone is using obfs4proxy as
a library, but the new way of doing things is a trivial modification,
to a single routine that shouldn't have been very large to begin with.
9 years ago
Yawning Angel 69ffcc39c6 Delay transport initialization till after logging has been setup. 9 years ago
Yawning Angel 37a709d8b4 Bump the version to 0.0.6-dev, signifying development towards 0.0.6. 9 years ago
Yawning Angel 3540313e53 Do the release ritual for obfs4proxy-0.0.5. 9 years ago
Yawning Angel a8d7134f10 Use a built in SOCKS 5 server instead of goptlibs.
Differences from my goptlib branch:
 * Instead of exposing a net.Listener, just expose a Handshake() routine
   that takes an existing net.Conn. (#14135 is irrelevant to this socks
   server.
 * There's an extra routine for sending back sensible errors on Dial
   failure instead of "General failure".
 * The code is slightly cleaner (IMO).

Gotchas:
 * If the goptlib pt.Args datatype or external interface changes,
   args.go will need to be updated.

Tested with obfs3 and obfs4, including IPv6.
9 years ago
Yawning Angel df42657079 Move logging wrappers into common/log, and add a DEBUG log level.
Implements feature #15576.
9 years ago
Yawning Angel 657c8e4f02 Clean up/refactor the shutdown/termination handling code.
This combines the old signal processing code with the parent monitor,
into a new termination monitor structure, which also now handles keeping
track of outstanding sessions.
9 years ago
Yawning Angel 4e4c9052f4 Attempt to detect if the parent crashed without killing obfs4proxy.
The ideal solution here would be to implement #15435, but till then
use one of several kludges:
 * Linux - prctl() so that the kernel SIGTERMs on parent exit.
 * Other U*ix - Poll the parent process id once a second, and SIGTERM
   ourself/exit if it changes.  Former is better since all the normal
   cleanup if any gets done.
 * Windows - Log a warning.
9 years ago
Yawning Angel aed4b72389 Change the import path for go.net.
The Go developers decided to move the go.net repository to
golang.org/x/net, and also to transition from hg to git.  This wasn't
changed when the go.crypto imports were since the 'proxy' component
doesn't have imports that break, so the old code still works.

While the change here is simple (just update the import location), this
affects packagers as it now expects the updated package.  Sorry for the
inconveneince, I blame the Go people, and myself for not just doing
this along with the go.crypto changes.
9 years ago
Daniel Martí ced244c09f Reduce some if err != nil logic lines 9 years ago
Yawning Angel 714581df51 Do the release ritual for obfs4proxy-0.0.4. 9 years ago
Yawning Angel fc00015ee2 Do the release ritual for obfs4proxy-0.0.3. 10 years ago
Yawning Angel 213495d3b9 Do the release ritual for obfs4proxy-0.0.2. 10 years ago
Yawning Angel ce86fa4348 Change the default logLevel to ERROR, upgrade some client warnings.
Client side logs are less spammy than server side in general, so more
messages should be visible at the default logLevel when running as a
client.

Server side logging will be spammy basically no matter what unless
obfs4proxy gets into the (arguably dangerous) business of figuring out
which errors are people being evil vs which ones are transient network
issues, so most logging is suppressed by default, unless the admin
choses to open the floodgates.
10 years ago
Yawning Angel fb13cf1241 Add a prolog/epilog to the logging that always gets logged.
The prolog prints the version as soon as logging is enabled, but before
the pluggable transport configuration is done.  The epilog is printed as
the code returns from main, as long as either client or server pt
configuration succeded.
10 years ago
Yawning Angel d5f59458fe Change the version command line arg from `-v` to `-version`.
For consistency with the rest of the arguments.
10 years ago
Yawning Angel 25178c6a95 Add support for "logLevel" to reduce log spam.
By default logging will be done at the "WARN" level.  Fatal
initialization errors will always be logged as long as logging
is enabled regardless of logLevel.
10 years ago
Yawning Angel ce39988b11 Add elideError(error) that knows how to sanitize net.Errors.
Instead of omitting errors entirely when running with the log scrubber,
filter common network errors through elideError() that can scrub the
common net.Error types and remove sensitive information.
10 years ago
Yawning Angel 83c9e3b9a0 Add a ChangeLog and dump the version when invoked with "-v". 10 years ago
Yawning Angel 596cc85073 Elide the error out from most logs unless unsafeLogging is set.
The Golang runtime will happily splatter the remote IP address and port
in the error's string representation for network related errors.  While
useful for debugging, this is unacceptable from a privacy standpoint.
10 years ago
Yawning Angel dd9fdee55d Add a missing "continue" statement.
Caught by asn, thanks.
10 years ago
Yawning Angel 339c63f0c8 Massive cleanup/code reorg.
* 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).
10 years ago
Yawning Angel 8a3eb4b309 Change the import paths to point to the tp.o repository. 10 years ago
Yawning Angel b19b6de31f Allow randomly generating node-ids instead of requiring the fingerprint.
To ease delopyment, "-genServerParams has changed".

 * "-genServerParams" is now a bool, and will by default generate a
   random node-id.
 * "-genServerParams -genServerParamsFP=<Base16 blob>" will convert the
   supplied bridge fingerprint to a node-id (the old behavior).

Either way of deriving node-id is belived to be secure.

 * https://lists.torproject.org/pipermail/tor-dev/2014-May/006929.html
 * https://lists.torproject.org/pipermail/tor-dev/2014-June/006936.html

The extra parameter was added because golang's flags library doesn't
support distinguishing between "set but used the default value" and
"not set, so you go the default value".
10 years ago
Yawning Angel d9c6ecbf8f Use goptlib's MakeStateDir instead of the one in pt_extras.
This requires changes in goptlib from last night, people may need to
run "go get -u" to update dependencies before building.
10 years ago
Yawning Angel 5bdc376e2a Change how the length obfsucation mask is derived.
Instead of using the nonce for the secret box, just use SipHash-2-4 in
OFB mode instead.  The IV is generated as part of the KDF.  This
simplifies the code a decent amount and also is better on the off
chance that SipHash-2-4 does not avalanche as well as it is currently
assumed.

While here, also decouple the fact that *this implementation* of obfs4
uses a PRNG with 24 bytes of internal state for protocol polymorphism
instead of 32 bytes (that the spec requires).

THIS CHANGE BREAKS WIRE PROTCOL COMPATIBILITY.
10 years ago
Yawning Angel 5cb3369e20 Move the SipHash DRBG off into it's own package. 10 years ago
Yawning Angel bd2bef2ead Fix import lines so other people using go get works. 10 years ago