Просмотр исходного кода

Switch gotapdance repos

- Switch from github.com/sergeyfrolov/gotapdance to
  github.com/refraction-networking/gotapdance.

- Temporary patch in 5c9ed3f is now upstream.
Rod Hynes 6 лет назад
Родитель
Сommit
819826af09

+ 1 - 1
psiphon/common/tapdance/tapdance.go

@@ -41,7 +41,7 @@ import (
 
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common"
 	"github.com/armon/go-proxyproto"
-	refraction_networking_tapdance "github.com/sergeyfrolov/gotapdance/tapdance"
+	refraction_networking_tapdance "github.com/refraction-networking/gotapdance/tapdance"
 )
 
 const (

+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/LICENSE → vendor/github.com/refraction-networking/gotapdance/LICENSE


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/README.md → vendor/github.com/refraction-networking/gotapdance/README.md


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/protobuf/README.md → vendor/github.com/refraction-networking/gotapdance/protobuf/README.md


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/protobuf/extensions.go → vendor/github.com/refraction-networking/gotapdance/protobuf/extensions.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/protobuf/signalling.pb.go → vendor/github.com/refraction-networking/gotapdance/protobuf/signalling.pb.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/protobuf/signalling.proto → vendor/github.com/refraction-networking/gotapdance/protobuf/signalling.proto


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/TODO → vendor/github.com/refraction-networking/gotapdance/tapdance/TODO


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/assets.go → vendor/github.com/refraction-networking/gotapdance/tapdance/assets.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/common.go → vendor/github.com/refraction-networking/gotapdance/tapdance/common.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/conn_dual.go → vendor/github.com/refraction-networking/gotapdance/tapdance/conn_dual.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/conn_flow.go → vendor/github.com/refraction-networking/gotapdance/tapdance/conn_flow.go


+ 10 - 14
vendor/github.com/sergeyfrolov/gotapdance/tapdance/conn_raw.go → vendor/github.com/refraction-networking/gotapdance/tapdance/conn_raw.go

@@ -32,11 +32,11 @@ type tdRawConn struct {
 
 	TcpDialer func(context.Context, string, string) (net.Conn, error)
 
-	decoySpec     pb.TLSDecoySpec
-	pinDecoySpec  bool // don't ever change decoy (still changeable from outside)
-	initialMsg    pb.StationToClient
-	stationPubkey []byte
-	tagType       tdTagType
+	decoySpec            pb.TLSDecoySpec
+	pinDecoySpec         bool // don't ever change decoy (still changeable from outside)
+	initialMsg           pb.StationToClient
+	defaultStationPubkey []byte // this pubkey is used if the per-decoy key (tdRaw.decoySpec.Pubkey.Key) is not set
+	tagType              tdTagType
 
 	remoteConnId []byte // 32 byte ID of the connection to station, used for reconnection
 
@@ -58,7 +58,7 @@ type tdRawConn struct {
 
 func makeTdRaw(handshakeType tdTagType, stationPubkey []byte) *tdRawConn {
 	tdRaw := &tdRawConn{tagType: handshakeType,
-		stationPubkey: stationPubkey,
+		defaultStationPubkey: stationPubkey,
 	}
 	tdRaw.closed = make(chan struct{})
 	return tdRaw
@@ -388,14 +388,10 @@ func (tdRaw *tdRawConn) prepareTDRequest(handshakeType tdTagType) (string, error
 	}
 	Logger().Debugln(tdRaw.idStr()+" Initial protobuf", initProto)
 
-	// [Psiphon]
-	// Use decoy spec public key if available; otherwise, default public key.
-	var pubkey []byte
-	if tdRaw.decoySpec.Pubkey != nil {
-		pubkey = tdRaw.decoySpec.Pubkey.GetKey()
-	}
-	if len(pubkey) == 0 {
-		pubkey = tdRaw.stationPubkey
+	// Choose the station pubkey
+	pubkey := tdRaw.defaultStationPubkey
+	if perDecoyKey := tdRaw.decoySpec.GetPubkey().GetKey(); perDecoyKey != nil {
+		pubkey = perDecoyKey // per-decoy key takes preference over default global pubkey
 	}
 
 	// Obfuscate/encrypt tag and protobuf

+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/counter.go → vendor/github.com/refraction-networking/gotapdance/tapdance/counter.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/dialer.go → vendor/github.com/refraction-networking/gotapdance/tapdance/dialer.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/logger.go → vendor/github.com/refraction-networking/gotapdance/tapdance/logger.go


+ 0 - 0
vendor/github.com/sergeyfrolov/gotapdance/tapdance/utils.go → vendor/github.com/refraction-networking/gotapdance/tapdance/utils.go


+ 18 - 18
vendor/vendor.json

@@ -487,6 +487,24 @@
 			"revisionTime": "2018-08-18T17:28:07Z",
 			"tree": true
 		},
+		{
+			"checksumSHA1": "ZZTPdAqg8gqXyRc0MHQsZAI/S1o=",
+			"path": "github.com/refraction-networking/gotapdance",
+			"revision": "4d84655dad2e242b0af0459c31f687b12085dcca",
+			"revisionTime": "2019-09-06T18:47:05Z"
+		},
+		{
+			"checksumSHA1": "Owt8RxloT1XD/WUE2Ih1JX5+KTc=",
+			"path": "github.com/refraction-networking/gotapdance/protobuf",
+			"revision": "4d84655dad2e242b0af0459c31f687b12085dcca",
+			"revisionTime": "2019-09-06T18:47:05Z"
+		},
+		{
+			"checksumSHA1": "fCJyFbCVKmJ4PlNUrfFcDGcSs2I=",
+			"path": "github.com/refraction-networking/gotapdance/tapdance",
+			"revision": "4d84655dad2e242b0af0459c31f687b12085dcca",
+			"revisionTime": "2019-09-06T18:47:05Z"
+		},
 		{
 			"checksumSHA1": "S5FV5qBbMksx0vxajWD94J2KeHw=",
 			"path": "github.com/refraction-networking/utls",
@@ -511,24 +529,6 @@
 			"revision": "94e85abb850729a5f54f383e8175e62931d04748",
 			"revisionTime": "2018-09-03T21:38:11Z"
 		},
-		{
-			"checksumSHA1": "bwonlVmjpR4hyzaTtBBYD+m+Sdo=",
-			"path": "github.com/sergeyfrolov/gotapdance",
-			"revision": "f30ba05c9bd842d4221ccb73645fe2a0e1a0e1f6",
-			"revisionTime": "2019-03-18T20:34:37Z"
-		},
-		{
-			"checksumSHA1": "sna/Yemp1kUaSkmSYPpOjPuPGOU=",
-			"path": "github.com/sergeyfrolov/gotapdance/protobuf",
-			"revision": "f30ba05c9bd842d4221ccb73645fe2a0e1a0e1f6",
-			"revisionTime": "2019-03-18T20:34:37Z"
-		},
-		{
-			"checksumSHA1": "yfje0scynTtzRYlG+pGGh3bi9rc=",
-			"path": "github.com/sergeyfrolov/gotapdance/tapdance",
-			"revision": "a67708a49212a7fdf7dda54c0a1a488198dc8a0d",
-			"revisionTime": "2019-03-19T17:16:21Z"
-		},
 		{
 			"checksumSHA1": "Egp3n8yTaAuVtrA14LJrTWDgkO4=",
 			"path": "github.com/sirupsen/logrus",