@@ -21,10 +21,11 @@ import (
2121 "github.com/stretchr/testify/require"
2222 "google.golang.org/protobuf/types/known/anypb"
2323
24- cj "github.com/refraction-networking/conjure/application/lib"
25- "github.com/refraction-networking/conjure/application/transports"
26- "github.com/refraction-networking/conjure/application/transports/wrapping/internal/tests"
27- pb "github.com/refraction-networking/gotapdance/protobuf"
24+ "github.com/refraction-networking/conjure/pkg/core"
25+ cj "github.com/refraction-networking/conjure/pkg/station/lib"
26+ "github.com/refraction-networking/conjure/pkg/transports"
27+ "github.com/refraction-networking/conjure/pkg/transports/wrapping/internal/tests"
28+ pb "github.com/refraction-networking/conjure/proto"
2829 tls "github.com/refraction-networking/utls"
2930)
3031
@@ -34,7 +35,7 @@ func connect(conn net.Conn, reg *cj.DecoyRegistration) (net.Conn, error) {
3435 config := tls.Config {ServerName : "" , InsecureSkipVerify : true }
3536
3637 uTLSConn := tls .UClient (conn , & config , helloID )
37- hmacID := reg .Keys .ConjureHMAC ( hmacString )
38+ hmacID := core . ConjureHMAC ( reg .Keys .SharedSecret , hmacString )
3839
3940 newRand := make ([]byte , 32 )
4041 _ , err := rand .Read (newRand )
@@ -97,7 +98,7 @@ func TestByteRegex(t *testing.T) {
9798}
9899
99100func TestSuccessfulWrap (t * testing.T ) {
100- testSubnetPath := os .Getenv ("GOPATH" ) + "/src/github.com/refraction-networking/conjure/application /lib/test/phantom_subnets.toml"
101+ testSubnetPath := os .Getenv ("GOPATH" ) + "/src/github.com/refraction-networking/conjure/pkg /lib/test/phantom_subnets.toml"
101102 os .Setenv ("PHANTOM_SUBNET_LOCATION" , testSubnetPath )
102103
103104 var transport Transport
@@ -156,7 +157,7 @@ func TestSuccessfulWrap(t *testing.T) {
156157func TestUnsuccessfulWrap (t * testing.T ) {
157158 var transport Transport
158159 manager := tests .SetupRegistrationManager (tests.Transport {Index : pb .TransportType_Prefix , Transport : transport })
159- c2p , sfp , reg := tests .SetupPhantomConnections (manager , pb .TransportType_Prefix )
160+ c2p , sfp , reg := tests .SetupPhantomConnections (manager , pb .TransportType_Prefix , nil , randomizeDstPortMinVersion )
160161 defer c2p .Close ()
161162 defer sfp .Close ()
162163
@@ -183,7 +184,7 @@ func TestTryAgain(t *testing.T) {
183184 var transport Transport
184185 var err error
185186 manager := tests .SetupRegistrationManager (tests.Transport {Index : pb .TransportType_Prefix , Transport : transport })
186- c2p , sfp , reg := tests .SetupPhantomConnections (manager , pb .TransportType_Prefix )
187+ c2p , sfp , reg := tests .SetupPhantomConnections (manager , pb .TransportType_Prefix , nil , randomizeDstPortMinVersion )
187188 defer c2p .Close ()
188189 defer sfp .Close ()
189190
@@ -212,12 +213,12 @@ func TestTryAgain(t *testing.T) {
212213}
213214
214215func TestSuccessfulWrapLargeMessage (t * testing.T ) {
215- testSubnetPath := os .Getenv ("GOPATH" ) + "/src/github.com/refraction-networking/conjure/application /lib/test/phantom_subnets.toml"
216+ testSubnetPath := os .Getenv ("GOPATH" ) + "/src/github.com/refraction-networking/conjure/pkg /lib/test/phantom_subnets.toml"
216217 os .Setenv ("PHANTOM_SUBNET_LOCATION" , testSubnetPath )
217218
218219 var transport Transport
219220 manager := tests .SetupRegistrationManager (tests.Transport {Index : pb .TransportType_Prefix , Transport : transport })
220- c2p , sfp , reg := tests .SetupPhantomConnections (manager , pb .TransportType_Prefix )
221+ c2p , sfp , reg := tests .SetupPhantomConnections (manager , pb .TransportType_Prefix , nil , randomizeDstPortMinVersion )
221222 defer c2p .Close ()
222223 defer sfp .Close ()
223224 require .NotNil (t , reg )
@@ -296,7 +297,7 @@ func TestTryParamsToDstPort(t *testing.T) {
296297}
297298
298299func TestUtlsSessionResumption (t * testing.T ) {
299- // testSubnetPath := os.Getenv("GOPATH") + "/src/github.com/refraction-networking/conjure/application /lib/test/phantom_subnets.toml"
300+ // testSubnetPath := os.Getenv("GOPATH") + "/src/github.com/refraction-networking/conjure/pkg /lib/test/phantom_subnets.toml"
300301 // os.Setenv("PHANTOM_SUBNET_LOCATION", testSubnetPath)
301302
302303 // var transport Transport
0 commit comments