Commit Graph

11 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
David Fifield 5fcbb0e140 Do not clamp the private key before Elligator inverse map.
The Elligator inverse map uses the least significant bits of the private
key, which clamping sets to 0, to choose a random low-order point to add
to the public key, to ensure uniformity of representatives.

The other ways that the private key is used, namely in calls to
curve25519.ScalarMult and curve25519.ScalarBaseMult, do their own
clamping when necessary and are documented to accept a uniformly random
scalar.
2 years ago
Yawning Angel 393aca86cc internal/x25519ell2: Initial import
Replace agl's Elligator2 implementation with a different one, that fixes
the various distinguishers stemming from bugs in the original
implementation and "The Elligator paper is extremely hard to read".

All releases prior to this commit are trivially distinguishable with
simple math, so upgrading is strongly recommended.  The upgrade is fully
backward-compatible with existing implementations, however the
non-upgraded side will emit traffic that is trivially distinguishable
from random.

Special thanks to Loup Vaillant for his body of work on this primitive,
and for motivating me to fix it.
2 years ago
Yawning Angel 2d8f3c8bbf common: Replace the extra25519 import with an internal package
I really didn't want to do this, but this should make `go get` work
again, and maybe people will leave me alone.
4 years ago
Yawning Angel a8288437e3 Update my e-mail address (no functional changes) 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
Daniel Martí 08647ec580 Run go fmt 9 years ago
Yawning Angel cdeda57241 Change the import path for go.crypto.
The Go developers decided to move the go.crypto repository to
golang.org/x/crypto, and also to transition from hg to git.  The tip of
tree code.google.com copy of the code is broken due to the import paths
pointing at the new repository.

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.
10 years ago
Yawning Angel 1e574942d5 Change all the arguments to use base16 from base64.
WARNING: THIS BREAKS BACKWARD COMPATIBILITY.

This is primarily to work around bug #12930.  Base16 was chosen over
unpadded Base64 because the go runtime Base64 decoder does not handle
omitting the padding.

May $deity have mercy on anyone who needs to hand-enter an obfs4 bridge
line because I will not.
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