Browse Source

Add distinct TapDance/Conjure server entry ports

- Enables running a dual TapDance/Conjure server.
Rod Hynes 5 years ago
parent
commit
b76938315d

+ 2 - 1
psiphon/common/protocol/serverEntry.go

@@ -55,7 +55,8 @@ type ServerEntry struct {
 	SshHostKey                    string   `json:"sshHostKey"`
 	SshObfuscatedPort             int      `json:"sshObfuscatedPort"`
 	SshObfuscatedQUICPort         int      `json:"sshObfuscatedQUICPort"`
-	SshObfuscatedTapdancePort     int      `json:"sshObfuscatedTapdancePort"`
+	SshObfuscatedTapDancePort     int      `json:"sshObfuscatedTapdancePort"`
+	SshObfuscatedConjurePort      int      `json:"sshObfuscatedConjurePort"`
 	SshObfuscatedKey              string   `json:"sshObfuscatedKey"`
 	Capabilities                  []string `json:"capabilities"`
 	Region                        string   `json:"region"`

+ 2 - 1
psiphon/common/protocol/serverEntry_test.go

@@ -180,7 +180,8 @@ func testServerEntryListSignatures(t *testing.T, setExplicitTag bool) {
 		SshHostKey:                    prng.HexString(n),
 		SshObfuscatedPort:             prng.Intn(n),
 		SshObfuscatedQUICPort:         prng.Intn(n),
-		SshObfuscatedTapdancePort:     prng.Intn(n),
+		SshObfuscatedTapDancePort:     prng.Intn(n),
+		SshObfuscatedConjurePort:      prng.Intn(n),
 		SshObfuscatedKey:              prng.HexString(n),
 		Capabilities:                  []string{prng.HexString(n)},
 		Region:                        prng.HexString(n),

+ 5 - 2
psiphon/dialParameters.go

@@ -546,8 +546,11 @@ func MakeDialParameters(
 	case protocol.TUNNEL_PROTOCOL_OBFUSCATED_SSH:
 		dialParams.DirectDialAddress = fmt.Sprintf("%s:%d", serverEntry.IpAddress, serverEntry.SshObfuscatedPort)
 
-	case protocol.TUNNEL_PROTOCOL_TAPDANCE_OBFUSCATED_SSH, protocol.TUNNEL_PROTOCOL_CONJURE_OBFUSCATED_SSH:
-		dialParams.DirectDialAddress = fmt.Sprintf("%s:%d", serverEntry.IpAddress, serverEntry.SshObfuscatedTapdancePort)
+	case protocol.TUNNEL_PROTOCOL_TAPDANCE_OBFUSCATED_SSH:
+		dialParams.DirectDialAddress = fmt.Sprintf("%s:%d", serverEntry.IpAddress, serverEntry.SshObfuscatedTapDancePort)
+
+	case protocol.TUNNEL_PROTOCOL_CONJURE_OBFUSCATED_SSH:
+		dialParams.DirectDialAddress = fmt.Sprintf("%s:%d", serverEntry.IpAddress, serverEntry.SshObfuscatedConjurePort)
 
 	case protocol.TUNNEL_PROTOCOL_QUIC_OBFUSCATED_SSH:
 		dialParams.DirectDialAddress = fmt.Sprintf("%s:%d", serverEntry.IpAddress, serverEntry.SshObfuscatedQUICPort)

+ 3 - 2
psiphon/dialParameters_test.go

@@ -519,8 +519,9 @@ func makeMockServerEntries(tunnelProtocol string, count int) []*protocol.ServerE
 			SshPort:                    1,
 			SshObfuscatedPort:          2,
 			SshObfuscatedQUICPort:      3,
-			SshObfuscatedTapdancePort:  4,
-			MeekServerPort:             5,
+			SshObfuscatedTapDancePort:  4,
+			SshObfuscatedConjurePort:   5,
+			MeekServerPort:             6,
 			MeekFrontingHosts:          []string{"www1.example.org", "www2.example.org", "www3.example.org"},
 			MeekFrontingAddressesRegex: "[a-z0-9]{1,64}.example.org",
 			LocalSource:                protocol.SERVER_ENTRY_SOURCE_EMBEDDED,