diff --git a/Makefile b/Makefile index 6ffb05ab0cbe0c3795e6c44130f859657329a45e..d6165e6fd8522bc385d1fce2ff82666a2ec884c7 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ build: update_release: GOFLAGS="" go get -u gitlab.com/elixxir/primitives@release GOFLAGS="" go get -u gitlab.com/elixxir/crypto@release - GOFLAGS="" go get -u gitlab.com/elixxir/comms@connectionRefactor + GOFLAGS="" go get -u gitlab.com/elixxir/comms@release update_master: GOFLAGS="" go get -u gitlab.com/elixxir/primitives@master diff --git a/api/client.go b/api/client.go index faa5d57afe5089aab6e9075cead6128e21e70717..f4aa5935ec56b1c52808af1f89fa7d0da8585a86 100644 --- a/api/client.go +++ b/api/client.go @@ -23,12 +23,12 @@ import ( "gitlab.com/elixxir/client/parse" "gitlab.com/elixxir/client/rekey" "gitlab.com/elixxir/client/user" + "gitlab.com/elixxir/comms/connect" "gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/large" "gitlab.com/elixxir/crypto/signature/rsa" "gitlab.com/elixxir/crypto/tls" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/id" "gitlab.com/elixxir/primitives/ndf" "gitlab.com/elixxir/primitives/switchboard" @@ -42,7 +42,7 @@ type Client struct { session user.Session commManager *io.ReceptionManager ndf *ndf.NetworkDefinition - topology *circuit.Circuit + topology *connect.Circuit opStatus OperationProgressCallback rekeyChan chan struct{} registrationVersion string diff --git a/api/client_test.go b/api/client_test.go index a80a177b91fe674f911a208a463921b0c621b994..36907084b5882e741fb508c0ad10ac9bc11fdbcd 100644 --- a/api/client_test.go +++ b/api/client_test.go @@ -15,6 +15,7 @@ import ( "gitlab.com/elixxir/client/keyStore" "gitlab.com/elixxir/client/parse" "gitlab.com/elixxir/client/user" + "gitlab.com/elixxir/comms/connect" "gitlab.com/elixxir/crypto/csprng" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/diffieHellman" @@ -22,7 +23,6 @@ import ( "gitlab.com/elixxir/crypto/hash" "gitlab.com/elixxir/crypto/large" "gitlab.com/elixxir/crypto/signature/rsa" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/id" "reflect" @@ -125,7 +125,7 @@ func VerifyRegisterGobUser(session user.Session, t *testing.T) { } } -func VerifyRegisterGobKeys(session user.Session, topology *circuit.Circuit, t *testing.T) { +func VerifyRegisterGobKeys(session user.Session, topology *connect.Circuit, t *testing.T) { cmixGrp, _ := getGroups() h := sha256.New() h.Write([]byte(string(40005))) diff --git a/api/connect.go b/api/connect.go index 6dbb55a4baf9260972cf36a4b92a574439b645be..86baa3b6ce7e1758c2c28476b0a1fc6a74bf0d49 100644 --- a/api/connect.go +++ b/api/connect.go @@ -5,7 +5,7 @@ import ( "github.com/pkg/errors" "gitlab.com/elixxir/client/globals" "gitlab.com/elixxir/client/io" - "gitlab.com/elixxir/primitives/circuit" + "gitlab.com/elixxir/comms/connect" "gitlab.com/elixxir/primitives/id" "gitlab.com/elixxir/primitives/ndf" ) @@ -65,7 +65,7 @@ func (cl *Client) InitNetwork() error { nodeIDs[i] = id.NewNodeFromBytes(node.ID) } - cl.topology = circuit.New(nodeIDs) + cl.topology = connect.NewCircuit(nodeIDs) return AddGatewayHosts(cl.commManager, cl.ndf) } diff --git a/bots/bots.go b/bots/bots.go index 3ec2667505cbe673505df702b1fe1f0df33e082f..98210c9b67399e5945e01118f96075108838b1b7 100644 --- a/bots/bots.go +++ b/bots/bots.go @@ -7,13 +7,12 @@ import ( "gitlab.com/elixxir/client/parse" "gitlab.com/elixxir/client/user" "gitlab.com/elixxir/comms/connect" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/id" "gitlab.com/elixxir/primitives/switchboard" ) var session user.Session -var topology *circuit.Circuit +var topology *connect.Circuit var comms io.Communications var transmissionHost *connect.Host @@ -51,7 +50,7 @@ func (l *nickReqListener) Hear(msg switchboard.Item, isHeardElsewhere bool) { var nicknameRequestListener nickReqListener // InitBots is called internally by the Login API -func InitBots(s user.Session, m io.Communications, top *circuit.Circuit, udbID *id.User, host *connect.Host) { +func InitBots(s user.Session, m io.Communications, top *connect.Circuit, udbID *id.User, host *connect.Host) { UdbID = udbID // FIXME: these all need to be used in non-blocking threads if we are diff --git a/bots/bots_test.go b/bots/bots_test.go index c259c2e7088fd882b6c55e499d72e30de32cee39..31a353480303d5495158e641e8044a557fa18cd2 100644 --- a/bots/bots_test.go +++ b/bots/bots_test.go @@ -19,7 +19,6 @@ import ( "gitlab.com/elixxir/comms/connect" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/large" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/id" "os" @@ -35,7 +34,7 @@ type dummyMessaging struct { // SendMessage to the server func (d *dummyMessaging) SendMessage(sess user.Session, - topology *circuit.Circuit, + topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { @@ -45,7 +44,7 @@ func (d *dummyMessaging) SendMessage(sess user.Session, // SendMessage without partitions to the server func (d *dummyMessaging) SendMessageNoPartition(sess user.Session, - topology *circuit.Circuit, + topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { @@ -80,7 +79,7 @@ func TestMain(m *testing.M) { listener: ListenCh, } h := connect.Host{} - topology := circuit.New([]*id.Node{id.NewNodeFromBytes(make([]byte, id.NodeIdLen))}) + topology := connect.NewCircuit([]*id.Node{id.NewNodeFromBytes(make([]byte, id.NodeIdLen))}) InitBots(fakeSession, fakeComm, topology, id.NewUserFromBytes([]byte("testid")), &h) @@ -190,7 +189,7 @@ type errorMessaging struct{} // SendMessage that just errors out func (e *errorMessaging) SendMessage(sess user.Session, - topology *circuit.Circuit, + topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { @@ -199,7 +198,7 @@ func (e *errorMessaging) SendMessage(sess user.Session, // SendMessage no partition that just errors out func (e *errorMessaging) SendMessageNoPartition(sess user.Session, - topology *circuit.Circuit, + topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { diff --git a/crypto/encrypt.go b/crypto/encrypt.go index 78017cb4a8250afd00cc104ab0c9e98bc0f911f3..95a6c12c3da10d689de44cc4274296eb79f213d0 100644 --- a/crypto/encrypt.go +++ b/crypto/encrypt.go @@ -9,18 +9,18 @@ package crypto import ( "gitlab.com/elixxir/client/globals" "gitlab.com/elixxir/client/user" + "gitlab.com/elixxir/comms/connect" "gitlab.com/elixxir/crypto/cmix" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/e2e" "gitlab.com/elixxir/crypto/hash" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" ) // CMIX Encrypt performs the encryption // of the msg to a team of nodes // It returns a new msg -func CMIXEncrypt(session user.Session, topology *circuit.Circuit, salt []byte, +func CMIXEncrypt(session user.Session, topology *connect.Circuit, salt []byte, msg *format.Message) (*format.Message, [][]byte) { // Generate the encryption key nodeKeys := session.GetNodeKeys(topology) diff --git a/crypto/encryptdecrypt_test.go b/crypto/encryptdecrypt_test.go index 11472df9d724ede9df23e6bcf877d029728f901b..b098be7ce2335a2f1dc740882f211c08b754fe79 100644 --- a/crypto/encryptdecrypt_test.go +++ b/crypto/encryptdecrypt_test.go @@ -9,12 +9,12 @@ package crypto import ( "bytes" "gitlab.com/elixxir/client/user" + "gitlab.com/elixxir/comms/connect" pb "gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/crypto/cmix" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/hash" "gitlab.com/elixxir/crypto/large" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/id" "golang.org/x/crypto/blake2b" @@ -32,7 +32,7 @@ var session user.Session var serverPayloadAKey *cyclic.Int var serverPayloadBKey *cyclic.Int -var topology *circuit.Circuit +var topology *connect.Circuit func setup() { @@ -53,7 +53,7 @@ func setup() { nodeSlice = append(nodeSlice, nodeId) } - topology = circuit.New(nodeSlice) + topology = connect.NewCircuit(nodeSlice) nkMap := make(map[id.Node]user.NodeKeys) diff --git a/go.mod b/go.mod index 74de1fb1f29dc3255a097c8e6487b1b0f2493a7f..15bdf2ecb9df7516849094f1222ebca4e1a5f891 100644 --- a/go.mod +++ b/go.mod @@ -12,13 +12,9 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.5.0 - gitlab.com/elixxir/comms v0.0.0-20191118213520-6016a851439b - gitlab.com/elixxir/crypto v0.0.0-20191029164123-324be42ee600 - gitlab.com/elixxir/primitives v0.0.0-20191029164023-7f6b4088b191 - golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f - golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914 // indirect - golang.org/x/sys v0.0.0-20191119060738-e882bf8e40c2 // indirect - google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11 // indirect - google.golang.org/grpc v1.25.1 // indirect - gopkg.in/yaml.v2 v2.2.6 // indirect + gitlab.com/elixxir/comms v0.0.0-20191122185144-1f0b1d67b48c + gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253 + gitlab.com/elixxir/primitives v0.0.0-20191122192832-23a7c77d2feb + golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba + golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e // indirect ) diff --git a/go.sum b/go.sum index 295cd839f6a67b1522ed185f76370c71fe262ca8..313cd3dde1e2d9056ea17f4e9944b98e491d1168 100644 --- a/go.sum +++ b/go.sum @@ -47,8 +47,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -76,7 +74,6 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= @@ -100,7 +97,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -132,14 +128,18 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -gitlab.com/elixxir/comms v0.0.0-20191118213520-6016a851439b h1:7ST1IMS6kotS9pHErpAe5FkGLVsmczdDUtUltNj9sx4= -gitlab.com/elixxir/comms v0.0.0-20191118213520-6016a851439b/go.mod h1:X3hAF6MepjDANpPmIycDHy+dcXyyEtOZXHwlSXU7a6s= +gitlab.com/elixxir/comms v0.0.0-20191122185144-1f0b1d67b48c h1:k3Zz5tTCsPTfQQcEHM+c1yp06NIDXfDF16c31yuKW10= +gitlab.com/elixxir/comms v0.0.0-20191122185144-1f0b1d67b48c/go.mod h1:oanQs047BnCFWseo94+VCUCoPwM+Ofue4F8XRsgHw04= gitlab.com/elixxir/crypto v0.0.0-20191029164123-324be42ee600 h1:4oexoUT9k0H6W3i1j6T5nCPwCwEijVb/uI5yALJjAE8= gitlab.com/elixxir/crypto v0.0.0-20191029164123-324be42ee600/go.mod h1:+46Zj/NE6JEkXExYnzdvvDokPpDbA+fJsRszvrezK9k= +gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253 h1:BqgqJ0mLANRjhAFLvGAcB5AWdgAnFZhsGx0qTk5G+3Y= +gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253/go.mod h1:+46Zj/NE6JEkXExYnzdvvDokPpDbA+fJsRszvrezK9k= gitlab.com/elixxir/primitives v0.0.0-20191028233752-882c08b8f095 h1:fnRh0PUwgy0qlWM7xMdk2w5MXh7gvQ0v/xyedn2gbcY= gitlab.com/elixxir/primitives v0.0.0-20191028233752-882c08b8f095/go.mod h1:+UiRRWzNpl/WoWUuQtJSoimfXImJAJ5lrrmg0pQKY3g= gitlab.com/elixxir/primitives v0.0.0-20191029164023-7f6b4088b191 h1:pKf6JBoZb97UFb3w1h71FsvDoewL2VFfOSmIinOSTdQ= gitlab.com/elixxir/primitives v0.0.0-20191029164023-7f6b4088b191/go.mod h1:uOh4MxLDB8xGoDA2f0a/HJxgb2VFS4Pd2PC8f4m6/tU= +gitlab.com/elixxir/primitives v0.0.0-20191122192832-23a7c77d2feb h1:/p1qCo8XWJz4tSYMQopCecWD+ssiR/vOpwmBLplt+sw= +gitlab.com/elixxir/primitives v0.0.0-20191122192832-23a7c77d2feb/go.mod h1:swJHS06bt83wWmif/6cyNkhQAsAEU+PuNMUWNzCqCZU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -149,10 +149,10 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191028145041-f83a4685e152 h1:ZC1Xn5A1nlpSmQCIva4bZ3ob3lmhYIefc+GU+DLg1Ow= golang.org/x/crypto v0.0.0-20191028145041-f83a4685e152/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf h1:fnPsqIDRbCSgumaMCRpoIoF2s4qxv0xSSS0BVZUE/ss= -golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f h1:kz4KIr+xcPUsI3VMoqWfPMvtnJ6MGfiVwsWSVzphMO4= golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba h1:9bFeDpN3gTqNanMVqNcoR/pJQuP5uroC3t1D7eXozTE= +golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -165,8 +165,6 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271 h1:N66aaryRB3Ax92gH0v3hp1QYZ3zWWCCUR/j8Ifh45Ss= -golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914 h1:MlY3mEfbnWGmUi4rtHOtNnnnN4UJRGSyLPx+DXA5Sq4= golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -181,13 +179,12 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191028164358-195ce5e7f934 h1:u/E0NqCIWRDAo9WCFo6Ko49njPFDLSd3z+X1HgWDMpE= golang.org/x/sys v0.0.0-20191028164358-195ce5e7f934/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c h1:S/FtSvpNLtFBgjTqcKsRpsa6aVsI6iztaz1bQd9BJwE= -golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191119060738-e882bf8e40c2 h1:wAW1U21MfVN0sUipAD8952TBjGXMRHFKQugDlQ9RwwE= -golang.org/x/sys v0.0.0-20191119060738-e882bf8e40c2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191118133127-cf1e2d577169/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191119195528-f068ffe820e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -203,8 +200,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6 h1:UXl+Zk3jqqcbEVV7ace5lrt4YdA4tXiz3f/KbmD29Vo= -google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11 h1:51D++eCgOHufw5VfDE9Uzqyyc+OyQIjb9hkYy9LN5Fk= google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -226,7 +221,8 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.6 h1:97YCGUei5WVbkKfogoJQsLwUJ17cWvpLrgNvlcbxikE= -gopkg.in/yaml.v2 v2.2.6/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/io/interface.go b/io/interface.go index 09b1dd50b32f1a53d5d53216e4b700931f31605e..c7253fda1c7b24b8f82ffc99a7d47e4dd418ab32 100644 --- a/io/interface.go +++ b/io/interface.go @@ -10,7 +10,6 @@ import ( "gitlab.com/elixxir/client/parse" "gitlab.com/elixxir/client/user" "gitlab.com/elixxir/comms/connect" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/id" "time" ) @@ -20,12 +19,12 @@ type Communications interface { // this can go // SendMessage to the server // TODO(nen) Can we get rid of the crypto type param here? - SendMessage(session user.Session, topology *circuit.Circuit, + SendMessage(session user.Session, topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error // SendMessage without partitions to the server // This is used to send rekey messages - SendMessageNoPartition(session user.Session, topology *circuit.Circuit, + SendMessageNoPartition(session user.Session, topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error // MessageReceiver thread to get new messages diff --git a/io/send.go b/io/send.go index a95a8dedc075f9573be0482f83b01aad0a33c7e2..1d0821e9e94814ade332ce1995bcca33963904a4 100644 --- a/io/send.go +++ b/io/send.go @@ -20,7 +20,6 @@ import ( "gitlab.com/elixxir/crypto/cmix" "gitlab.com/elixxir/crypto/csprng" "gitlab.com/elixxir/crypto/e2e" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/id" "time" @@ -31,7 +30,7 @@ import ( // the keys) here. I won't touch crypto at this time, though... // TODO This method would be cleaner if it took a parse.Message (particularly // w.r.t. generating message IDs for multi-part messages.) -func (rm *ReceptionManager) SendMessage(session user.Session, topology *circuit.Circuit, +func (rm *ReceptionManager) SendMessage(session user.Session, topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { // FIXME: We should really bring the plaintext parts of the NewMessage logic @@ -78,7 +77,7 @@ func (rm *ReceptionManager) SendMessage(session user.Session, topology *circuit. // This function will be needed for example to send a Rekey // message, where a new public key will take up the whole message func (rm *ReceptionManager) SendMessageNoPartition(session user.Session, - topology *circuit.Circuit, recipientID *id.User, cryptoType parse.CryptoType, + topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { size := len(message) if size > format.TotalLen { @@ -110,7 +109,7 @@ func (rm *ReceptionManager) SendMessageNoPartition(session user.Session, } // send actually sends the message to the server -func (rm *ReceptionManager) send(session user.Session, topology *circuit.Circuit, +func (rm *ReceptionManager) send(session user.Session, topology *connect.Circuit, cryptoType parse.CryptoType, message *format.Message, rekey bool, transmitGateway *connect.Host) error { diff --git a/rekey/rekey.go b/rekey/rekey.go index 030b104dc7b7be7728076b8046d4e077b61d7745..c0f60a59d65f5a09d5d34d0eda50e3ffeb47b542 100644 --- a/rekey/rekey.go +++ b/rekey/rekey.go @@ -14,14 +14,13 @@ import ( "gitlab.com/elixxir/crypto/diffieHellman" "gitlab.com/elixxir/crypto/e2e" "gitlab.com/elixxir/crypto/hash" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/id" "gitlab.com/elixxir/primitives/switchboard" ) var session user.Session -var topology *circuit.Circuit +var topology *connect.Circuit var comms io.Communications var transmissionHost *connect.Host @@ -89,7 +88,7 @@ func (l *rekeyConfirmListener) Hear(msg switchboard.Item, isHeardElsewhere bool) } // InitRekey is called internally by the Login API -func InitRekey(s user.Session, m io.Communications, t *circuit.Circuit, rekeyChan2 chan struct{}) { +func InitRekey(s user.Session, m io.Communications, t *connect.Circuit, rekeyChan2 chan struct{}) { rekeyTriggerList = rekeyTriggerListener{} rekeyList = rekeyListener{} diff --git a/rekey/rekey_test.go b/rekey/rekey_test.go index fce9121af312a132905f13a44240d651eae1424c..2b4c93b874846faffd669e8f00e83398dbad4602 100644 --- a/rekey/rekey_test.go +++ b/rekey/rekey_test.go @@ -16,7 +16,6 @@ import ( "gitlab.com/elixxir/crypto/hash" "gitlab.com/elixxir/crypto/large" "gitlab.com/elixxir/crypto/signature/rsa" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/id" "os" "testing" @@ -31,7 +30,7 @@ type dummyMessaging struct { // SendMessage to the server func (d *dummyMessaging) SendMessage(sess user.Session, - topology *circuit.Circuit, + topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { @@ -41,7 +40,7 @@ func (d *dummyMessaging) SendMessage(sess user.Session, // SendMessage without partitions to the server func (d *dummyMessaging) SendMessageNoPartition(sess user.Session, - topology *circuit.Circuit, + topology *connect.Circuit, recipientID *id.User, cryptoType parse.CryptoType, message []byte, transmissionHost *connect.Host) error { @@ -86,7 +85,7 @@ func TestMain(m *testing.M) { } rekeyChan2 := make(chan struct{}, 50) - InitRekey(session, fakeComm, circuit.New([]*id.Node{id.NewNodeFromBytes(make([]byte, id.NodeIdLen))}), rekeyChan2) + InitRekey(session, fakeComm, connect.NewCircuit([]*id.Node{id.NewNodeFromBytes(make([]byte, id.NodeIdLen))}), rekeyChan2) // Create E2E relationship with partner // Generate baseKey diff --git a/user/session.go b/user/session.go index a0011524a5951d1d558b888e2992f9ab0f7d533e..cc626ff425d4e68e0cb731338faa9ee7471a13b0 100644 --- a/user/session.go +++ b/user/session.go @@ -17,9 +17,9 @@ import ( "github.com/pkg/errors" "gitlab.com/elixxir/client/globals" "gitlab.com/elixxir/client/keyStore" + "gitlab.com/elixxir/comms/connect" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/signature/rsa" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/id" "gitlab.com/elixxir/primitives/switchboard" @@ -35,7 +35,7 @@ var ErrQuery = errors.New("element not in map") // Interface for User Session operations type Session interface { GetCurrentUser() (currentUser *User) - GetNodeKeys(topology *circuit.Circuit) []NodeKeys + GetNodeKeys(topology *connect.Circuit) []NodeKeys PushNodeKey(id *id.Node, key NodeKeys) GetRSAPrivateKey() *rsa.PrivateKey GetRSAPublicKey() *rsa.PublicKey @@ -279,7 +279,7 @@ func (s *SessionObj) GetSalt() []byte { return salt } -func (s *SessionObj) GetNodeKeys(topology *circuit.Circuit) []NodeKeys { +func (s *SessionObj) GetNodeKeys(topology *connect.Circuit) []NodeKeys { s.LockStorage() defer s.UnlockStorage() diff --git a/user/session_test.go b/user/session_test.go index 32d98c8373bc92cec6af3e121880d822b93ed4be..a83a4fb6ca0e69e8db07a1fbdf32adbb44654aa4 100644 --- a/user/session_test.go +++ b/user/session_test.go @@ -9,10 +9,10 @@ package user import ( "crypto/sha256" "gitlab.com/elixxir/client/globals" + "gitlab.com/elixxir/comms/connect" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/large" "gitlab.com/elixxir/crypto/signature/rsa" - "gitlab.com/elixxir/primitives/circuit" "gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/id" "math/rand" @@ -46,7 +46,7 @@ func TestUserSession(t *testing.T) { ReceptionKey: grp.NewInt(2), } - topology := circuit.New([]*id.Node{nodeID}) + topology := connect.NewCircuit([]*id.Node{nodeID}) // Storage storage := &globals.RamStorage{}