diff --git a/transports/Dust/v3/Dust.go b/transports/Dust/v3/Dust.go index 7711e62..6d4a7b8 100644 --- a/transports/Dust/v3/Dust.go +++ b/transports/Dust/v3/Dust.go @@ -10,12 +10,12 @@ package Dust import ( "fmt" "github.com/OperatorFoundation/obfs4/common/log" - Dust "github.com/blanu/Dust/go/v2/interface" "golang.org/x/net/proxy" "net" "time" "github.com/OperatorFoundation/shapeshifter-ipc" + "github.com/blanu/Dust/go/v2/interface" ) type dustClient struct { @@ -90,20 +90,20 @@ func (transport *dustClient) Dial(address string) (net.Conn, error) { } // Create listener for incoming transport connection -func (transport *dustServer) Listen(address string) net.Listener { +func (transport *dustServer) Listen(address string) (net.Listener, error) { addr, resolveErr := pt.ResolveAddr(address) if resolveErr != nil { fmt.Println(resolveErr.Error()) - return nil + return nil, resolveErr } ln, err := net.ListenTCP("tcp", addr) if err != nil { fmt.Println(err.Error()) - return nil + return nil, err } - return newDustTransportListener(ln, transport) + return newDustTransportListener(ln, transport), nil } func (listener *dustTransportListener) Addr() net.Addr { diff --git a/transports/Dust/v3/Dust_test.go b/transports/Dust/v3/Dust_test.go index 2aaacc5..8f01c5b 100644 --- a/transports/Dust/v3/Dust_test.go +++ b/transports/Dust/v3/Dust_test.go @@ -26,8 +26,8 @@ func TestDust(t *testing.T) { } //call listen on the server - serverListener := serverConfig.Listen("127.0.0.1:1234") - if serverListener == nil { + serverListener, listenErr := serverConfig.Listen("127.0.0.1:1234") + if listenErr != nil { t.Fail() return } diff --git a/transports/Optimizer/v3/Optimizer_test.go b/transports/Optimizer/v3/Optimizer_test.go index 83fa3a9..469ba32 100644 --- a/transports/Optimizer/v3/Optimizer_test.go +++ b/transports/Optimizer/v3/Optimizer_test.go @@ -21,7 +21,10 @@ const data = "test" func TestMain(m *testing.M) { config := shadow.NewConfig("1234", "CHACHA20-IETF-POLY1305") - listener := config.Listen("127.0.0.1:1235") + listener, listenErr := config.Listen("127.0.0.1:1235") + if listenErr != nil { + return + } go acceptConnections(listener) _ = obfs4.RunLocalObfs4Server("test") @@ -294,8 +297,8 @@ func RunLocalObfs2Server() { config := obfs2.NewObfs2Transport() //call listen on the server - serverListener := config.Listen("127.0.0.1:1237") - if serverListener == nil { + serverListener, listenErr := config.Listen("127.0.0.1:1237") + if listenErr != nil { return } diff --git a/transports/Optimizer/v3/go.mod b/transports/Optimizer/v3/go.mod index 64e38d3..6dea4f9 100644 --- a/transports/Optimizer/v3/go.mod +++ b/transports/Optimizer/v3/go.mod @@ -3,9 +3,9 @@ module github.com/OperatorFoundation/shapeshifter-transports/transports/Optimize go 1.12 require ( - github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v3 v3.0.0 - github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2/v3 v3.0.0 - github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v3 v3.0.0 - github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v3 v3.0.0 + github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v3 v3.0.1 + github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2/v3 v3.0.1 + github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v3 v3.0.1 + github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v3 v3.0.1 golang.org/x/net v0.0.0-20200226121028-0de0cce0169b ) diff --git a/transports/Optimizer/v3/go.sum b/transports/Optimizer/v3/go.sum index 975af23..4a8ffb2 100644 --- a/transports/Optimizer/v3/go.sum +++ b/transports/Optimizer/v3/go.sum @@ -9,16 +9,20 @@ github.com/OperatorFoundation/shapeshifter-transports v0.0.0-20200211223228-5b0a github.com/OperatorFoundation/shapeshifter-transports v0.0.0-20200211223228-5b0aa21018a5/go.mod h1:u3jvRgYV13oHabVAdXekh3yk9PHfpCKvB8uolQEs4jA= github.com/OperatorFoundation/shapeshifter-transports/transports/Optimizer/v2 v2.1.12/go.mod h1:+A6vQ50ZAHi76GOGtpH730VFirwb1p8E6VJM8M50gNk= github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v2 v2.1.11/go.mod h1:yPCbCoTjLIG+p0xiuRDwW5t+DivxTHqGU5njf89AkHY= -github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v2 v2.1.22 h1:BuiRy5QWa5hI3dNcOGw/Co4GYpU3PONrjrAlUB3pzt4= -github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v2 v2.1.22/go.mod h1:DEfaE6lfJKEG5CkCRks4rXTMi1xYwbYR0sa+JKsgsr0= -github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2/v2 v2.1.22 h1:ygZ3s1ROaeyfrIjIo1pFAiq73UtOv8iBxZtV5MGZjVc= -github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2/v2 v2.1.22/go.mod h1:S2qmYjCQzB7XGJ5JMuVDTp2IbQveaAhXQ9BVOx+6KD8= +github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v2 v2.1.25 h1:A8e22dUVgKa+wV8uk0rDMiWrKPYSuwt/Dsi1amNQrIA= +github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v2 v2.1.25/go.mod h1:DEfaE6lfJKEG5CkCRks4rXTMi1xYwbYR0sa+JKsgsr0= +github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v3 v3.0.0/go.mod h1:/bbH9BHoTGrmFJFBAYn0NKxQY2C8Au3ZC+IMiSsh42Y= +github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2/v2 v2.1.25 h1:+Bhvplcf7BNuSoFZ3d0zGAxjP0DyIsHyYQSb0eB6h+k= +github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2/v2 v2.1.25/go.mod h1:S2qmYjCQzB7XGJ5JMuVDTp2IbQveaAhXQ9BVOx+6KD8= +github.com/OperatorFoundation/shapeshifter-transports/transports/obfs2/v3 v3.0.0/go.mod h1:3ZXeGsk1VvTnKpSpH44BukvnWm611AM4l5mcrK35k9k= github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v2 v2.1.11/go.mod h1:OUFBnkMmjMHTWqEQlanDOMTgBjU5QARjklwQv9Qovr4= -github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v2 v2.1.22 h1:WIs1AFLM7qNWcO6QEksWdldnH2H4WXaD5d25iogN8Nk= -github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v2 v2.1.22/go.mod h1:OUFBnkMmjMHTWqEQlanDOMTgBjU5QARjklwQv9Qovr4= +github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v2 v2.1.25 h1:s0PD5dU56PjMOJT3EYVDxQMx32ylNCZUbyEP1LavVpg= +github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v2 v2.1.25/go.mod h1:OUFBnkMmjMHTWqEQlanDOMTgBjU5QARjklwQv9Qovr4= +github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4/v3 v3.0.0/go.mod h1:x62zTwzgTsuG316sGLBc35ijWiJ4a9gSDbLIcvGNZr4= github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v2 v2.1.11/go.mod h1:GN8ahnEHVGcPbR0raxdpWekjgElppspPNAAOpmNxQxU= -github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v2 v2.1.22 h1:F7YHfgEJ2Nq4f4XQFiXI4uMueuZGlQbEIdEIhN2b60s= -github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v2 v2.1.22/go.mod h1:GN8ahnEHVGcPbR0raxdpWekjgElppspPNAAOpmNxQxU= +github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v2 v2.1.25 h1:dCvYI1J7t01UrsJfNpU7kPaRwj2EqZmL3n5Hqam9xEU= +github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v2 v2.1.25/go.mod h1:GN8ahnEHVGcPbR0raxdpWekjgElppspPNAAOpmNxQxU= +github.com/OperatorFoundation/shapeshifter-transports/transports/shadow/v3 v3.0.0/go.mod h1:UBXOdrFoTJKCq9bd5ae+u95S0YPtH+I70IHbVw+qjnQ= 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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/transports/Replicant/v3/ReplicantClientConfig.json b/transports/Replicant/v3/ReplicantClientConfig.json index 74bb73f..c75cf9e 100644 --- a/transports/Replicant/v3/ReplicantClientConfig.json +++ b/transports/Replicant/v3/ReplicantClientConfig.json @@ -1 +1 @@ -{"config":"M/+BAwEBDENsaWVudENvbmZpZwH/ggABAgEJVG9uZWJ1cnN0ARAAAQZQb2xpc2gBEAAAAP+8/4IBZmdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL3NoYXBlc2hpZnRlci10cmFuc3BvcnRzL3RyYW5zcG9ydHMvUmVwbGljYW50L3YyL3RvbmVidXJzdC5Nb25vdG9uZUNvbmZpZ/+NAwEBDk1vbm90b25lQ29uZmlnAf+OAAEDAQxBZGRTZXF1ZW5jZXMB/5AAAQ9SZW1vdmVTZXF1ZW5jZXMB/5IAAQpTcGVha0ZpcnN0AQIAAAAq/48DAQEISW5zdGFuY2UB/5AAAQIBBERlc2MB/5IAAQRBcmdzAf+WAAAAJP+RAwEBC0Rlc2NyaXB0aW9uAf+SAAEBAQVQYXJ0cwH/lAAAACH/kwIBARNbXW1vbm9saXRoLk1vbm9saXRoAf+UAAEQAAAo/5UDAQEEQXJncwH/lgABAgEGVmFsdWVzAf+YAAEFSW5kZXgBBAAAABz/lwIBAQ5bXWludGVyZmFjZSB7fQH/mAABEAAA/gG5/45jAQEBATxnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5CeXRlc1BhcnT/mQMBAQlCeXRlc1BhcnQB/5oAAQEBBUl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EQAAAo/5UDAQEEQXJncwH/lgABAgEGVmFsdWVzAf+YAAEFSW5kZXgBBAAAABz/lwIBAQ5bXWludGVyZmFjZSB7fQH/mAABEAAA/gG5/45jAQEBATxnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5CeXRlc1BhcnT/mQMBAQlCeXRlc1BhcnQB/5oAAQEBBUl0ZW1zAf+cAAAAIf+bAgEBE1tdbW9ub2xpdGguQnl0ZVR5cGUB/5wAARAAAHn/mmcBAUBnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5GaXhlZEJ5dGVUeXBl/50DAQENRml4ZWRCeXRlVHlwZQH/ngABAQEEQnl0ZQEGAAAAB/+eAwETAAAAAQAAAgEAAW1naXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9zaGFwZXNoaWZ0ZXItdHJhbnNwb3J0cy90cmFuc3BvcnRzL1JlcGxpY2FudC92Mi9wb2xpc2guU2lsdmVyUG9saXNoQ2xpZW50Q29uZmln/4cDAQEYU2lsdmVyUG9saXNoQ2xpZW50Q29uZmlnAf+IAAECAQ9TZXJ2ZXJQdWJsaWNLZXkBCgABCUNodW5rU2l6ZQEEAAAATP+ISAFBBOC0bmC6fLUPXiHE00MxBSHmK8AuL74xhbkrKm1ClLjNGFBVahobB3nWq06TEl/GmGC72MbHk2RAb4s5bIBYqv8B/go+AAA="} \ No newline at end of file diff --git a/transports/Replicant/v3/ReplicantClientConfig1.json b/transports/Replicant/v3/ReplicantClientConfig1.json index 7de0974..ba436ee 100644 --- a/transports/Replicant/v3/ReplicantClientConfig1.json +++ b/transports/Replicant/v3/ReplicantClientConfig1.json @@ -1 +1 @@ -{"config":"M/+BAwEBDENsaWVudENvbmZpZwH/ggABAgEJVG9uZWJ1cnN0ARAAAQZQb2xpc2gBEAAAAP+8/4IBZmdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9u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0ZVR5cGX/oAcBBBESExQAAAABAQABbWdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL3NoYXBlc2hpZnRlci10cmFuc3BvcnRzL3RyYW5zcG9ydHMvUmVwbGljYW50L3YyL3BvbGlzaC5TaWx2ZXJQb2xpc2hDbGllbnRDb25maWf/hwMBARhTaWx2ZXJQb2xpc2hDbGllbnRDb25maWcB/4gAAQIBD1NlcnZlclB1YmxpY0tleQEKAAEJQ2h1bmtTaXplAQQAAABM/4hIAUEEQWfb8pahGIPAueYdNyrFn/Bpl/tk+2kA/lzW7syF7AbqMIT0kGD8UskSh15h4mADnffIfwQZwfHMHdDl4zLewAH+DAgAAA=="} \ No newline at end of file diff --git a/transports/Replicant/v3/ReplicantServerConfig.json b/transports/Replicant/v3/ReplicantServerConfig.json index db61447..3a551f7 100644 --- a/transports/Replicant/v3/ReplicantServerConfig.json +++ b/transports/Replicant/v3/ReplicantServerConfig.json @@ -1 +1 @@ -{"Replicant":{"config":"M/+JAwEBDFNlcnZlckNvbmZpZwH/igABAgEJVG9uZWJ1cnN0ARAAAQZQb2xpc2gBEAAAAP+8/4oBZmdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL3NoYXBlc2hpZnRlci10cmFuc3BvcnRzL3RyYW5zcG9ydHMvUmVwbGljYW50L3YyL3RvbmVidXJzdC5Nb25vdG9uZUNvbmZpZ/+NAwEBDk1vbm90b25lQ29uZmlnAf+OAAEDAQxBZGRTZXF1ZW5jZXMB/5AAAQ9SZW1vdmVTZXF1ZW5jZXMB/5IAAQpTcGVha0ZpcnN0AQIAAAAq/48DAQEISW5zdGFuY2UB/5AAAQIBBERlc2MB/5IAAQRBcmdzAf+WAAAAJP+RAwEBC0Rlc2NyaXB0aW9uAf+SAAEBAQVQYXJ0cwH/lAAAACH/kwIBARNbXW1vbm9saXRoLk1vbm9saXRoAf+UAAEQAAAo/5UDAQEEQXJncwH/lgABAgEGVmFsdWVzAf+YAAEFSW5kZXg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3rjM8fq5VTxcnx8IcH1XbqwAf4KPgAA"}} \ No newline at end of file diff --git a/transports/Replicant/v3/ReplicantServerConfig1.json b/transports/Replicant/v3/ReplicantServerConfig1.json index 7b00a7b..322368d 100644 --- a/transports/Replicant/v3/ReplicantServerConfig1.json +++ b/transports/Replicant/v3/ReplicantServerConfig1.json @@ -1 +1 @@ -{"Replicant":{"config":"M/+JAwEBDFNlcnZlckNvbmZpZwH/igABAgEJVG9uZWJ1cnN0ARAAAQZQb2xpc2gBEAAAAP+8/4oBZmdpdGh1Yi5jb20vT3BlcmF0b3JGb3VuZGF0aW9uL3NoYXBlc2hpZnRlci10cmFuc3BvcnRzL3RyYW5zcG9ydHMvUmVwbGljYW50L3YyL3RvbmVidXJzdC5Nb25vdG9uZUNvbmZpZ/+NAwEBDk1vbm90b25lQ29uZmlnAf+OAAEDAQxBZGRTZXF1ZW5jZXMB/5AAAQ9SZW1vdmVTZXF1ZW5jZXMB/5IAAQpTcGVha0ZpcnN0AQIAAAAq/48DAQEISW5zdGFuY2UB/5AAAQIBBERlc2MB/5IAAQRBcmdzAf+WAAAAJP+RAwEBC0Rlc2NyaXB0aW9uAf+SAAEBAQVQYXJ0cwH/lAAAACH/kwIBARNbXW1vbm9saXRoLk1vbm9saXRoAf+UAAEQAAAo/5UDAQEEQXJncwH/lgABAgEGVmFsdWVzAf+YAAEFSW5kZXgBBAAAABz/lwIBAQ5bXWludGVyZmFjZSB7fQH/mAABEAAA/gUc/45jAQEBAjxnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5CeXRlc1BhcnT/mQMBAQlCeXRlc1BhcnQB/5oAAQEBBUl0ZW1zAf+cAAAAIf+bAgEBE1tdbW9ub2xpdGguQnl0ZVR5cGUB/5wAARAAAP4Dxf+a/4YBAktnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5SYW5kb21FbnVtZXJhdGVkQn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hMUAEtnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5SYW5kb21FbnVtZXJhdGVkQnl0ZVR5cGX/oAcBBBESExQAADxnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5CeXRlc1BhcnT/mv+vAQJLZ2l0aHViLmNvbS9PcGVyYXRvckZvdW5kYXRpb24vbW9ub2xpdGgtZ28vbW9ub2xpdGguUmFuZG9tRW51bWVyYXRlZEJ5dGVUeXBl/6AHAQQREhMUAEtnaXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9tb25vbGl0aC1nby9tb25vbGl0aC5SYW5kb21FbnVtZXJhdGVkQnl0ZVR5cGX/oAcBBBESExQAAAAAAW1naXRodWIuY29tL09wZXJhdG9yRm91bmRhdGlvbi9zaGFwZXNoaWZ0ZXItdHJhbnNwb3J0cy90cmFuc3BvcnRzL1JlcGxpY2FudC92Mi9wb2xpc2guU2lsdmVyUG9saXNoU2VydmVyQ29uZmln/4sDAQEYU2lsdmVyUG9saXNoU2VydmVyQ29uZmlnAf+MAAEDAQ9TZXJ2ZXJQdWJsaWNLZXkBCgABEFNlcnZlclByaXZhdGVLZXkBCgABCUNodW5rU2l6ZQEEAAAAbv+MagFBBEFn2/KWoRiDwLnmHTcqxZ/waZf7ZPtpAP5c1u7MhewG6jCE9JBg/FLJEodeYeJgA533yH8EGcHxzB3Q5eMy3sABILO3MRLki0bDKBvrchjhDV4R/RJWZpj7NngFWTIdDW7PAf4MCAAA"}} \ No newline at end of file diff --git a/transports/Replicant/v3/go.sum b/transports/Replicant/v3/go.sum index 179b733..c0b8e63 100644 --- a/transports/Replicant/v3/go.sum +++ b/transports/Replicant/v3/go.sum @@ -9,7 +9,6 @@ github.com/OperatorFoundation/monolith-go/monolith v1.0.4/go.mod h1:qc60ZvCt83Jn github.com/OperatorFoundation/shapeshifter-ipc v0.0.0-20170814234159-11746ba927e0 h1:zDYt6FDJwDSX4woVFVK2EMt7fkxU5L5qDNLUjQwA+BQ= github.com/OperatorFoundation/shapeshifter-ipc v0.0.0-20170814234159-11746ba927e0/go.mod h1:kB00Ak8Dgn1uZlZHLc/WsUta58Jc+n/ZhCetcPkh42Q= github.com/OperatorFoundation/shapeshifter-transports v2.1.5+incompatible h1:1S3doS1jE/2X0FTiJWakrZVAmknj2IqZ1XL46zBA0XM= -github.com/OperatorFoundation/shapeshifter-transports v2.1.27+incompatible h1:fSIxaLi4g+EPDmb5Ps89wnyWnq57wBhSjV2LfdUMtlE= github.com/OperatorFoundation/shapeshifter-transports/transports v0.0.0-20200218224946-cac72fbc8eb3 h1:D0oWnlYienV6VqTbeGPL4YYJoqCeK6kvBOS2wMv5Brk= 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= diff --git a/transports/Replicant/v3/polish/silver.go b/transports/Replicant/v3/polish/silver.go index 194e690..132dac1 100644 --- a/transports/Replicant/v3/polish/silver.go +++ b/transports/Replicant/v3/polish/silver.go @@ -151,6 +151,8 @@ func NewSilverClient(config SilverPolishClientConfig) (Connection, error) { } func X963KDF(sharedKeySeed []byte, ephemeralPublicKey []byte) []byte { + + //FIXME: Is this a correct X963 KDF length := 32 output := make([]byte, 0) outlen := 0 diff --git a/transports/Replicant/v3/pt21.go b/transports/Replicant/v3/pt21.go index f17d7bf..e0d0f2c 100644 --- a/transports/Replicant/v3/pt21.go +++ b/transports/Replicant/v3/pt21.go @@ -7,10 +7,10 @@ import ( ) // Create outgoing transport connection -func (config ClientConfig) Dial(address string) net.Conn { +func (config ClientConfig) Dial(address string) (net.Conn, error) { conn, dialErr := net.Dial("tcp", address) if dialErr != nil { - return nil + return nil, dialErr } transportConn, err := NewClientConnection(conn, config) @@ -18,25 +18,25 @@ func (config ClientConfig) Dial(address string) net.Conn { if conn != nil { _ = conn.Close() } - return nil + return nil, err } - return transportConn + return transportConn, nil } // Create listener for incoming transport connection -func (config ServerConfig) Listen(address string) net.Listener { +func (config ServerConfig) Listen(address string) (net.Listener, error) { addr, resolveErr := pt.ResolveAddr(address) if resolveErr != nil { - return nil + return nil, resolveErr } ln, err := net.ListenTCP("tcp", addr) if err != nil { - return nil + return nil, err } - return newReplicantTransportListener(ln, config) + return newReplicantTransportListener(ln, config), nil } func (listener *replicantTransportListener) Addr() net.Addr { diff --git a/transports/Replicant/v3/replicant_test.go b/transports/Replicant/v3/replicant_test.go index a40b502..7289b6c 100644 --- a/transports/Replicant/v3/replicant_test.go +++ b/transports/Replicant/v3/replicant_test.go @@ -148,7 +148,7 @@ func runReplicantServer() { } go func() { - listener := serverConfig.Listen(addr) + listener, _ := serverConfig.Listen(addr) serverStarted <- true lConn, lConnError := listener.Accept() @@ -194,7 +194,7 @@ func replicantConnection(clientConfig ClientConfig, serverConfig ServerConfig, t addr += portString go func() { - listener := serverConfig.Listen(addr) + listener, _ := serverConfig.Listen(addr) serverStarted <- true lConn, lConnError := listener.Accept() @@ -226,8 +226,8 @@ func replicantConnection(clientConfig ClientConfig, serverConfig ServerConfig, t return } - cConn := clientConfig.Dial(addr) - if cConn == nil { + cConn, connErr := clientConfig.Dial(addr) + if connErr != nil { t.Fail() return } diff --git a/transports/meeklite/v3/go.mod b/transports/meeklite/v3/go.mod index 36d48f9..c3fe6e7 100644 --- a/transports/meeklite/v3/go.mod +++ b/transports/meeklite/v3/go.mod @@ -3,5 +3,6 @@ module github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite go 1.12 require ( + github.com/stretchr/testify v1.5.1 golang.org/x/net v0.0.0-20200202094626-16171245cfb2 ) diff --git a/transports/meeklite/v3/meeklite.go b/transports/meeklite/v3/meeklite.go index 21d4002..9a8a765 100644 --- a/transports/meeklite/v3/meeklite.go +++ b/transports/meeklite/v3/meeklite.go @@ -95,19 +95,19 @@ func (transport *MeekTransport) NetworkDialer() proxy.Dialer { } // Dial creates outgoing transport connection -func (transport *MeekTransport) Dial() net.Conn { +func (transport *MeekTransport) Dial() (net.Conn, error) { // FIXME - should use dialer transportConn, err := newMeekClientConn(transport.clientArgs) if err != nil { - return nil + return nil, err } - return transportConn + return transportConn, nil } // Listen for the meek transport does not have a corresponding server, only a client -func (transport *MeekTransport) Listen() net.Listener { - return nil +func (transport *MeekTransport) Listen() (net.Listener, error) { + return nil, nil } // End methods that implement the base.Transport interface @@ -138,8 +138,12 @@ type Config struct { // Dial creates outgoing transport connection func (transport Transport) Dial() (net.Conn, error) { meekTransport := NewMeekTransportWithFront(transport.URL.String(), transport.Front, transport.Dialer) - conn := meekTransport.Dial() - return conn, nil + conn, dialErr := meekTransport.Dial() + if dialErr != nil { + return nil, errors.New("failed to dial") + } else { + return conn, nil + } } func (ca *meekClientArgs) String() string { diff --git a/transports/meeklite/v3/meeklite_test.go b/transports/meeklite/v3/meeklite_test.go index b26d710..c26342a 100644 --- a/transports/meeklite/v3/meeklite_test.go +++ b/transports/meeklite/v3/meeklite_test.go @@ -47,8 +47,8 @@ func TestMeeklite(t *testing.T) { //create client buffer clientBuffer := make([]byte, 4) //call dial on client and check error - clientConn := config.Dial() - if clientConn == nil { + clientConn, connErr := config.Dial() + if connErr != nil { t.Fail() return } diff --git a/transports/meekserver/v3/go.mod b/transports/meekserver/v3/go.mod index b3ae1e8..bc18a26 100644 --- a/transports/meekserver/v3/go.mod +++ b/transports/meekserver/v3/go.mod @@ -3,6 +3,7 @@ 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 golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 diff --git a/transports/meekserver/v3/meekserver_test.go b/transports/meekserver/v3/meekserver_test.go index 0f7788f..82607d2 100644 --- a/transports/meekserver/v3/meekserver_test.go +++ b/transports/meekserver/v3/meekserver_test.go @@ -21,8 +21,8 @@ func TestMeekServerListen2(t *testing.T) { t.Fail() return } - listener := meekserverTransport.Listen("127.0.0.1:8080") - if listener == nil { + _, listenErr := meekserverTransport.Listen("127.0.0.1:8080") + if listenErr != nil { t.Fail() return } diff --git a/transports/meekserver/v3/pt21.go b/transports/meekserver/v3/pt21.go index 9aa7242..072b63e 100644 --- a/transports/meekserver/v3/pt21.go +++ b/transports/meekserver/v3/pt21.go @@ -188,13 +188,13 @@ func NewMeekTransportServer(disableTLS bool, acmeEmail string, acmeHostnamesComm // Methods that implement the base.Transport interface // Listen on the meek transport does not have a corresponding server, only a client -func (transport *MeekServer) Listen(address string) net.Listener { +func (transport *MeekServer) Listen(address string) (net.Listener, error) { var ln net.Listener var state *State var err error addr, resolverr := net.ResolveTCPAddr("tcp", address) if resolverr != nil { - return ln + return ln, resolverr } acmeAddr := net.TCPAddr{ IP: addr.IP, @@ -206,7 +206,7 @@ func (transport *MeekServer) Listen(address string) net.Listener { lnHTTP01, err := net.ListenTCP("tcp", &acmeAddr) if err != nil { log.Printf("error opening HTTP-01 ACME listener: %s", err) - return nil + return nil, err } go func() { log.Fatal(http.Serve(lnHTTP01, transport.CertManager.HTTPHandler(nil))) @@ -219,7 +219,7 @@ func (transport *MeekServer) Listen(address string) net.Listener { } if err != nil { - return nil + return nil, err } - return meekListener{server, state} + return meekListener{server, state}, nil } diff --git a/transports/obfs2/v3/go.mod b/transports/obfs2/v3/go.mod index ce72adc..e8e146c 100644 --- a/transports/obfs2/v3/go.mod +++ b/transports/obfs2/v3/go.mod @@ -5,5 +5,7 @@ go 1.12 require ( github.com/OperatorFoundation/obfs4 v1.0.0 github.com/OperatorFoundation/shapeshifter-ipc v0.0.0-20170814234159-11746ba927e0 + github.com/OperatorFoundation/shapeshifter-transports v0.0.0-20200211223228-5b0aa21018a5 + github.com/OperatorFoundation/shapeshifter-transports/transports/Optimizer/v2 v2.1.12 golang.org/x/net v0.0.0-20200226121028-0de0cce0169b ) diff --git a/transports/obfs2/v3/obfs2.go b/transports/obfs2/v3/obfs2.go index 1052fe7..58f9c22 100644 --- a/transports/obfs2/v3/obfs2.go +++ b/transports/obfs2/v3/obfs2.go @@ -147,20 +147,20 @@ func (transport *Transport) Dial(address string) (net.Conn, error) { } // Listen creates listener for incoming transport connection -func (transport *Transport) Listen(address string) net.Listener { +func (transport *Transport) Listen(address string) (net.Listener, error) { addr, resolveErr := pt.ResolveAddr(address) if resolveErr != nil { fmt.Println(resolveErr.Error()) - return nil + return nil, resolveErr } ln, err := net.ListenTCP("tcp", addr) if err != nil { fmt.Println(err.Error()) - return nil + return nil, err } - return newObfs2TransportListener(ln) + return newObfs2TransportListener(ln), nil } // Methods that implement the net.Conn interface diff --git a/transports/obfs2/v3/obfs2_test.go b/transports/obfs2/v3/obfs2_test.go index c118e07..5f73e1d 100644 --- a/transports/obfs2/v3/obfs2_test.go +++ b/transports/obfs2/v3/obfs2_test.go @@ -127,8 +127,8 @@ func RunLocalObfs2Server() { config := NewObfs2Transport() //call listen on the server - serverListener := config.Listen("127.0.0.1:1237") - if serverListener == nil { + serverListener, listenErr := config.Listen("127.0.0.1:1237") + if listenErr != nil { return } diff --git a/transports/obfs4/v3/obfs4.go b/transports/obfs4/v3/obfs4.go index 6e896db..7773462 100644 --- a/transports/obfs4/v3/obfs4.go +++ b/transports/obfs4/v3/obfs4.go @@ -229,20 +229,20 @@ func (transport OptimizerTransport) Dial() (net.Conn, error) { } // Listen creates listener for incoming transport connection -func (transport *Transport) Listen(address string) net.Listener { +func (transport *Transport) Listen(address string) (net.Listener, error) { addr, resolveErr := pt.ResolveAddr(address) if resolveErr != nil { fmt.Println(resolveErr.Error()) - return nil + return nil, resolveErr } ln, err := net.ListenTCP("tcp", addr) if err != nil { fmt.Println(err.Error()) - return nil + return nil, err } - return newObfs4TransportListener(transport.serverFactory, ln) + return newObfs4TransportListener(transport.serverFactory, ln), nil } // Close closes the transport listener. diff --git a/transports/obfs4/v3/test_utils.go b/transports/obfs4/v3/test_utils.go index ce8484f..19726b6 100644 --- a/transports/obfs4/v3/test_utils.go +++ b/transports/obfs4/v3/test_utils.go @@ -34,8 +34,8 @@ func RunLocalObfs4Server(data string) bool { return false } //call listen on the server - serverListener := serverConfig.Listen("127.0.0.1:1234") - if serverListener == nil { + serverListener, listenErr := serverConfig.Listen("127.0.0.1:1234") + if listenErr != nil { return false } //Create Server connection and format it for concurrency diff --git a/transports/shadow/v3/shadow.go b/transports/shadow/v3/shadow.go index c1bbb05..f876c07 100644 --- a/transports/shadow/v3/shadow.go +++ b/transports/shadow/v3/shadow.go @@ -63,19 +63,19 @@ func NewTransport(password string, cipherName string, address string) Transport } //Listen checks for a working connection -func (config Config) Listen(address string) net.Listener { +func (config Config) Listen(address string) (net.Listener, error) { cipher, err := shadowsocks.PickCipher(config.CipherName, nil, config.Password) if err != nil { log.Fatal("Failed generating ciphers:", err) - return nil + return nil, err } listener, listenerErr := shadowsocks.Listen("tcp", address, cipher) if listenerErr != nil { log.Fatal("Failed to start listener:", listenerErr) - return nil + return nil, listenerErr } - return listener + return listener, nil } //Dial connects to the address on the named network diff --git a/transports/shadow/v3/shadow_test.go b/transports/shadow/v3/shadow_test.go index fb05dd1..56ca9cf 100644 --- a/transports/shadow/v3/shadow_test.go +++ b/transports/shadow/v3/shadow_test.go @@ -35,7 +35,10 @@ const data = "test" func TestMain(m *testing.M) { config := NewConfig("1234", "CHACHA20-IETF-POLY1305") - listener := config.Listen("127.0.0.1:1236") + listener, listenErr := config.Listen("127.0.0.1:1236") + if listenErr != nil { + return + } go acceptConnections(listener) os.Exit(m.Run())