From 70d0e90c861be34ce3c5425ef1366a0b2ceb3026 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Wed, 16 Jan 2019 07:36:18 +0000 Subject: [PATCH] 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. --- ChangeLog | 1 + common/csrand/csrand.go | 2 +- common/drbg/hash_drbg.go | 5 ++--- common/log/log.go | 2 +- common/ntor/ntor.go | 8 +++----- common/probdist/weighted_dist.go | 6 +++--- common/probdist/weighted_dist_test.go | 2 +- common/replayfilter/replay_filter.go | 5 ++--- common/socks5/socks5.go | 2 +- common/uniformdh/uniformdh.go | 2 +- go.mod | 2 +- obfs4proxy/obfs4proxy.go | 11 +++++------ obfs4proxy/proxy_http.go | 2 +- obfs4proxy/termmon.go | 2 +- transports/base/base.go | 2 +- transports/meeklite/base.go | 4 ++-- transports/meeklite/meek.go | 2 +- transports/obfs2/obfs2.go | 6 +++--- transports/obfs3/obfs3.go | 8 ++++---- transports/obfs4/framing/framing.go | 7 +++---- transports/obfs4/handshake_ntor.go | 8 ++++---- transports/obfs4/handshake_ntor_test.go | 4 ++-- transports/obfs4/obfs4.go | 14 +++++++------- transports/obfs4/packet.go | 4 ++-- transports/obfs4/statefile.go | 6 +++--- transports/scramblesuit/base.go | 4 ++-- transports/scramblesuit/conn.go | 8 ++++---- transports/scramblesuit/handshake_ticket.go | 2 +- transports/scramblesuit/handshake_uniformdh.go | 4 ++-- transports/transports.go | 14 +++++++------- 30 files changed, 72 insertions(+), 77 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73c7bb8..fceb283 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Changes in version 0.0.8 - UNRELEASED: - (meek_lite) Explicitly set Content-Length to zero when there is no data to send. - Added optional support for building as a Go 1.11 module. Patch by mvdan. + - Change the canonical upstream repo location to gitlab. Changes in version 0.0.7 - 2016-11-15: - Support configuring the obfs4 IAT parameter as the sole diff --git a/common/csrand/csrand.go b/common/csrand/csrand.go index 45849d3..5dc617f 100644 --- a/common/csrand/csrand.go +++ b/common/csrand/csrand.go @@ -31,7 +31,7 @@ // Not all of the convinience routines are replicated, only those that are // immediately useful. The Rand variable provides access to the full math/rand // API. -package csrand +package csrand // import "gitlab.com/yawning/obfs4.git/common/csrand" import ( cryptRand "crypto/rand" diff --git a/common/drbg/hash_drbg.go b/common/drbg/hash_drbg.go index 7feb9e8..ea283ca 100644 --- a/common/drbg/hash_drbg.go +++ b/common/drbg/hash_drbg.go @@ -27,7 +27,7 @@ // Package drbg implements a minimalistic DRBG based off SipHash-2-4 in OFB // mode. -package drbg +package drbg // import "gitlab.com/yawning/obfs4.git/common/drbg" import ( "encoding/binary" @@ -36,8 +36,7 @@ import ( "hash" "github.com/dchest/siphash" - - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/csrand" ) // Size is the length of the HashDrbg output. diff --git a/common/log/log.go b/common/log/log.go index 1c30b48..53dd9c6 100644 --- a/common/log/log.go +++ b/common/log/log.go @@ -27,7 +27,7 @@ // Package log implements a simple set of leveled logging wrappers around the // standard log package. -package log +package log // import "gitlab.com/yawning/obfs4.git/common/log" import ( "fmt" diff --git a/common/ntor/ntor.go b/common/ntor/ntor.go index 4f6ab27..d5218db 100644 --- a/common/ntor/ntor.go +++ b/common/ntor/ntor.go @@ -32,7 +32,7 @@ // // Before using this package, it is strongly recommended that the specification // is read and understood. -package ntor +package ntor // import "gitlab.com/yawning/obfs4.git/common/ntor" import ( "bytes" @@ -43,12 +43,10 @@ import ( "fmt" "io" + "github.com/agl/ed25519/extra25519" + "gitlab.com/yawning/obfs4.git/common/csrand" "golang.org/x/crypto/curve25519" "golang.org/x/crypto/hkdf" - - "github.com/agl/ed25519/extra25519" - - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" ) const ( diff --git a/common/probdist/weighted_dist.go b/common/probdist/weighted_dist.go index 5f8e88e..66c4f7b 100644 --- a/common/probdist/weighted_dist.go +++ b/common/probdist/weighted_dist.go @@ -28,7 +28,7 @@ // Package probdist implements a weighted probability distribution suitable for // protocol parameterization. To allow for easy reproduction of a given // distribution, the drbg package is used as the random number source. -package probdist +package probdist // import "gitlab.com/yawning/obfs4.git/common/probdist" import ( "bytes" @@ -37,8 +37,8 @@ import ( "math/rand" "sync" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/common/drbg" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/drbg" ) const ( diff --git a/common/probdist/weighted_dist_test.go b/common/probdist/weighted_dist_test.go index b705add..5bbcc32 100644 --- a/common/probdist/weighted_dist_test.go +++ b/common/probdist/weighted_dist_test.go @@ -31,7 +31,7 @@ import ( "fmt" "testing" - "git.torproject.org/pluggable-transports/obfs4.git/common/drbg" + "gitlab.com/yawning/obfs4.git/common/drbg" ) const debug = false diff --git a/common/replayfilter/replay_filter.go b/common/replayfilter/replay_filter.go index 95cc5d6..f3b2bd0 100644 --- a/common/replayfilter/replay_filter.go +++ b/common/replayfilter/replay_filter.go @@ -30,7 +30,7 @@ // has been seen before based on the SipHash-2-4 digest of the sequence. // Collisions are treated as positive matches, though the probability of this // happening is negligible. -package replayfilter +package replayfilter // import "gitlab.com/yawning/obfs4.git/common/replayfilter" import ( "container/list" @@ -39,8 +39,7 @@ import ( "time" "github.com/dchest/siphash" - - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/csrand" ) // maxFilterSize is the maximum capacity of a replay filter. This value is diff --git a/common/socks5/socks5.go b/common/socks5/socks5.go index d15e542..876f934 100644 --- a/common/socks5/socks5.go +++ b/common/socks5/socks5.go @@ -35,7 +35,7 @@ // * The authentication provided by the client is always accepted as it is // used as a channel to pass information rather than for authentication for // pluggable transports. -package socks5 +package socks5 // import "gitlab.com/yawning/obfs4.git/common/socks5" import ( "bufio" diff --git a/common/uniformdh/uniformdh.go b/common/uniformdh/uniformdh.go index ab94a2e..bcd25fc 100644 --- a/common/uniformdh/uniformdh.go +++ b/common/uniformdh/uniformdh.go @@ -29,7 +29,7 @@ // mechanism as defined in the obfs3 protocol specification. This // implementation is suitable for obfuscation but MUST NOT BE USED when strong // security is required as it is not constant time. -package uniformdh +package uniformdh // import "gitlab.com/yawning/obfs4.git/common/uniformdh" import ( "fmt" diff --git a/go.mod b/go.mod index 927ab67..f676f90 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module git.torproject.org/pluggable-transports/obfs4.git +module gitlab.com/yawning/obfs4.git require ( git.torproject.org/pluggable-transports/goptlib.git v0.0.0-20180321061416-7d56ec4f381e diff --git a/obfs4proxy/obfs4proxy.go b/obfs4proxy/obfs4proxy.go index fa8e126..0770455 100644 --- a/obfs4proxy/obfs4proxy.go +++ b/obfs4proxy/obfs4proxy.go @@ -41,13 +41,12 @@ import ( "sync" "syscall" - "golang.org/x/net/proxy" - "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/common/log" - "git.torproject.org/pluggable-transports/obfs4.git/common/socks5" - "git.torproject.org/pluggable-transports/obfs4.git/transports" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/common/log" + "gitlab.com/yawning/obfs4.git/common/socks5" + "gitlab.com/yawning/obfs4.git/transports" + "gitlab.com/yawning/obfs4.git/transports/base" + "golang.org/x/net/proxy" ) const ( diff --git a/obfs4proxy/proxy_http.go b/obfs4proxy/proxy_http.go index a5c2100..c108943 100644 --- a/obfs4proxy/proxy_http.go +++ b/obfs4proxy/proxy_http.go @@ -93,7 +93,7 @@ func (s *httpProxy) Dial(network, addr string) (net.Conn, error) { if s.haveAuth { // SetBasicAuth doesn't quite do what is appropriate, because // the correct header is `Proxy-Authorization`. - req.Header.Set("Proxy-Authorization", base64.StdEncoding.EncodeToString([]byte(s.username + ":" + s.password))) + req.Header.Set("Proxy-Authorization", base64.StdEncoding.EncodeToString([]byte(s.username+":"+s.password))) } req.Header.Set("User-Agent", "") diff --git a/obfs4proxy/termmon.go b/obfs4proxy/termmon.go index 86db190..d402716 100644 --- a/obfs4proxy/termmon.go +++ b/obfs4proxy/termmon.go @@ -36,7 +36,7 @@ import ( "syscall" "time" - "git.torproject.org/pluggable-transports/obfs4.git/common/log" + "gitlab.com/yawning/obfs4.git/common/log" ) var termMonitorOSInit func(*termMonitor) error diff --git a/transports/base/base.go b/transports/base/base.go index bb0902e..de51929 100644 --- a/transports/base/base.go +++ b/transports/base/base.go @@ -27,7 +27,7 @@ // Package base provides the common interface that each supported transport // protocol must implement. -package base +package base // import "gitlab.com/yawning/obfs4.git/transports/base" import ( "net" diff --git a/transports/meeklite/base.go b/transports/meeklite/base.go index 2a4cf80..a173996 100644 --- a/transports/meeklite/base.go +++ b/transports/meeklite/base.go @@ -30,14 +30,14 @@ // made to normalize the TLS fingerprint. // // It borrows quite liberally from the real meek-client code. -package meeklite +package meeklite // import "gitlab.com/yawning/obfs4.git/transports/meeklite" import ( "fmt" "net" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/transports/base" ) const transportName = "meek_lite" diff --git a/transports/meeklite/meek.go b/transports/meeklite/meek.go index e068b68..ca52a4a 100644 --- a/transports/meeklite/meek.go +++ b/transports/meeklite/meek.go @@ -44,7 +44,7 @@ import ( "time" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/transports/base" ) const ( diff --git a/transports/obfs2/obfs2.go b/transports/obfs2/obfs2.go index 8fa6cb8..66e0dbb 100644 --- a/transports/obfs2/obfs2.go +++ b/transports/obfs2/obfs2.go @@ -28,7 +28,7 @@ // Package obfs2 provides an implementation of the Tor Project's obfs2 // obfuscation protocol. This protocol is considered trivially broken by most // sophisticated adversaries. -package obfs2 +package obfs2 // import "gitlab.com/yawning/obfs4.git/transports/obfs2" import ( "crypto/aes" @@ -41,8 +41,8 @@ import ( "time" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/transports/base" ) const ( diff --git a/transports/obfs3/obfs3.go b/transports/obfs3/obfs3.go index 08d6be4..f25d1bd 100644 --- a/transports/obfs3/obfs3.go +++ b/transports/obfs3/obfs3.go @@ -27,7 +27,7 @@ // Package obfs3 provides an implementation of the Tor Project's obfs3 // obfuscation protocol. -package obfs3 +package obfs3 // import "gitlab.com/yawning/obfs4.git/transports/obfs3" import ( "bytes" @@ -41,9 +41,9 @@ import ( "time" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/common/uniformdh" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/uniformdh" + "gitlab.com/yawning/obfs4.git/transports/base" ) const ( diff --git a/transports/obfs4/framing/framing.go b/transports/obfs4/framing/framing.go index 815a990..f0c38c3 100644 --- a/transports/obfs4/framing/framing.go +++ b/transports/obfs4/framing/framing.go @@ -58,7 +58,7 @@ // and the initial counter value. It is imperative that the counter does not // wrap, and sessions MUST terminate before 2^64 frames are sent. // -package framing +package framing // import "gitlab.com/yawning/obfs4.git/transports/obfs4/framing" import ( "bytes" @@ -67,10 +67,9 @@ import ( "fmt" "io" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/drbg" "golang.org/x/crypto/nacl/secretbox" - - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/common/drbg" ) const ( diff --git a/transports/obfs4/handshake_ntor.go b/transports/obfs4/handshake_ntor.go index ee1bca8..99f3925 100644 --- a/transports/obfs4/handshake_ntor.go +++ b/transports/obfs4/handshake_ntor.go @@ -38,10 +38,10 @@ import ( "strconv" "time" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/common/ntor" - "git.torproject.org/pluggable-transports/obfs4.git/common/replayfilter" - "git.torproject.org/pluggable-transports/obfs4.git/transports/obfs4/framing" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/ntor" + "gitlab.com/yawning/obfs4.git/common/replayfilter" + "gitlab.com/yawning/obfs4.git/transports/obfs4/framing" ) const ( diff --git a/transports/obfs4/handshake_ntor_test.go b/transports/obfs4/handshake_ntor_test.go index b575093..8e4d260 100644 --- a/transports/obfs4/handshake_ntor_test.go +++ b/transports/obfs4/handshake_ntor_test.go @@ -31,8 +31,8 @@ import ( "bytes" "testing" - "git.torproject.org/pluggable-transports/obfs4.git/common/ntor" - "git.torproject.org/pluggable-transports/obfs4.git/common/replayfilter" + "gitlab.com/yawning/obfs4.git/common/ntor" + "gitlab.com/yawning/obfs4.git/common/replayfilter" ) func TestHandshakeNtorClient(t *testing.T) { diff --git a/transports/obfs4/obfs4.go b/transports/obfs4/obfs4.go index 304097e..6a92f17 100644 --- a/transports/obfs4/obfs4.go +++ b/transports/obfs4/obfs4.go @@ -27,7 +27,7 @@ // Package obfs4 provides an implementation of the Tor Project's obfs4 // obfuscation protocol. -package obfs4 +package obfs4 // import "gitlab.com/yawning/obfs4.git/transports/obfs4" import ( "bytes" @@ -41,12 +41,12 @@ import ( "time" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/common/drbg" - "git.torproject.org/pluggable-transports/obfs4.git/common/ntor" - "git.torproject.org/pluggable-transports/obfs4.git/common/probdist" - "git.torproject.org/pluggable-transports/obfs4.git/common/replayfilter" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" - "git.torproject.org/pluggable-transports/obfs4.git/transports/obfs4/framing" + "gitlab.com/yawning/obfs4.git/common/drbg" + "gitlab.com/yawning/obfs4.git/common/ntor" + "gitlab.com/yawning/obfs4.git/common/probdist" + "gitlab.com/yawning/obfs4.git/common/replayfilter" + "gitlab.com/yawning/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/transports/obfs4/framing" ) const ( diff --git a/transports/obfs4/packet.go b/transports/obfs4/packet.go index 5125be6..653fae3 100644 --- a/transports/obfs4/packet.go +++ b/transports/obfs4/packet.go @@ -33,8 +33,8 @@ import ( "fmt" "io" - "git.torproject.org/pluggable-transports/obfs4.git/common/drbg" - "git.torproject.org/pluggable-transports/obfs4.git/transports/obfs4/framing" + "gitlab.com/yawning/obfs4.git/common/drbg" + "gitlab.com/yawning/obfs4.git/transports/obfs4/framing" ) const ( diff --git a/transports/obfs4/statefile.go b/transports/obfs4/statefile.go index e4ff8bf..8752f0d 100644 --- a/transports/obfs4/statefile.go +++ b/transports/obfs4/statefile.go @@ -38,9 +38,9 @@ import ( "strings" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/common/drbg" - "git.torproject.org/pluggable-transports/obfs4.git/common/ntor" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/drbg" + "gitlab.com/yawning/obfs4.git/common/ntor" ) const ( diff --git a/transports/scramblesuit/base.go b/transports/scramblesuit/base.go index 7a71398..5817ee6 100644 --- a/transports/scramblesuit/base.go +++ b/transports/scramblesuit/base.go @@ -27,14 +27,14 @@ // Package scramblesuit provides an implementation of the ScrambleSuit // obfuscation protocol. The implementation is client only. -package scramblesuit +package scramblesuit // import "gitlab.com/yawning/obfs4.git/transports/scramblesuit" import ( "fmt" "net" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/transports/base" ) const transportName = "scramblesuit" diff --git a/transports/scramblesuit/conn.go b/transports/scramblesuit/conn.go index b8a27c7..335be6e 100644 --- a/transports/scramblesuit/conn.go +++ b/transports/scramblesuit/conn.go @@ -43,10 +43,10 @@ import ( "time" "git.torproject.org/pluggable-transports/goptlib.git" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/common/drbg" - "git.torproject.org/pluggable-transports/obfs4.git/common/probdist" - "git.torproject.org/pluggable-transports/obfs4.git/common/uniformdh" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/drbg" + "gitlab.com/yawning/obfs4.git/common/probdist" + "gitlab.com/yawning/obfs4.git/common/uniformdh" ) const ( diff --git a/transports/scramblesuit/handshake_ticket.go b/transports/scramblesuit/handshake_ticket.go index ad9b4d4..16b57d6 100644 --- a/transports/scramblesuit/handshake_ticket.go +++ b/transports/scramblesuit/handshake_ticket.go @@ -42,7 +42,7 @@ import ( "sync" "time" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/csrand" ) const ( diff --git a/transports/scramblesuit/handshake_uniformdh.go b/transports/scramblesuit/handshake_uniformdh.go index 4b77e5a..3e8ed59 100644 --- a/transports/scramblesuit/handshake_uniformdh.go +++ b/transports/scramblesuit/handshake_uniformdh.go @@ -36,8 +36,8 @@ import ( "strconv" "time" - "git.torproject.org/pluggable-transports/obfs4.git/common/csrand" - "git.torproject.org/pluggable-transports/obfs4.git/common/uniformdh" + "gitlab.com/yawning/obfs4.git/common/csrand" + "gitlab.com/yawning/obfs4.git/common/uniformdh" ) const ( diff --git a/transports/transports.go b/transports/transports.go index 51a3f08..6301c8b 100644 --- a/transports/transports.go +++ b/transports/transports.go @@ -27,18 +27,18 @@ // Package transports provides a interface to query supported pluggable // transports. -package transports +package transports // import "gitlab.com/yawning/obfs4.git/transports" import ( "fmt" "sync" - "git.torproject.org/pluggable-transports/obfs4.git/transports/base" - "git.torproject.org/pluggable-transports/obfs4.git/transports/meeklite" - "git.torproject.org/pluggable-transports/obfs4.git/transports/obfs2" - "git.torproject.org/pluggable-transports/obfs4.git/transports/obfs3" - "git.torproject.org/pluggable-transports/obfs4.git/transports/obfs4" - "git.torproject.org/pluggable-transports/obfs4.git/transports/scramblesuit" + "gitlab.com/yawning/obfs4.git/transports/base" + "gitlab.com/yawning/obfs4.git/transports/meeklite" + "gitlab.com/yawning/obfs4.git/transports/obfs2" + "gitlab.com/yawning/obfs4.git/transports/obfs3" + "gitlab.com/yawning/obfs4.git/transports/obfs4" + "gitlab.com/yawning/obfs4.git/transports/scramblesuit" ) var transportMapLock sync.Mutex