diff --git a/connection/connection_test.go b/connection/connection_test.go index 11ad54a..3aaa349 100644 --- a/connection/connection_test.go +++ b/connection/connection_test.go @@ -123,7 +123,7 @@ func TestProcessAuthTimeout(t *testing.T) { }() conn, _ := ln.Accept() - // Giving the client inconsistent keypair to make EDH fail + pub, priv, _ := ed25519.GenerateKey(rand.Reader) rc := NewInboundConnection(conn) err := HandleInboundConnection(rc).ProcessAuthAsV3Server(identity.InitializeV3("", &priv, &pub), ServerAuthValid3DH) diff --git a/inbound_version_negotiation_test.go b/inbound_version_negotiation_test.go index 665cfc3..ef288fd 100644 --- a/inbound_version_negotiation_test.go +++ b/inbound_version_negotiation_test.go @@ -16,7 +16,7 @@ func TestNegotiateInboundVersions(t *testing.T) { } defer conn.Close() - conn.Write([]byte{0x49, 0x4D, 0x01, 0x01}) + conn.Write([]byte{0x49, 0x4D, 0x01, 0x03}) } l, err := net.Listen("tcp", ":4000") diff --git a/outbound_version_negotiation_test.go b/outbound_version_negotiation_test.go index c71fbae..ccc4341 100644 --- a/outbound_version_negotiation_test.go +++ b/outbound_version_negotiation_test.go @@ -14,7 +14,7 @@ func TestOutboundVersionNegotiation(t *testing.T) { b := make([]byte, 4) n, err := conn.Read(b) if n == 4 && err == nil { - conn.Write([]byte{0x01}) + conn.Write([]byte{0x03}) } conn.Close() }() diff --git a/ricochet.go b/ricochet.go index c8fab46..de4c74d 100644 --- a/ricochet.go +++ b/ricochet.go @@ -31,7 +31,7 @@ func Open(acn connectivity.ACN, remoteHostname string) (*connection.Connection, // NegotiateVersionOutbound takes an open network connection and executes // the ricochet version negotiation procedure. func NegotiateVersionOutbound(conn net.Conn, remoteHostname string) (*connection.Connection, error) { - versions := []byte{0x49, 0x4D, 0x01, 0x01} + versions := []byte{0x49, 0x4D, 0x01, 0x03} if n, err := conn.Write(versions); err != nil || n < len(versions) { return nil, utils.VersionNegotiationError } @@ -41,7 +41,7 @@ func NegotiateVersionOutbound(conn net.Conn, remoteHostname string) (*connection return nil, utils.VersionNegotiationError } - if res[0] != 0x01 { + if res[0] != 0x03 { return nil, utils.VersionNegotiationFailed } rc := connection.NewOutboundConnection(conn, remoteHostname) @@ -52,7 +52,7 @@ func NegotiateVersionOutbound(conn net.Conn, remoteHostname string) (*connection // as if that connection was a client. Returns a ricochet connection if successful // error otherwise. func NegotiateVersionInbound(conn net.Conn) (*connection.Connection, error) { - versions := []byte{0x49, 0x4D, 0x01, 0x01} + versions := []byte{0x49, 0x4D, 0x01, 0x03} // Read version response header header := make([]byte, 3) if _, err := io.ReadAtLeast(conn, header, len(header)); err != nil { @@ -71,7 +71,7 @@ func NegotiateVersionInbound(conn net.Conn) (*connection.Connection, error) { selectedVersion := byte(0xff) for _, v := range versionList { - if v == 0x01 { + if v == 0x03 { selectedVersion = v break } diff --git a/ricochet_test.go b/ricochet_test.go index c4c7b27..ca2defd 100644 --- a/ricochet_test.go +++ b/ricochet_test.go @@ -13,7 +13,7 @@ func SimpleServer() { b := make([]byte, 4) n, err := conn.Read(b) if n == 4 && err == nil { - conn.Write([]byte{0x01}) + conn.Write([]byte{0x03}) } conn.Close() }