From f60317a44ebdeb5a34c9ac7d82d8f75fbd2626e0 Mon Sep 17 00:00:00 2001 From: Bluesaxorcist Date: Mon, 27 Jul 2020 01:02:18 -0500 Subject: [PATCH] added better logging to all transports --- transports/Dust/v3/Dust.go | 7 ++++++- transports/Dust/v3/Dust_test.go | 4 +++- transports/Replicant/v3/Optimizer.go | 9 +++++++-- transports/Replicant/v3/ReplicantClientConfig.json | 2 +- transports/Replicant/v3/ReplicantClientConfig1.json | 2 +- transports/Replicant/v3/ReplicantServerConfig.json | 2 +- transports/Replicant/v3/ReplicantServerConfig1.json | 2 +- transports/Replicant/v3/go.mod | 1 + transports/Replicant/v3/go.sum | 2 ++ transports/Replicant/v3/replicant_test.go | 10 ++++++---- transports/meeklite/v3/go.mod | 2 +- transports/meeklite/v3/go.sum | 13 ++----------- transports/meeklite/v3/meeklite.go | 6 ++++-- transports/meeklite/v3/meeklite_test.go | 4 +++- transports/meekserver/v3/go.mod | 2 +- transports/meekserver/v3/go.sum | 4 ++-- transports/meekserver/v3/meekserver_test.go | 4 +++- transports/meekserver/v3/pt21.go | 5 ++++- transports/obfs2/v3/go.mod | 1 + transports/obfs2/v3/go.sum | 2 ++ transports/obfs2/v3/obfs2.go | 5 ++++- transports/obfs2/v3/obfs2_test.go | 4 +++- transports/shadow/v3/go.mod | 1 + transports/shadow/v3/go.sum | 2 ++ transports/shadow/v3/shadow.go | 7 +++++-- transports/shadow/v3/shadow_test.go | 4 +++- 26 files changed, 70 insertions(+), 37 deletions(-) diff --git a/transports/Dust/v3/Dust.go b/transports/Dust/v3/Dust.go index bcf6262..1336097 100644 --- a/transports/Dust/v3/Dust.go +++ b/transports/Dust/v3/Dust.go @@ -10,6 +10,9 @@ package Dust import ( "fmt" "github.com/OperatorFoundation/obfs4/common/log" + + //"github.com/OperatorFoundation/obfs4/common/log" + "github.com/op/go-logging" "golang.org/x/net/proxy" "net" "time" @@ -51,18 +54,20 @@ type Transport struct { Address string Dialer proxy.Dialer ServerConfig *dustServer + Log *logging.Logger } type Config struct { ServerPublic string `json:"server-public"` } -func New(serverPublic string, address string, dialer proxy.Dialer, serverConfig *dustServer) Transport { +func New(serverPublic string, address string, dialer proxy.Dialer, serverConfig *dustServer, log *logging.Logger) Transport { return Transport{ ServerPublic: serverPublic, Address: address, Dialer: dialer, ServerConfig: serverConfig, + Log: log, } } diff --git a/transports/Dust/v3/Dust_test.go b/transports/Dust/v3/Dust_test.go index 11daf1d..3068e09 100644 --- a/transports/Dust/v3/Dust_test.go +++ b/transports/Dust/v3/Dust_test.go @@ -9,6 +9,7 @@ package Dust import ( + "github.com/op/go-logging" "golang.org/x/net/proxy" "testing" ) @@ -86,12 +87,13 @@ func TestDust(t *testing.T) { func TestDustV3(t *testing.T) { //create a server + var log = logging.MustGetLogger("dust") serverConfig := dustServer{ serverPrivkey: nil, dialer: nil, } - transport := New("", "127.0.0.1:1234", proxy.Direct, &serverConfig) + transport := New("", "127.0.0.1:1234", proxy.Direct, &serverConfig, log) //call listen on the server serverListener, listenErr := transport.Listen() if listenErr != nil { diff --git a/transports/Replicant/v3/Optimizer.go b/transports/Replicant/v3/Optimizer.go index c3f4217..7edb522 100644 --- a/transports/Replicant/v3/Optimizer.go +++ b/transports/Replicant/v3/Optimizer.go @@ -2,6 +2,7 @@ package replicant import ( pt "github.com/OperatorFoundation/shapeshifter-ipc/v2" + "github.com/op/go-logging" "golang.org/x/net/proxy" "net" ) @@ -11,27 +12,31 @@ type TransportClient struct { Config ClientConfig Address string Dialer proxy.Dialer + Log *logging.Logger } type TransportServer struct { Config ServerConfig Address string Dialer proxy.Dialer + Log *logging.Logger } -func NewClient(config ClientConfig, address string, dialer proxy.Dialer) TransportClient { +func NewClient(config ClientConfig, address string, dialer proxy.Dialer, log *logging.Logger) TransportClient { return TransportClient{ Config: config, Address: address, Dialer: dialer, + Log: log, } } -func NewServer(config ServerConfig, address string, dialer proxy.Dialer) TransportServer { +func NewServer(config ServerConfig, address string, dialer proxy.Dialer, log *logging.Logger) TransportServer { return TransportServer{ Config: config, Address: address, Dialer: dialer, + Log: log, } } diff --git a/transports/Replicant/v3/ReplicantClientConfig.json b/transports/Replicant/v3/ReplicantClientConfig.json index 9851ff3..ec2382f 100644 --- a/transports/Replicant/v3/ReplicantClientConfig.json +++ b/transports/Replicant/v3/ReplicantClientConfig.json @@ -1 +1 @@ -{"config":"M/+BAwEBDENsaWVudENvbmZpZwH/ggABAgEJVG9uZWJ1cnN0ARAAAQZQb2xpc2gBEAAAAP+8/4IBZmdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL3NoYXBlc2hpZnRlci10cmFuc3BvcnRzL3RyYW5zcG9ydHMvUmVwbGljYW50L3YzL3RvbmVidXJzdC5Nb25vdG9uZUNvbmZpZ/+NAwEBDk1vbm90b25lQ29uZmlnAf+OAAEDAQxBZGRTZXF1ZW5jZXMB/5AAAQ9SZW1vdmVTZXF1ZW5jZXMB/5IAAQpTcGVha0ZpcnN0AQIAAAAq/48DAQEISW5zdGFuY2UB/5AAAQIBBERlc2MB/5IAAQRBcmdzAf+WAAAAJP+RAwEBC0Rlc2NyaXB0aW9uAf+SAAEBAQVQYXJ0cwH/lAAAACH/kwIBARNbXW1vbm9saXRoLk1vbm9saXRoAf+UAAEQAAAo/5UDAQEEQXJncwH/lgABAgEGVmFsdWVzAf+YAAEFSW5kZXgBBAAAABz/lwIBAQ5bXWludGVyZmFjZSB7fQH/mAABEAAA/gG5/45jAQEBATxnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5CeXRlc1BhcnT/mQMBAQlCeXRlc1BhcnQB/5oAAQEBBUl0ZW1zAf+cAAAAIf+bAgEBE1tdbW9ub2xpdGguQnl0ZVR5cGUB/5wAARAAAHn/mmcBAUBnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5GaXhlZEJ5dGVUeXBl/50DAQENRml4ZWRCeXRlVHlwZQH/ngABA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BAQlCeXRlc1BhcnQB/5oAAQEBBUl0ZW1zAf+cAAAAIf+bAgEBE1tdbW9ub2xpdGguQnl0ZVR5cGUB/5wAARAAAHn/mmcBAUBnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5GaXhlZEJ5dGVUeXBl/50DAQENRml4ZWRCeXRlVHlwZQH/ngABAQEEQnl0ZQEGAAAAB/+eAwETAAAAAQAAAgEAAW1naXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9zaGFwZXNoaWZ0ZXItdHJhbnNwb3J0cy90cmFuc3BvcnRzL1JlcGxpY2FudC92My9wb2xpc2guU2lsdmVyUG9saXNoQ2xpZW50Q29uZmln/4cDAQEYU2lsdmVyUG9saXNoQ2xpZW50Q29uZmlnAf+IAAECAQ9TZXJ2ZXJQdWJsaWNLZXkBCgABCUNodW5rU2l6ZQEEAAAATP+ISAFBBK/Bwa0RrYc3813sA8lIx2uT7pcwEOCIYvjy/7khB1uU8eiUOlAyZdhLmkJRGzXRzoub27HOkYDK2qX35o4GhHoB/goQAAA="} \ No newline at end of file diff --git a/transports/Replicant/v3/ReplicantClientConfig1.json b/transports/Replicant/v3/ReplicantClientConfig1.json index 5ff8337..e80bcab 100644 --- a/transports/Replicant/v3/ReplicantClientConfig1.json +++ b/transports/Replicant/v3/ReplicantClientConfig1.json @@ -1 +1 @@ -{"config":"M/+BAwEBDENsaWVudENvbmZpZwH/ggABAgEJVG9uZWJ1cnN0ARAAAQZQb2xpc2gBEAAAAP+8/4IBZmdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL3NoYXBlc2hpZnRlci10cmFuc3BvcnRzL3RyYW5zcG9ydHMvUmVwbGljYW50L3YzL3RvbmVidXJzdC5Nb25vdG9uZUNvbmZpZ/+NAwEBDk1vbm90b25lQ29uZmlnAf+OAAEDAQxBZGRTZXF1ZW5jZXMB/5AAAQ9SZW1vdmVTZXF1ZW5jZXMB/5IAAQ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ZXJQb2xpc2hDbGllbnRDb25maWcB/4gAAQIBD1NlcnZlclB1YmxpY0tleQEKAAEJQ2h1bmtTaXplAQQAAABM/4hIAUEEQn3x8ZubAgf6TspbDBmwaJRz7rCM4sDzcP/012t8cRwlHLdOdbYUx6N7gUBEgKpY6e5utXOkAXJSDFrXDAzQnwH+CZgAAA=="} \ No newline at end of file diff --git a/transports/Replicant/v3/ReplicantServerConfig.json b/transports/Replicant/v3/ReplicantServerConfig.json index b6082a4..5ad3a44 100644 --- a/transports/Replicant/v3/ReplicantServerConfig.json +++ b/transports/Replicant/v3/ReplicantServerConfig.json @@ -1 +1 @@ -{"Replicant":{"config":"M/+JAwEBDFNlcnZlckNvbmZpZwH/igABAgEJVG9uZWJ1cnN0ARAAAQZQb2xpc2gBEAAAAP+8/4oBZmdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL3NoYXBlc2hpZnRlci10cmFuc3BvcnRzL3RyYW5zcG9ydHMvUmVwbGljYW50L3YzL3RvbmVidXJzdC5Nb25vdG9uZUNvbmZpZ/+NAwEBDk1vbm90b25lQ29uZmlnAf+OAAEDAQxBZGRTZXF1ZW5jZXMB/5AAAQ9SZW1vdmVTZXF1ZW5jZXMB/5IAAQpTcGVha0ZpcnN0AQIAAAAq/48DAQEISW5zdGFuY2UB/5AAAQIBBERlc2MB/5IAAQRBcmdzAf+WAAAAJP+RAwEBC0Rlc2NyaXB0aW9uAf+SAAEBAQVQYXJ0cwH/lAAAACH/kwIBARNbXW1vbm9saXRoLk1vbm9saXRoAf+UAAEQAAAo/5UDAQEEQXJncwH/lgABAgEGVmFsdWVzAf+YAAEFSW5kZXgBBAAAABz/lwIBAQ5bXWludGVyZmFjZSB7fQH/mAABEAAA/gHI/45iAgEBPGdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL21vbm9saXRoLWdvL21vbm9saXRoLkJ5dGVzUGFydP+ZAwEBCUJ5dGVzUGFydAH/mgABAQEFSXRlbXMB/5wAA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BAQVQYXJ0cwH/lAAAACH/kwIBARNbXW1vbm9saXRoLk1vbm9saXRoAf+UAAEQAAAo/5UDAQEEQXJncwH/lgABAgEGVmFsdWVzAf+YAAEFSW5kZXgBBAAAABz/lwIBAQ5bXWludGVyZmFjZSB7fQH/mAABEAAA/gHI/45iAgEBPGdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL21vbm9saXRoLWdvL21vbm9saXRoLkJ5dGVzUGFydP+ZAwEBCUJ5dGVzUGFydAH/mgABAQEFSXRlbXMB/5wAAAAh/5sCAQETW11tb25vbGl0aC5CeXRlVHlwZQH/nAABEAAAdP+aZwEBQGdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL21vbm9saXRoLWdvL21vbm9saXRoLkZpeGVkQnl0ZVR5cGX/nQMBAQ1GaXhlZEJ5dGVUeXBlAf+eAAEBAQRCeXRlAQYAAAAH/54DARMAAAAAAW1naXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9zaGFwZXNoaWZ0ZXItdHJhbnNwb3J0cy90cmFuc3BvcnRzL1JlcGxpY2FudC92My9wb2xpc2guU2lsdmVyUG9saXNoU2VydmVyQ29uZmln/4sDAQEYU2lsdmVyUG9saXNoU2VydmVyQ29uZmlnAf+MAAEDAQ9TZXJ2ZXJQdWJsaWNLZXkBCgABEFNlcnZlclByaXZhdGVLZXkBCgABCUNodW5rU2l6ZQEEAAAAbv+MagFBBK/Bwa0RrYc3813sA8lIx2uT7pcwEOCIYvjy/7khB1uU8eiUOlAyZdhLmkJRGzXRzoub27HOkYDK2qX35o4GhHoBIO70TnPmS+W3C3MogewTb33cx692J4C1q+hGwpx7yIwYAf4KEAAA"}} \ No newline at end of file diff --git a/transports/Replicant/v3/ReplicantServerConfig1.json b/transports/Replicant/v3/ReplicantServerConfig1.json index a34a20c..3293ef6 100644 --- a/transports/Replicant/v3/ReplicantServerConfig1.json +++ b/transports/Replicant/v3/ReplicantServerConfig1.json @@ -1 +1 @@ -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+vAQJLZ2l0aHViLmNvbS9PcGVyYXRvckZvdW5kYXRpb24vbW9ub2xpdGgtZ28vbW9ub2xpdGguUmFuZG9tRW51bWVyYXRlZEJ5dGVUeXBl/6AHAQQREhMUAEtnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5SYW5kb21FbnVtZXJhdGVkQnl0ZVR5cGX/oAcBBBESExQAAAAAAW1naXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9zaGFwZXNoaWZ0ZXItdHJhbnNwb3J0cy90cmFuc3BvcnRzL1JlcGxpY2FudC92My9wb2xpc2guU2lsdmVyUG9saXNoU2VydmVyQ29uZmln/4sDAQEYU2lsdmVyUG9saXNoU2VydmVyQ29uZmlnAf+MAAEDAQ9TZXJ2ZXJQdWJsaWNLZXkBCgABEFNlcnZlclByaXZhdGVLZXkBCgABCUNodW5rU2l6ZQEEAAAAbv+MagFBBEJ98fGbmwIH+k7KWwwZsGiUc+6wjOLA83D/9NdrfHEcJRy3TnW2FMeje4FARICqWOnubrVzpAFyUgxa1wwM0J8BIAuZ5JWpLJJ4Se3weAHCdOTXmq7Ymt3P69QFBbeVAeIIAf4JmAAA"}} \ No newline at end of file diff --git a/transports/Replicant/v3/go.mod b/transports/Replicant/v3/go.mod index 2d0d408..48fdc06 100644 --- a/transports/Replicant/v3/go.mod +++ b/transports/Replicant/v3/go.mod @@ -5,6 +5,7 @@ go 1.12 require ( github.com/OperatorFoundation/monolith-go/monolith v1.0.4 github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0 + github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/opentracing/opentracing-go v1.1.0 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/net v0.0.0-20200202094626-16171245cfb2 diff --git a/transports/Replicant/v3/go.sum b/transports/Replicant/v3/go.sum index fa3bd56..3d39d37 100644 --- a/transports/Replicant/v3/go.sum +++ b/transports/Replicant/v3/go.sum @@ -4,6 +4,8 @@ github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0 h1:6aQs+TF3KULMarpzbKu8 github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0/go.mod h1:gb/QiZH0QDXLSQ9PskyJ2oTflB7tsP4AYc8y+FppvB0= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= diff --git a/transports/Replicant/v3/replicant_test.go b/transports/Replicant/v3/replicant_test.go index 9b1b028..e1b05ae 100644 --- a/transports/Replicant/v3/replicant_test.go +++ b/transports/Replicant/v3/replicant_test.go @@ -5,6 +5,7 @@ import ( "github.com/OperatorFoundation/monolith-go/monolith" "github.com/OperatorFoundation/shapeshifter-transports/transports/Replicant/v3/polish" "github.com/OperatorFoundation/shapeshifter-transports/transports/Replicant/v3/toneburst" + "github.com/op/go-logging" "golang.org/x/net/proxy" "io/ioutil" "math/rand" @@ -183,6 +184,7 @@ func runReplicantServer() { } func runReplicantFactoryServer() { + var log = logging.MustGetLogger("replicant") serverStarted := make(chan bool) addr := "127.0.0.1:3001" @@ -191,7 +193,7 @@ func runReplicantFactoryServer() { Polish: nil, } - server := NewServer(serverConfig, addr, proxy.Direct) + server := NewServer(serverConfig, addr, proxy.Direct, log) go func() { listener, listenError := server.Listen() @@ -302,7 +304,7 @@ func replicantConnection(clientConfig ClientConfig, serverConfig ServerConfig, t func replicantFactoryConnection(clientConfig ClientConfig, serverConfig ServerConfig, t *testing.T) { serverStarted := make(chan bool) - + var log = logging.MustGetLogger("replicant") // Get a random port rand.Seed(time.Now().UnixNano()) min := 1025 @@ -313,7 +315,7 @@ func replicantFactoryConnection(clientConfig ClientConfig, serverConfig ServerCo addr += portString go func() { - server := NewServer(serverConfig, addr, proxy.Direct) + server := NewServer(serverConfig, addr, proxy.Direct, log) listener, listenError := server.Listen() if listenError != nil { return @@ -348,7 +350,7 @@ func replicantFactoryConnection(clientConfig ClientConfig, serverConfig ServerCo t.Fail() return } - client := NewClient(clientConfig, addr, proxy.Direct) + client := NewClient(clientConfig, addr, proxy.Direct, log) cConn, connErr := client.Dial() if connErr != nil { t.Fail() diff --git a/transports/meeklite/v3/go.mod b/transports/meeklite/v3/go.mod index c3fe6e7..e7e77d9 100644 --- a/transports/meeklite/v3/go.mod +++ b/transports/meeklite/v3/go.mod @@ -3,6 +3,6 @@ module github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite go 1.12 require ( - github.com/stretchr/testify v1.5.1 + github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 golang.org/x/net v0.0.0-20200202094626-16171245cfb2 ) diff --git a/transports/meeklite/v3/go.sum b/transports/meeklite/v3/go.sum index fe647ab..6ca77db 100644 --- a/transports/meeklite/v3/go.sum +++ b/transports/meeklite/v3/go.sum @@ -1,16 +1,7 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/transports/meeklite/v3/meeklite.go b/transports/meeklite/v3/meeklite.go index d5492ec..1ba28f6 100644 --- a/transports/meeklite/v3/meeklite.go +++ b/transports/meeklite/v3/meeklite.go @@ -39,6 +39,7 @@ import ( "encoding/hex" "errors" "fmt" + "github.com/op/go-logging" "golang.org/x/net/proxy" "io" "io/ioutil" @@ -127,6 +128,7 @@ type Transport struct { Front string `json:"front"` Address string Dialer proxy.Dialer + log *logging.Logger } //Config puts the parameters in a json compatible format @@ -135,8 +137,8 @@ type Config struct { Front string `json:"front"` } -func NewMeekFactoryTransportWithFront(url *gourl.URL, front string, address string, dialer proxy.Dialer) *Transport { - return &Transport{url, front, address,dialer} +func NewMeekFactoryTransportWithFront(url *gourl.URL, front string, address string, dialer proxy.Dialer, log *logging.Logger) *Transport { + return &Transport{url, front, address,dialer, log} } // Dial creates outgoing transport connection func (transport Transport) Dial() (net.Conn, error) { diff --git a/transports/meeklite/v3/meeklite_test.go b/transports/meeklite/v3/meeklite_test.go index 80bcf4f..6dd9475 100644 --- a/transports/meeklite/v3/meeklite_test.go +++ b/transports/meeklite/v3/meeklite_test.go @@ -34,6 +34,7 @@ package meeklite import ( + "github.com/op/go-logging" "golang.org/x/net/proxy" gourl "net/url" "testing" @@ -78,6 +79,7 @@ func TestMeeklite(t *testing.T) { } func TestFactoryMeeklite(t *testing.T) { + var log = logging.MustGetLogger("meeklite") //create a server urlString := "https://transport-canary-meek.appspot.com/" Url, err := gourl.Parse(urlString) @@ -86,7 +88,7 @@ func TestFactoryMeeklite(t *testing.T) { return } - config := NewMeekFactoryTransportWithFront(Url, "www.google.com", "", proxy.Direct) + config := NewMeekFactoryTransportWithFront(Url, "www.google.com", "", proxy.Direct, log) //create client buffer clientBuffer := make([]byte, 4) diff --git a/transports/meekserver/v3/go.mod b/transports/meekserver/v3/go.mod index bc18a26..9cae6a7 100644 --- a/transports/meekserver/v3/go.mod +++ b/transports/meekserver/v3/go.mod @@ -3,9 +3,9 @@ module github.com/OperatorFoundation/shapeshifter-transports/transports/meekserv go 1.12 require ( - git.torproject.org/pluggable-transports/goptlib.git v1.1.0 github.com/deckarep/golang-set v1.7.1 github.com/mufti1/interconv v0.0.0-20190313040840-d7c72925c656 + github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 golang.org/x/net v0.0.0-20200202094626-16171245cfb2 ) diff --git a/transports/meekserver/v3/go.sum b/transports/meekserver/v3/go.sum index 3bd92d5..cbdb217 100644 --- a/transports/meekserver/v3/go.sum +++ b/transports/meekserver/v3/go.sum @@ -1,9 +1,9 @@ -git.torproject.org/pluggable-transports/goptlib.git v1.1.0 h1:LMQAA8pAho+QtYrrVNimJQiINNEwcwuuD99vezD/PAo= -git.torproject.org/pluggable-transports/goptlib.git v1.1.0/go.mod h1:YT4XMSkuEXbtqlydr9+OxqFAyspUv0Gr9qhM3B++o/Q= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/mufti1/interconv v0.0.0-20190313040840-d7c72925c656 h1:p+IdebEeB9SAEH9IOJVF6oZ535bwvWqUdqWxG1UWeko= github.com/mufti1/interconv v0.0.0-20190313040840-d7c72925c656/go.mod h1:+db4NNs1NvceiftEzz0ymfu3zKLkynYukafc7llNoMs= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 h1:Sy5bstxEqwwbYs6n0/pBuxKENqOeZUgD45Gp3Q3pqLg= golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= diff --git a/transports/meekserver/v3/meekserver_test.go b/transports/meekserver/v3/meekserver_test.go index f614c4e..fe4c8a9 100644 --- a/transports/meekserver/v3/meekserver_test.go +++ b/transports/meekserver/v3/meekserver_test.go @@ -1,6 +1,7 @@ package meekserver import ( + "github.com/op/go-logging" "testing" ) @@ -28,9 +29,10 @@ func TestMeekServerListen(t *testing.T) { } func TestMeekServerFactoryListen(t *testing.T) { + var log = logging.MustGetLogger("meekserver") acmeEmail := "brandon@operatorfoundation.org" acmeHostNames := "operatorrss.com" - meekserverTransport, newError := New(false, acmeHostNames, acmeEmail,"127.0.0.1:8080", "state") + meekserverTransport, newError := New(false, acmeHostNames, acmeEmail,"127.0.0.1:8080", "state", log) if newError != nil { t.Fail() return diff --git a/transports/meekserver/v3/pt21.go b/transports/meekserver/v3/pt21.go index f1bac34..b5f268d 100644 --- a/transports/meekserver/v3/pt21.go +++ b/transports/meekserver/v3/pt21.go @@ -35,6 +35,7 @@ package meekserver import ( "errors" interconv "github.com/mufti1/interconv/package" + "github.com/op/go-logging" "golang.org/x/crypto/acme/autocert" "log" "net" @@ -55,6 +56,7 @@ type Transport struct { DisableTLS bool CertManager *autocert.Manager Address string + log *logging.Logger } //Config contains arguments formatted for a json file @@ -79,7 +81,7 @@ type fakeConn struct { writeBuffer []byte } -func New(disableTLS bool, acmeHostnamesCommas string, acmeEmail string, address string, stateDir string) (*Transport, error) { +func New(disableTLS bool, acmeHostnamesCommas string, acmeEmail string, address string, stateDir string, Log *logging.Logger) (*Transport, error) { var certManager *autocert.Manager if disableTLS { if acmeEmail != "" || acmeHostnamesCommas != "" { @@ -117,6 +119,7 @@ func New(disableTLS bool, acmeHostnamesCommas string, acmeEmail string, address DisableTLS: disableTLS, CertManager: certManager, Address: address, + log: Log, }, nil } else { return nil, errors.New("must set acmeEmail") diff --git a/transports/obfs2/v3/go.mod b/transports/obfs2/v3/go.mod index c7b2c05..b2fa78f 100644 --- a/transports/obfs2/v3/go.mod +++ b/transports/obfs2/v3/go.mod @@ -5,5 +5,6 @@ go 1.12 require ( github.com/OperatorFoundation/obfs4 v1.0.0 github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0 + github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 golang.org/x/net v0.0.0-20200226121028-0de0cce0169b ) diff --git a/transports/obfs2/v3/go.sum b/transports/obfs2/v3/go.sum index af33490..139977a 100644 --- a/transports/obfs2/v3/go.sum +++ b/transports/obfs2/v3/go.sum @@ -7,6 +7,8 @@ github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0 h1:6aQs+TF3KULMarpzbKu8 github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0/go.mod h1:gb/QiZH0QDXLSQ9PskyJ2oTflB7tsP4AYc8y+FppvB0= github.com/dchest/siphash v1.2.1 h1:4cLinnzVJDKxTCl9B01807Yiy+W7ZzVHj/KIroQRvT4= github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/willscott/goturn v0.0.0-20170802220503-19f41278d0c9/go.mod h1:PfwRjodCaQXOsHnh2DeVaXqCFCIrbn5WLj1+A5bQkD4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/transports/obfs2/v3/obfs2.go b/transports/obfs2/v3/obfs2.go index 98ca51e..36b8b0e 100644 --- a/transports/obfs2/v3/obfs2.go +++ b/transports/obfs2/v3/obfs2.go @@ -36,6 +36,7 @@ import ( "crypto/sha256" "encoding/binary" "fmt" + "github.com/op/go-logging" "io" "net" @@ -66,6 +67,7 @@ const ( type OptimizerTransport struct { Address string Dialer proxy.Dialer + log *logging.Logger } //Dial connects to a specified address. @@ -110,10 +112,11 @@ type Transport struct { } //New initializes obfs2 for Optimizer -func New(address string, dialer proxy.Dialer) *OptimizerTransport { +func New(address string, dialer proxy.Dialer, log *logging.Logger) *OptimizerTransport { result := OptimizerTransport{ Address: address, Dialer: dialer, + log: log, } return &result } diff --git a/transports/obfs2/v3/obfs2_test.go b/transports/obfs2/v3/obfs2_test.go index 5f73e1d..5145a45 100644 --- a/transports/obfs2/v3/obfs2_test.go +++ b/transports/obfs2/v3/obfs2_test.go @@ -32,6 +32,7 @@ package obfs2 import ( + "github.com/op/go-logging" "golang.org/x/net/proxy" "os" "testing" @@ -97,7 +98,8 @@ func TestObfs2WithDialer(t *testing.T) { } func TestObfs2OptimizerTransportWithDialer(t *testing.T) { - config := New("127.0.0.1:1237", proxy.Direct) + var log = logging.MustGetLogger("obfs2") + config := New("127.0.0.1:1237", proxy.Direct, log) //create client buffer clientBuffer := make([]byte, 4) //call dial on client and check error diff --git a/transports/shadow/v3/go.mod b/transports/shadow/v3/go.mod index c3db847..40c8604 100644 --- a/transports/shadow/v3/go.mod +++ b/transports/shadow/v3/go.mod @@ -4,6 +4,7 @@ go 1.12 require ( github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect + github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/shadowsocks/go-shadowsocks2 v0.0.11 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 // indirect ) diff --git a/transports/shadow/v3/go.sum b/transports/shadow/v3/go.sum index 41a91f8..e71d517 100644 --- a/transports/shadow/v3/go.sum +++ b/transports/shadow/v3/go.sum @@ -1,5 +1,7 @@ github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/shadowsocks/go-shadowsocks2 v0.0.11 h1:dXloqEhYnZV40jblWTK8kWeC0Eb+dgql4S0tj99e8j0= github.com/shadowsocks/go-shadowsocks2 v0.0.11/go.mod h1:R+KWaoIwRRhnpw6XV+dZil0XHi64Hc1D7hXUyXTjUzQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= diff --git a/transports/shadow/v3/shadow.go b/transports/shadow/v3/shadow.go index eff972a..eea4699 100644 --- a/transports/shadow/v3/shadow.go +++ b/transports/shadow/v3/shadow.go @@ -26,6 +26,7 @@ package shadow import ( + "github.com/op/go-logging" "log" "net" @@ -43,6 +44,7 @@ type Transport struct { Password string CipherName string Address string + Log *logging.Logger } //NewConfig is used to create a config for testing @@ -54,11 +56,12 @@ func NewConfig(password string, cipherName string) Config { } //NewTransport is used for creating a transport for Optimizer -func NewTransport(password string, cipherName string, address string) Transport { +func NewTransport(password string, cipherName string, address string, log *logging.Logger) Transport { return Transport{ Password: password, CipherName: cipherName, Address: address, + Log: log, } } @@ -116,4 +119,4 @@ func (transport *Transport) Listen() (net.Listener, error) { return nil, listenerErr } return listener, nil -} \ No newline at end of file +} diff --git a/transports/shadow/v3/shadow_test.go b/transports/shadow/v3/shadow_test.go index c94c9aa..92479f3 100644 --- a/transports/shadow/v3/shadow_test.go +++ b/transports/shadow/v3/shadow_test.go @@ -26,6 +26,7 @@ package shadow import ( "fmt" + "github.com/op/go-logging" "net" "os" "testing" @@ -99,7 +100,8 @@ func TestShadow(t *testing.T) { } func TestShadowFactory(t *testing.T) { //create a server - transport := NewTransport("1234", "CHACHA20-IETF-POLY1305", "127.0.0.1:1236") + var log = logging.MustGetLogger("shadow") + transport := NewTransport("1234", "CHACHA20-IETF-POLY1305", "127.0.0.1:1236", log) //create client buffer clientBuffer := make([]byte, 4)