diff --git a/README.md b/README.md index 11575e9101d46fe23e000664dda88b3d9e143c7b..130ac9a67170d20fe8f416c347afccb66f113b22 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,43 @@ GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/clien GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/client.darwin64 main.go ``` +To get an NDF from a network gateway and the permissioning server, use the `getndf` subcommand. The `getndf` subcommand allows command line users to poll the NDF from both a gateway and the permissioning server without any pre-established client connection. It requires an IP address, port, and ssl certificate. You can download an ssl cert with: +``` +openssl s_client -showcerts -connect permissioning.prod.cmix.rip:11420 < /dev/null 2>&1 | openssl x509 -outform PEM > certfile.pem +``` + +Example usage for Gateways: + +``` +$ go run main.go getndf --gwhost localhost:8440 --cert ~/integration/keys/cmix.rip.crt | jq . | head +{ + "Timestamp": "2021-01-29T01:19:49.227246827Z", + "Gateways": [ + { + "Id": "BRM+Iotl6ujIGhjRddZMBdauapS7Z6jL0FJGq7IkUdYB", + "Address": ":8440", + "Tls_certificate": "-----BEGIN CERTIFICATE-----\nMIIDbDCCAlSgAwIBAgIJAOUNtZneIYECMA0GCSqGSIb3DQEBBQUAMGgxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRIwEAYDVQQHDAlDbGFyZW1vbnQx\nGzAZBgNVBAoMElByaXZhdGVncml0eSBDb3JwLjETMBEGA1UEAwwKKi5jbWl4LnJp\ncDAeFw0xOTAzMDUxODM1NDNaFw0yOTAzMDIxODM1NDNaMGgxCzAJBgNVBAYTAlVT\nMRMwEQYDVQQIDApDYWxpZm9ybmlhMRIwEAYDVQQHDAlDbGFyZW1vbnQxGzAZBgNV\nBAoMElByaXZhdGVncml0eSBDb3JwLjETMBEGA1UEAwwKKi5jbWl4LnJpcDCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPP0WyVkfZA/CEd2DgKpcudn0oDh\nDwsjmx8LBDWsUgQzyLrFiVigfUmUefknUH3dTJjmiJtGqLsayCnWdqWLHPJYvFfs\nWYW0IGF93UG/4N5UAWO4okC3CYgKSi4ekpfw2zgZq0gmbzTnXcHF9gfmQ7jJUKSE\ntJPSNzXq+PZeJTC9zJAb4Lj8QzH18rDM8DaL2y1ns0Y2Hu0edBFn/OqavBJKb/uA\nm3AEjqeOhC7EQUjVamWlTBPt40+B/6aFJX5BYm2JFkRsGBIyBVL46MvC02MgzTT9\nbJIJfwqmBaTruwemNgzGu7Jk03hqqS1TUEvSI6/x8bVoba3orcKkf9HsDjECAwEA\nAaMZMBcwFQYDVR0RBA4wDIIKKi5jbWl4LnJpcDANBgkqhkiG9w0BAQUFAAOCAQEA\nneUocN4AbcQAC1+b3To8u5UGdaGxhcGyZBlAoenRVdjXK3lTjsMdMWb4QctgNfIf\nU/zuUn2mxTmF/ekP0gCCgtleZr9+DYKU5hlXk8K10uKxGD6EvoiXZzlfeUuotgp2\nqvI3ysOm/hvCfyEkqhfHtbxjV7j7v7eQFPbvNaXbLa0yr4C4vMK/Z09Ui9JrZ/Z4\ncyIkxfC6/rOqAirSdIp09EGiw7GM8guHyggE4IiZrDslT8V3xIl985cbCxSxeW1R\ntgH4rdEXuVe9+31oJhmXOE9ux2jCop9tEJMgWg7HStrJ5plPbb+HmjoX3nBO04E5\n6m52PyzMNV+2N21IPppKwA==\n-----END CERTIFICATE-----\n" + }, + { + "Id": "JCBd9mAQb2BW8hc8H9avy1ubcjUAa7MHrPp0dBU/VqQB", +``` + +Example usage for the Permissioning server: + +``` +$ go run main.go getndf --permhost localhost:18000 --cert ~/integration/keys/cmix.rip.crt | jq . | head +{ + "Timestamp": "2021-01-29T01:19:49.227246827Z", + "Gateways": [ + { + "Id": "BRM+Iotl6ujIGhjRddZMBdauapS7Z6jL0FJGq7IkUdYB", + "Address": ":8440", + "Tls_certificate": "-----BEGIN CERTIFICATE-----\nMIIDbDCCAlSgAwIBAgIJAOUNtZneIYECMA0GCSqGSIb3DQEBBQUAMGgxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRIwEAYDVQQHDAlDbGFyZW1vbnQx\nGzAZBgNVBAoMElByaXZhdGVncml0eSBDb3JwLjETMBEGA1UEAwwKKi5jbWl4LnJp\ncDAeFw0xOTAzMDUxODM1NDNaFw0yOTAzMDIxODM1NDNaMGgxCzAJBgNVBAYTAlVT\nMRMwEQYDVQQIDApDYWxpZm9ybmlhMRIwEAYDVQQHDAlDbGFyZW1vbnQxGzAZBgNV\nBAoMElByaXZhdGVncml0eSBDb3JwLjETMBEGA1UEAwwKKi5jbWl4LnJpcDCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPP0WyVkfZA/CEd2DgKpcudn0oDh\nDwsjmx8LBDWsUgQzyLrFiVigfUmUefknUH3dTJjmiJtGqLsayCnWdqWLHPJYvFfs\nWYW0IGF93UG/4N5UAWO4okC3CYgKSi4ekpfw2zgZq0gmbzTnXcHF9gfmQ7jJUKSE\ntJPSNzXq+PZeJTC9zJAb4Lj8QzH18rDM8DaL2y1ns0Y2Hu0edBFn/OqavBJKb/uA\nm3AEjqeOhC7EQUjVamWlTBPt40+B/6aFJX5BYm2JFkRsGBIyBVL46MvC02MgzTT9\nbJIJfwqmBaTruwemNgzGu7Jk03hqqS1TUEvSI6/x8bVoba3orcKkf9HsDjECAwEA\nAaMZMBcwFQYDVR0RBA4wDIIKKi5jbWl4LnJpcDANBgkqhkiG9w0BAQUFAAOCAQEA\nneUocN4AbcQAC1+b3To8u5UGdaGxhcGyZBlAoenRVdjXK3lTjsMdMWb4QctgNfIf\nU/zuUn2mxTmF/ekP0gCCgtleZr9+DYKU5hlXk8K10uKxGD6EvoiXZzlfeUuotgp2\nqvI3ysOm/hvCfyEkqhfHtbxjV7j7v7eQFPbvNaXbLa0yr4C4vMK/Z09Ui9JrZ/Z4\ncyIkxfC6/rOqAirSdIp09EGiw7GM8guHyggE4IiZrDslT8V3xIl985cbCxSxeW1R\ntgH4rdEXuVe9+31oJhmXOE9ux2jCop9tEJMgWg7HStrJ5plPbb+HmjoX3nBO04E5\n6m52PyzMNV+2N21IPppKwA==\n-----END CERTIFICATE-----\n" + }, + { + "Id": "JCBd9mAQb2BW8hc8H9avy1ubcjUAa7MHrPp0dBU/VqQB", +``` + Basic command line usage, sending unsafe, unencrypted messages to yourself: ``` @@ -121,6 +158,8 @@ Flags: -d, --destid string ID to send message to (if below 40, will be precanned. Use '0x' or 'b64:' for hex and base64 representations) (default "0") + --forceHistoricalRounds Force all rounds to be sent to historical + round retrieval -h, --help help for client -l, --log string Path to the log output path (- is stdout) (default "-") diff --git a/api/authenticatedChannel.go b/api/authenticatedChannel.go index c37c49d0f0f1e5a938eb2c1557b6e80315042d53..7e98c11daab796f87285de62fc8d6fdbee45ab81 100644 --- a/api/authenticatedChannel.go +++ b/api/authenticatedChannel.go @@ -13,7 +13,6 @@ import ( "gitlab.com/elixxir/client/auth" "gitlab.com/elixxir/client/interfaces" "gitlab.com/elixxir/client/interfaces/contact" - "gitlab.com/elixxir/client/storage/e2e" "gitlab.com/elixxir/primitives/fact" "gitlab.com/xx_network/primitives/id" ) @@ -94,7 +93,7 @@ func (c *Client) MakePrecannedAuthenticatedChannel(precannedID uint) (contact.Co precan := c.MakePrecannedContact(precannedID) // add the precanned user as a e2e contact - sesParam := e2e.GetDefaultSessionParams() + sesParam := c.parameters.E2EParams err := c.storage.E2e().AddPartner(precan.ID, precan.DhPubKey, c.storage.E2e().GetDHPrivateKey(), sesParam, sesParam) diff --git a/auth/callback.go b/auth/callback.go index a5ccef9fdd6a57aea045baf05c3bb0e980072c33..9fbe3bd2409a2401689604113c7491608a3f5516 100644 --- a/auth/callback.go +++ b/auth/callback.go @@ -14,7 +14,6 @@ import ( "gitlab.com/elixxir/client/interfaces/contact" "gitlab.com/elixxir/client/stoppable" "gitlab.com/elixxir/client/storage/auth" - "gitlab.com/elixxir/client/storage/e2e" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/diffieHellman" cAuth "gitlab.com/elixxir/crypto/e2e/auth" @@ -251,7 +250,7 @@ func (m *Manager) doConfirm(sr *auth.SentRequest, grp *cyclic.Group, // fixme: channel can get into a bricked state if the first save occurs and // the second does not - p := e2e.GetDefaultSessionParams() + p := m.storage.E2e().GetE2ESessionParams() if err := m.storage.E2e().AddPartner(sr.GetPartner(), partnerPubKey, sr.GetMyPrivKey(), p, p); err != nil { return errors.Errorf("Failed to create channel with partner (%s) "+ diff --git a/auth/confirm.go b/auth/confirm.go index 4a1d27cdea37d86bc8e59305daffca7c9cc78216..73e834d9766cbfe4b91b0156412f3941ad50ac0c 100644 --- a/auth/confirm.go +++ b/auth/confirm.go @@ -15,7 +15,6 @@ import ( "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/interfaces/utility" "gitlab.com/elixxir/client/storage" - "gitlab.com/elixxir/client/storage/e2e" ds "gitlab.com/elixxir/comms/network/dataStructures" "gitlab.com/elixxir/crypto/diffieHellman" cAuth "gitlab.com/elixxir/crypto/e2e/auth" @@ -105,7 +104,7 @@ func ConfirmRequestAuth(partner contact.Contact, rng io.Reader, // messages does not occur //create local relationship - p := e2e.GetDefaultSessionParams() + p := storage.E2e().GetE2ESessionParams() if err := storage.E2e().AddPartner(partner.ID, partner.DhPubKey, newPrivKey, p, p); err != nil { storage.Auth().Fail(partner.ID) diff --git a/cmd/getndf.go b/cmd/getndf.go new file mode 100644 index 0000000000000000000000000000000000000000..4a4658e543bd6f344838bd54ca96fb3aab766f05 --- /dev/null +++ b/cmd/getndf.go @@ -0,0 +1,119 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright © 2020 xx network SEZC // +// // +// Use of this source code is governed by a license that can be found in the // +// LICENSE file // +/////////////////////////////////////////////////////////////////////////////// + +// Package cmd initializes the CLI and config parsers as well as the logger. +package cmd + +import ( + "fmt" + "github.com/spf13/cobra" + jww "github.com/spf13/jwalterweatherman" + "github.com/spf13/viper" + // "gitlab.com/elixxir/client/interfaces/contact" + // "gitlab.com/elixxir/client/interfaces/message" + // "gitlab.com/elixxir/client/switchboard" + // "gitlab.com/elixxir/client/ud" + // "gitlab.com/elixxir/primitives/fact" + "gitlab.com/elixxir/comms/client" + "gitlab.com/xx_network/comms/connect" + //"time" + pb "gitlab.com/elixxir/comms/mixmessages" + "gitlab.com/xx_network/primitives/id" + "gitlab.com/xx_network/primitives/utils" +) + +const opensslCertDL = ("openssl s_client -showcerts -connect ip:port < " + + "/dev/null 2>&1 | openssl x509 -outform PEM > certfile.pem") + +// getNDFCmd user discovery subcommand, allowing user lookup and registration for +// allowing others to search. +// This basically runs a client for these functions with the UD module enabled. +// Normally, clients don't need it so it is not loaded for the rest of the +// commands. +var getNDFCmd = &cobra.Command{ + Use: "getndf", + Short: ("Download the network definition file from the network " + + "and print it."), + Args: cobra.NoArgs, + Run: func(cmd *cobra.Command, args []string) { + gwHost := viper.GetString("gwhost") + permHost := viper.GetString("permhost") + certPath := viper.GetString("cert") + + // Load the certificate + var cert []byte + if certPath != "" { + cert, _ = utils.ReadFile(certPath) + } + if len(cert) == 0 { + jww.FATAL.Panicf("Could not load a certificate, "+ + "provide a certificate file with --cert.\n\n"+ + "You can download a cert using openssl:\n\n%s", + opensslCertDL) + } + + params := connect.GetDefaultHostParams() + params.AuthEnabled = false + comms, _ := client.NewClientComms(nil, nil, nil, nil) + // Gateway lookup + if gwHost != "" { + host, _ := connect.NewHost(&id.TempGateway, gwHost, + cert, params) + pollMsg := &pb.GatewayPoll{ + Partial: &pb.NDFHash{ + Hash: nil, + }, + LastUpdate: uint64(0), + ClientID: id.DummyUser.Marshal(), + } + resp, err := comms.SendPoll(host, pollMsg) + if err != nil { + jww.FATAL.Panicf("Unable to poll %s for NDF:"+ + " %+v", + gwHost, err) + } + fmt.Printf("%s", resp.PartialNDF.Ndf) + return + } + + if permHost != "" { + host, _ := connect.NewHost(&id.Permissioning, permHost, + cert, params) + pollMsg := &pb.NDFHash{ + Hash: []byte("DummyUserRequest"), + } + resp, err := comms.RequestNdf(host, pollMsg) + if err != nil { + jww.FATAL.Panicf("Unable to ask %s for NDF:"+ + " %+v", + permHost, err) + } + fmt.Printf("%s", resp.Ndf) + return + } + + fmt.Println("Enter --gwhost or --permhost and --cert please") + }, +} + +func init() { + getNDFCmd.Flags().StringP("gwhost", "", "", + "Poll this gateway host:port for the NDF") + viper.BindPFlag("gwhost", + getNDFCmd.Flags().Lookup("gwhost")) + getNDFCmd.Flags().StringP("permhost", "", "", + "Poll this permissioning host:port for the NDF") + viper.BindPFlag("permhost", + getNDFCmd.Flags().Lookup("permhost")) + + getNDFCmd.Flags().StringP("cert", "", "", + "Check with the TLS certificate at this path") + viper.BindPFlag("cert", + getNDFCmd.Flags().Lookup("cert")) + + rootCmd.AddCommand(getNDFCmd) +} diff --git a/cmd/root.go b/cmd/root.go index ca88cd9bf72b9054afc7023367c5d54f751772ed..e79053c67198e637338e8555800fab0c42952579 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -212,7 +212,14 @@ func createClient() *api.Client { } } - client, err := api.OpenClient(storeDir, []byte(pass), params.GetDefaultNetwork()) + netParams := params.GetDefaultNetwork() + netParams.E2EParams.MinKeys = uint16(viper.GetUint("e2eMinKeys")) + netParams.E2EParams.MaxKeys = uint16(viper.GetUint("e2eMaxKeys")) + netParams.E2EParams.NumRekeys = uint16( + viper.GetUint("e2eNumReKeys")) + netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds") + + client, err := api.OpenClient(storeDir, []byte(pass), netParams) if err != nil { jww.FATAL.Panicf("%+v", err) } @@ -225,8 +232,15 @@ func initClient() *api.Client { pass := viper.GetString("password") storeDir := viper.GetString("session") + netParams := params.GetDefaultNetwork() + netParams.E2EParams.MinKeys = uint16(viper.GetUint("e2eMinKeys")) + netParams.E2EParams.MaxKeys = uint16(viper.GetUint("e2eMaxKeys")) + netParams.E2EParams.NumRekeys = uint16( + viper.GetUint("e2eNumReKeys")) + netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds") + //load the client - client, err := api.Login(storeDir, []byte(pass), params.GetDefaultNetwork()) + client, err := api.Login(storeDir, []byte(pass), netParams) if err != nil { jww.FATAL.Panicf("%+v", err) } @@ -613,6 +627,26 @@ func init() { "Accept the channel request for the corresponding recipient ID") viper.BindPFlag("accept-channel", rootCmd.Flags().Lookup("accept-channel")) + + rootCmd.Flags().BoolP("forceHistoricalRounds", "", false, + "Force all rounds to be sent to historical round retrieval") + viper.BindPFlag("forceHistoricalRounds", + rootCmd.Flags().Lookup("forceHistoricalRounds")) + + // E2E Params + defaultE2EParams := params.GetDefaultE2ESessionParams() + rootCmd.Flags().UintP("e2eMinKeys", + "", uint(defaultE2EParams.MinKeys), + "Minimum number of keys used before requesting rekey") + viper.BindPFlag("MinKeys", rootCmd.Flags().Lookup("e2eMinKeys")) + rootCmd.Flags().UintP("e2eMaxKeys", + "", uint(defaultE2EParams.MaxKeys), + "Max keys used before blocking until a rekey completes") + viper.BindPFlag("e2eMaxKeys", rootCmd.Flags().Lookup("e2eMaxKeys")) + rootCmd.Flags().UintP("e2eNumReKeys", + "", uint(defaultE2EParams.NumRekeys), + "Number of rekeys reserved for rekey operations") + viper.BindPFlag("e2eNumReKeys", rootCmd.Flags().Lookup("e2eNumReKeys")) } // initConfig reads in config file and ENV variables if set. diff --git a/globals/version_vars.go b/globals/version_vars.go index 45b501e82aabf00cdcac5a59113ceb51ea4c8bd8..732e39a6daee62e43cd49872ef647e55cf115a54 100644 --- a/globals/version_vars.go +++ b/globals/version_vars.go @@ -1,9 +1,9 @@ // Code generated by go generate; DO NOT EDIT. // This file was generated by robots at -// 2020-12-30 13:10:27.265664 -0600 CST m=+0.032380471 +// 2021-01-28 22:23:27.98267073 +0000 UTC m=+0.009712900 package globals -const GITVERSION = `8185927 Merge branch 'XX-2971/contactCompression' into 'release'` +const GITVERSION = `c38a960 Merge branch 'XX-3071/knownRoundsImpliesBug' into 'release'` const SEMVER = "1.4.0" const DEPENDENCIES = `module gitlab.com/elixxir/client @@ -14,31 +14,30 @@ require ( github.com/golang/protobuf v1.4.3 github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect github.com/magiconair/properties v1.8.4 // indirect - github.com/mitchellh/mapstructure v1.3.3 // indirect + github.com/mitchellh/mapstructure v1.4.0 // indirect github.com/pelletier/go-toml v1.8.1 // indirect github.com/pkg/errors v0.9.1 github.com/smartystreets/assertions v1.0.1 // indirect - github.com/spf13/afero v1.4.0 // indirect + github.com/spf13/afero v1.5.1 // indirect github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/cobra v1.0.0 + github.com/spf13/cobra v1.1.1 github.com/spf13/jwalterweatherman v1.1.0 - github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.7.1 gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 - gitlab.com/elixxir/comms v0.0.4-0.20201229200853-c403d72e877c - gitlab.com/elixxir/crypto v0.0.7-0.20201222203132-9b4cc1ae3da6 - gitlab.com/elixxir/ekv v0.1.4-0.20201217220111-9c7e8be21577 - gitlab.com/elixxir/primitives v0.0.3-0.20201229212305-2ab1e938b1cb - gitlab.com/xx_network/comms v0.0.4-0.20201222193955-56206d700360 - gitlab.com/xx_network/crypto v0.0.5-0.20201215233953-36cca1af8b2f - gitlab.com/xx_network/primitives v0.0.4-0.20201229212313-fe33d9809f27 - golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 - golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect - golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e // indirect - google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 // indirect - google.golang.org/grpc v1.33.2 // indirect + gitlab.com/elixxir/comms v0.0.4-0.20210125231706-c782d1f645ea + gitlab.com/elixxir/crypto v0.0.7-0.20210125231257-b52a556be893 + gitlab.com/elixxir/ekv v0.1.4 + gitlab.com/elixxir/primitives v0.0.3-0.20210126180712-bfbfb725c75a + gitlab.com/xx_network/comms v0.0.4-0.20210121204701-7a1eb0542424 + gitlab.com/xx_network/crypto v0.0.5-0.20210121204626-b251b926e4f7 + gitlab.com/xx_network/primitives v0.0.4-0.20210121203635-8a771fc14f8a + golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad + golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect + golang.org/x/sys v0.0.0-20210105210732-16f7687f5001 // indirect + google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1 // indirect + google.golang.org/grpc v1.34.0 // indirect google.golang.org/protobuf v1.25.0 - gopkg.in/ini.v1 v1.61.0 // indirect + gopkg.in/ini.v1 v1.62.0 // indirect ) replace google.golang.org/grpc => github.com/grpc/grpc-go v1.27.1 diff --git a/go.mod b/go.mod index cff0e768391d7579628b29049b954625e5b4b577..98faa8e317134c1bc827c49be78190bb74b05374 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module gitlab.com/elixxir/client go 1.13 require ( - github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 // indirect github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/golang/protobuf v1.4.3 github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect @@ -17,16 +16,14 @@ require ( github.com/spf13/cobra v1.1.1 github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/viper v1.7.1 - github.com/ugorji/go v1.1.4 // indirect - github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 // indirect - gitlab.com/elixxir/bloomfilter v0.0.0-20210120224144-ac046983a17a - gitlab.com/elixxir/comms v0.0.4-0.20210208181740-1ad1139f7170 - gitlab.com/elixxir/crypto v0.0.7-0.20210208181828-64b4b57e23d6 + gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 + gitlab.com/elixxir/comms v0.0.4-0.20210202030342-3e0a43736d5b + gitlab.com/elixxir/crypto v0.0.7-0.20210128232700-0d547d16aff5 gitlab.com/elixxir/ekv v0.1.4 - gitlab.com/elixxir/primitives v0.0.3-0.20210127201240-6a42ad925e8a + gitlab.com/elixxir/primitives v0.0.3-0.20210126180712-bfbfb725c75a gitlab.com/xx_network/comms v0.0.4-0.20210121204701-7a1eb0542424 gitlab.com/xx_network/crypto v0.0.5-0.20210121204626-b251b926e4f7 - gitlab.com/xx_network/primitives v0.0.4-0.20210208183356-ee1e9ec13f8f + gitlab.com/xx_network/primitives v0.0.4-0.20210121203635-8a771fc14f8a golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect golang.org/x/sys v0.0.0-20210105210732-16f7687f5001 // indirect diff --git a/go.sum b/go.sum index 7d36eea12e9b2f59707b7674b4a09b0c68330d9e..a886f01e3524bb8619e655488ab037be1050671c 100644 --- a/go.sum +++ b/go.sum @@ -17,7 +17,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/badoux/checkmail v1.2.1 h1:TzwYx5pnsV6anJweMx2auXdekBwGr/yt1GgalIx9nBQ= @@ -29,9 +28,7 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -100,7 +97,6 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -148,7 +144,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY= @@ -167,8 +162,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -216,15 +209,11 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 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= -github.com/spf13/afero v1.4.0 h1:jsLTaI1zwYO3vjrzHalkVcIHXTNmdQFepW4OI8H3+x8= -github.com/spf13/afero v1.4.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.5.1 h1:VHu76Lk0LSP1x254maIu2bplkWpfBWI+B+6fdoZprcg= github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -233,7 +222,6 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= @@ -249,9 +237,7 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= 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= github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6/go.mod h1:yssERNPivllc1yU3BvpjYI5BUW+zglcz6QWqeVRL5t0= github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY= github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= @@ -265,60 +251,22 @@ github.com/zeebo/pcg v1.0.0 h1:dt+dx+HvX8g7Un32rY9XWoYnd0NmKmrIzpHF7qiTDj0= github.com/zeebo/pcg v1.0.0/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 h1:Gi6rj4mAlK0BJIk1HIzBVMjWNjIUfstrsXC2VqLYPcA= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k= -gitlab.com/elixxir/bloomfilter v0.0.0-20210120224144-ac046983a17a h1:0vLmGrqRDlaru89aKQPk3MyRPUInFujpqnVspBA6QTQ= -gitlab.com/elixxir/bloomfilter v0.0.0-20210120224144-ac046983a17a/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k= -gitlab.com/elixxir/comms v0.0.3/go.mod h1:5p7oz4yFrK037rPap6ooaWrloJrzuVZ4jnzOdvgyqnU= -gitlab.com/elixxir/comms v0.0.4-0.20201217200754-6259dc49e6f1 h1:4iuAA/I8/aQ1Jn3gBguuR1u+LVy3YyShxpoNcqApaVg= -gitlab.com/elixxir/comms v0.0.4-0.20201217200754-6259dc49e6f1/go.mod h1:2sNUHm725vQG4pG1RtvMd7kJ5CNqFb7Rl9cenuQCa2c= -gitlab.com/elixxir/comms v0.0.4-0.20201229200853-c403d72e877c h1:YjTlUbZiNiJdL7Fy4TIUoWlHNK4dFOtuJ40YgsG7fac= -gitlab.com/elixxir/comms v0.0.4-0.20201229200853-c403d72e877c/go.mod h1:ezjHgNNuvDBeiFn+N2IcafKKV4ewhzzSpwSjxxaMCcA= -gitlab.com/elixxir/comms v0.0.4-0.20210104224025-4e1cedc524a1 h1:3jDUt9oQoGiWeLPGWCZGJnufAcoANeEqCHsqEDipmWc= -gitlab.com/elixxir/comms v0.0.4-0.20210104224025-4e1cedc524a1/go.mod h1:5vrxoymQ4GE9WKEq9HPTcgIHGyOo/ETE1Oy4FgDcvmo= -gitlab.com/elixxir/comms v0.0.4-0.20210107184523-c6ed72fd848c h1:vhrqnfCQMOu2e1mqlQH71Y5pbjcsXsOHwhyxjeh9Z6A= -gitlab.com/elixxir/comms v0.0.4-0.20210107184523-c6ed72fd848c/go.mod h1:Z90vRwrddd9PYd7qJfKCo74lIZhbPQ/DsENaAZSmgUM= -gitlab.com/elixxir/comms v0.0.4-0.20210108215809-3fd92afa101f h1:8TMZaCE2IH3S4B1a8c46u/rBuRc+dOBPGl8zOO5ihck= -gitlab.com/elixxir/comms v0.0.4-0.20210108215809-3fd92afa101f/go.mod h1:Z90vRwrddd9PYd7qJfKCo74lIZhbPQ/DsENaAZSmgUM= -gitlab.com/elixxir/comms v0.0.4-0.20210112234945-18c36b2d908f h1:EsCG5+sB1ZapIBYP4x55YPKCoSAZF30SMPFuqRnIvWI= -gitlab.com/elixxir/comms v0.0.4-0.20210112234945-18c36b2d908f/go.mod h1:R2Ank04m99uGRhKOssWzITqN47AT+EOyG2OiCHLGroE= -gitlab.com/elixxir/comms v0.0.4-0.20210114174157-1306832d440b h1:LdlL28odDDoQbhpgF7jUR3x2TXG1P4TzGfVBg2Md6Ek= -gitlab.com/elixxir/comms v0.0.4-0.20210114174157-1306832d440b/go.mod h1:R2Ank04m99uGRhKOssWzITqN47AT+EOyG2OiCHLGroE= -gitlab.com/elixxir/comms v0.0.4-0.20210115185903-5dba75967ad3 h1:QJLHqjl35tV/BmFqY+auK6wrmjTdRh+IO/fXQA56XIg= -gitlab.com/elixxir/comms v0.0.4-0.20210115185903-5dba75967ad3/go.mod h1:s+wIMGLQWeIiOY+LYmGciAkcM9whr+CWQNzf8qb+Oao= -gitlab.com/elixxir/comms v0.0.4-0.20210121204920-12c3111eff14 h1:/5w3IE06wUF35/h8x6SHM8zZUcrQw2VgBjhmAcJjDow= -gitlab.com/elixxir/comms v0.0.4-0.20210121204920-12c3111eff14/go.mod h1:oJPQZEobUQwmype16+Hl9s2l+k3luL4ViUKxj0S4Dp8= -gitlab.com/elixxir/comms v0.0.4-0.20210121222442-b714136536e9 h1:9jQb6bynSFVw9jDKX8t71V7EEwKkDtxzDxMaxw7+hYc= -gitlab.com/elixxir/comms v0.0.4-0.20210121222442-b714136536e9/go.mod h1:oJPQZEobUQwmype16+Hl9s2l+k3luL4ViUKxj0S4Dp8= -gitlab.com/elixxir/comms v0.0.4-0.20210126185553-8ccfd64bf81b h1:ENB2YHpF72bbVHA6GG8BrMXEb+si9JHhO39vx7vk7hA= -gitlab.com/elixxir/comms v0.0.4-0.20210126185553-8ccfd64bf81b/go.mod h1:5hxGwa/8BEpo4cZrbxhxyXPpXmwzMPunKE/H141+rPU= -gitlab.com/elixxir/comms v0.0.4-0.20210208181740-1ad1139f7170 h1:YD0QgSP5puQXn3bMOJuA7sT7DXLCVgHBW//PSESU45o= -gitlab.com/elixxir/comms v0.0.4-0.20210208181740-1ad1139f7170/go.mod h1:fWuPOszadMhHLOywy2+mMSMH00k9sh/zw/povSWurn4= +gitlab.com/elixxir/comms v0.0.4-0.20210125231706-c782d1f645ea h1:hpK8M9wSAAhzaA03+1FOniNxgowPm1uTylcpAOa47DQ= +gitlab.com/elixxir/comms v0.0.4-0.20210125231706-c782d1f645ea/go.mod h1:5hxGwa/8BEpo4cZrbxhxyXPpXmwzMPunKE/H141+rPU= +gitlab.com/elixxir/comms v0.0.4-0.20210128232810-8f2ffd6ed805 h1:czoy+y4wbng8weZP9viWj6G41EySfsFszJuSk011G6Y= +gitlab.com/elixxir/comms v0.0.4-0.20210128232810-8f2ffd6ed805/go.mod h1:+7fs54+YYHbC6ljvobl5RgrtgOjt3UBfs5SRNvQFtM4= +gitlab.com/elixxir/comms v0.0.4-0.20210129201143-e9ffafea7e19 h1:3+xu3Tlval4quKSHLxf+y59/iSYKn3gPCUgistRkEgY= +gitlab.com/elixxir/comms v0.0.4-0.20210129201143-e9ffafea7e19/go.mod h1:+7fs54+YYHbC6ljvobl5RgrtgOjt3UBfs5SRNvQFtM4= +gitlab.com/elixxir/comms v0.0.4-0.20210202030342-3e0a43736d5b h1:PrVAexgFtvB7gt8LxhnglY2zQKwDDm+Zai4IkeaixFI= +gitlab.com/elixxir/comms v0.0.4-0.20210202030342-3e0a43736d5b/go.mod h1:+7fs54+YYHbC6ljvobl5RgrtgOjt3UBfs5SRNvQFtM4= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4 h1:28ftZDeYEko7xptCZzeFWS1Iam95dj46TWFVVlKmw6A= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c= gitlab.com/elixxir/crypto v0.0.3 h1:znCt/x2bL4y8czTPaaFkwzdgSgW3BJc/1+dxyf1jqVw= gitlab.com/elixxir/crypto v0.0.3/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA= -gitlab.com/elixxir/crypto v0.0.4/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA= -gitlab.com/elixxir/crypto v0.0.6 h1:c94CGzBTV7LgInGHfmeJHrqq9nIc/WEOLUd9OeQBN74= -gitlab.com/elixxir/crypto v0.0.7-0.20201217200352-0ba771a66932/go.mod h1:nqSNe486j6ua96nv1et6x2ESl/qXevkx7f31GowMRh4= -gitlab.com/elixxir/crypto v0.0.7-0.20201222203132-9b4cc1ae3da6 h1:Vyf2wJ1/CoHLznATpI+z84OJQ+sgAbpVLT9P1CNjSVI= -gitlab.com/elixxir/crypto v0.0.7-0.20201222203132-9b4cc1ae3da6/go.mod h1:NsIzH+TN592lMcmJGVzxUE64dObXuci7jo0qajyGahI= -gitlab.com/elixxir/crypto v0.0.7-0.20210104223925-7dfd3ad55d5c h1:/iLLZvu5mbFXxcjLoguZwKxHslEmaTqR4csfa8X1zIQ= -gitlab.com/elixxir/crypto v0.0.7-0.20210104223925-7dfd3ad55d5c/go.mod h1:cEn3ghYlk7Fhz1dOu3OEw9v9nIZNYH6hqnjHlTLxFiA= -gitlab.com/elixxir/crypto v0.0.7-0.20210107184400-5c3e52a35758 h1:h2l8SZbdgcyMVwgcMqBgAoJSqI1CC23MChB5k7xqqRI= -gitlab.com/elixxir/crypto v0.0.7-0.20210107184400-5c3e52a35758/go.mod h1:JDC7EFs5V97qourZyiSHBiiXHGUoKWX9XtJVhfEvpC4= -gitlab.com/elixxir/crypto v0.0.7-0.20210113224347-cc4926b30fba h1:GtjhegVf6L9MZ6gp2oeBo/oVYUVB/IO91xBycF/jcNo= -gitlab.com/elixxir/crypto v0.0.7-0.20210113224347-cc4926b30fba/go.mod h1:JDC7EFs5V97qourZyiSHBiiXHGUoKWX9XtJVhfEvpC4= -gitlab.com/elixxir/crypto v0.0.7-0.20210114172156-b576829ba7d8 h1:KhhsuPn+aPzZ66jdbbRF55SurogvQ/X9KuMWkXtmq+U= -gitlab.com/elixxir/crypto v0.0.7-0.20210114172156-b576829ba7d8/go.mod h1:4AumkGNppiEaMo6bIpFBrV6wZtaIjpbvkpA5+FBisA8= -gitlab.com/elixxir/crypto v0.0.7-0.20210115231025-5d9b0dbc6985 h1:Csf3dIhwA6D293aURIHKuvwZr4HgIRzJ4FpCklmXEmA= -gitlab.com/elixxir/crypto v0.0.7-0.20210115231025-5d9b0dbc6985/go.mod h1:JDC7EFs5V97qourZyiSHBiiXHGUoKWX9XtJVhfEvpC4= -gitlab.com/elixxir/crypto v0.0.7-0.20210121204803-2caab60ff687 h1:tBlYA/jUOquWpe7bGZBQtvngbfbHsyt11aKZ761++8k= -gitlab.com/elixxir/crypto v0.0.7-0.20210121204803-2caab60ff687/go.mod h1:7egP0+qiVyZnqcBlRr4rL0FhGNkqDCNEygungCAp7NM= gitlab.com/elixxir/crypto v0.0.7-0.20210125231257-b52a556be893 h1:0NjQOwdGO/xBvgBMzRLSFXpSpnluzjT16obl5AcGfmI= gitlab.com/elixxir/crypto v0.0.7-0.20210125231257-b52a556be893/go.mod h1:BoYrgHnTJPvvd4f/f4A+y22wwgZ7IxkYtGC8x9WiwxA= -gitlab.com/elixxir/crypto v0.0.7-0.20210208181828-64b4b57e23d6 h1:Q1Ldvj70eM60MLaHgSXE7C95uTkn5utCq+bMCY2pyrA= -gitlab.com/elixxir/crypto v0.0.7-0.20210208181828-64b4b57e23d6/go.mod h1:JDC7EFs5V97qourZyiSHBiiXHGUoKWX9XtJVhfEvpC4= -gitlab.com/elixxir/ekv v0.1.4-0.20201217220111-9c7e8be21577 h1:qT3ZO9GbKv7PcmakATsXsUdzn/hlm817ETOT/csDIak= -gitlab.com/elixxir/ekv v0.1.4-0.20201217220111-9c7e8be21577/go.mod h1:e6WPUt97taFZe5PFLPb1Dupk7tqmDCTQu1kkstqJvw4= +gitlab.com/elixxir/crypto v0.0.7-0.20210128232700-0d547d16aff5 h1:jNik2VPt/GCzrlNZsjfR+Kdro71td91H4jAmaa4pvA4= +gitlab.com/elixxir/crypto v0.0.7-0.20210128232700-0d547d16aff5/go.mod h1:XfpfHnG+bTq+GjuMI5Ncamnd5zED+1ao4xpxVS2a9Uo= gitlab.com/elixxir/ekv v0.1.4 h1:NLVMwsFEKArWcsDHu2DbXlm9374iSgn7oIA3rVSsvjc= gitlab.com/elixxir/ekv v0.1.4/go.mod h1:e6WPUt97taFZe5PFLPb1Dupk7tqmDCTQu1kkstqJvw4= gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg= @@ -326,56 +274,16 @@ gitlab.com/elixxir/primitives v0.0.0-20200804170709-a1896d262cd9/go.mod h1:p0Vel gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40/go.mod h1:tzdFFvb1ESmuTCOl1z6+yf6oAICDxH2NPUemVgoNLxc= gitlab.com/elixxir/primitives v0.0.1 h1:q61anawANlNAExfkeQEE1NCsNih6vNV1FFLoUQX6txQ= gitlab.com/elixxir/primitives v0.0.1/go.mod h1:kNp47yPqja2lHSiS4DddTvFpB/4D9dB2YKnw5c+LJCE= -gitlab.com/elixxir/primitives v0.0.2/go.mod h1:3fxFHSlQhkV4vs+S0dZEz3Om3m+40WX8L806yvSnNFc= -gitlab.com/elixxir/primitives v0.0.3-0.20201217193438-8ebfc882f1de/go.mod h1:H1OZ6ZXzTB3G4nOEdJzBJ7BySRnivpJTkTphxazFCl4= -gitlab.com/elixxir/primitives v0.0.3-0.20201222171449-bdfe30389bb5 h1:BUV1ouY+9NA5+ZF+QfTpIBL1vO5zk31I68N7DX9bKj8= -gitlab.com/elixxir/primitives v0.0.3-0.20201222171449-bdfe30389bb5/go.mod h1:5Z8fce94mks0aFhMvzftx2jJpDx4/pzDU20G2oTiU9w= -gitlab.com/elixxir/primitives v0.0.3-0.20201229212305-2ab1e938b1cb h1:7LMaemxU2c3qlsK/4m4/sXVj5OWdn+9rhXC2u6b03aQ= -gitlab.com/elixxir/primitives v0.0.3-0.20201229212305-2ab1e938b1cb/go.mod h1:5Z8fce94mks0aFhMvzftx2jJpDx4/pzDU20G2oTiU9w= -gitlab.com/elixxir/primitives v0.0.3-0.20210104223605-0e47af99d9d5 h1:gFnu6lXLNG7jMRpR0990iRimotw1eMsV4wQU9tce3JQ= -gitlab.com/elixxir/primitives v0.0.3-0.20210104223605-0e47af99d9d5/go.mod h1:BLL0lkR9foigqmsz1p3OLnwACBhS9fd3mVk9Ftflg9E= -gitlab.com/elixxir/primitives v0.0.3-0.20210106014507-bf3dfe228fa6 h1:sUqEla1uUIzhYph49nNwpo7tyEKSqKAcoIpqNhz7fHg= -gitlab.com/elixxir/primitives v0.0.3-0.20210106014507-bf3dfe228fa6/go.mod h1:Ph6isHUDVjmRUd9DioyKpd8W9J52gKBiDeue4DCygXA= -gitlab.com/elixxir/primitives v0.0.3-0.20210107183456-9cf6fe2de1e5 h1:50HbCJWirpX2Q+NNhIHcs0M9f45H1UJ/7LNMu81Bnn0= -gitlab.com/elixxir/primitives v0.0.3-0.20210107183456-9cf6fe2de1e5/go.mod h1:Ph6isHUDVjmRUd9DioyKpd8W9J52gKBiDeue4DCygXA= -gitlab.com/elixxir/primitives v0.0.3-0.20210121204717-e15ada7f0a73 h1:9h+pCc1ceIWDR1CM5sdoV7KHvNYzKQRJjeIfc26fyDU= -gitlab.com/elixxir/primitives v0.0.3-0.20210121204717-e15ada7f0a73/go.mod h1:bGYfAGerVVZhNzh+PxOMZVG7iYAUfInYvtdAkAqgiY8= -gitlab.com/elixxir/primitives v0.0.3-0.20210122185056-ad244787d961 h1:BUN6bUBmTeebwYvTQ5yVi1iJlNAhjR7kEndcsV339dE= -gitlab.com/elixxir/primitives v0.0.3-0.20210122185056-ad244787d961/go.mod h1:bGYfAGerVVZhNzh+PxOMZVG7iYAUfInYvtdAkAqgiY8= +gitlab.com/elixxir/primitives v0.0.3-0.20210125225949-9469ce6b08fc h1:V+E0pUqqpu7u6epgR3e73D+Og7dQBV3y7dQA9AUZzuA= gitlab.com/elixxir/primitives v0.0.3-0.20210125225949-9469ce6b08fc/go.mod h1:bGYfAGerVVZhNzh+PxOMZVG7iYAUfInYvtdAkAqgiY8= gitlab.com/elixxir/primitives v0.0.3-0.20210126180712-bfbfb725c75a h1:3jq90Nmn8Ew9vfUuizV4mvj6py5LOmX3wkuBc+ywJ0w= gitlab.com/elixxir/primitives v0.0.3-0.20210126180712-bfbfb725c75a/go.mod h1:bGYfAGerVVZhNzh+PxOMZVG7iYAUfInYvtdAkAqgiY8= -gitlab.com/elixxir/primitives v0.0.3-0.20210127201240-6a42ad925e8a h1:ZQncDfITNE12EdJK+shh6UzHlALhNU4Zjvv4hid2krs= -gitlab.com/elixxir/primitives v0.0.3-0.20210127201240-6a42ad925e8a/go.mod h1:Ph6isHUDVjmRUd9DioyKpd8W9J52gKBiDeue4DCygXA= gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw= -gitlab.com/xx_network/comms v0.0.3/go.mod h1:YViGbRj7FjJYoaO4NpALGEd9dK/l8uUT000FEBbUTL8= -gitlab.com/xx_network/comms v0.0.4-0.20201130190834-365ddae56e7b/go.mod h1:YViGbRj7FjJYoaO4NpALGEd9dK/l8uUT000FEBbUTL8= -gitlab.com/xx_network/comms v0.0.4-0.20201217200138-87075d5b4ffd h1:4LjS3UuBNA/AaglIJ+k1IBoxYgCWt+FM1MPYxjAFfaQ= -gitlab.com/xx_network/comms v0.0.4-0.20201217200138-87075d5b4ffd/go.mod h1:/vIk6tSrDqk/7HZOdrbSXZT+kEL43HIoz60AoZTzTXg= -gitlab.com/xx_network/comms v0.0.4-0.20201222193955-56206d700360 h1:IlPemXfxV/yyUl5bAV5yATQKtmrsL7SMzho5FqAUv0s= -gitlab.com/xx_network/comms v0.0.4-0.20201222193955-56206d700360/go.mod h1:YViGbRj7FjJYoaO4NpALGEd9dK/l8uUT000FEBbUTL8= -gitlab.com/xx_network/comms v0.0.4-0.20210106014446-be163ef3ccce h1:pH7F2JlYt1qrILwmdKZPG4SnS8QHWd/NrxxdNjvvCLc= -gitlab.com/xx_network/comms v0.0.4-0.20210106014446-be163ef3ccce/go.mod h1:xAgzEb4piiMJtIBqmDELgMkAjaBJVuznCBU2ALd9GnA= -gitlab.com/xx_network/comms v0.0.4-0.20210107184305-7bb439c08ded h1:VHAQcap/+jcFaaMhTVSEqC7hrLLXLkHUI5cJBtSGsGI= -gitlab.com/xx_network/comms v0.0.4-0.20210107184305-7bb439c08ded/go.mod h1:12OZe2Ol9lEk7JTm48GQ4zj1O01SH0ygfLqOb8EHrtU= -gitlab.com/xx_network/comms v0.0.4-0.20210112233928-eac8db03c397 h1:E7p5lGX+nTAIKB6Wno3mRxBfC+SX5ZY2FKp8JEMzdSM= -gitlab.com/xx_network/comms v0.0.4-0.20210112233928-eac8db03c397/go.mod h1:12OZe2Ol9lEk7JTm48GQ4zj1O01SH0ygfLqOb8EHrtU= -gitlab.com/xx_network/comms v0.0.4-0.20210115175102-ad5814bff11c h1:MRxHypL++mTDzVJq503ePBW3aGHE5FTG1ybac8rGK0A= -gitlab.com/xx_network/comms v0.0.4-0.20210115175102-ad5814bff11c/go.mod h1:12OZe2Ol9lEk7JTm48GQ4zj1O01SH0ygfLqOb8EHrtU= gitlab.com/xx_network/comms v0.0.4-0.20210121204701-7a1eb0542424 h1:zhfkbutYEY7PQuC1kcugCt4am/oRAyla6u4xDc5PqWs= gitlab.com/xx_network/comms v0.0.4-0.20210121204701-7a1eb0542424/go.mod h1:MNkja6iUsM2yjBQicwLUGYctZmAU/D4AMpDD04vfBg8= gitlab.com/xx_network/crypto v0.0.3/go.mod h1:DF2HYvvCw9wkBybXcXAgQMzX+MiGbFPjwt3t17VRqRE= gitlab.com/xx_network/crypto v0.0.4 h1:lpKOL5mTJ2awWMfgBy30oD/UvJVrWZzUimSHlOdZZxo= gitlab.com/xx_network/crypto v0.0.4/go.mod h1:+lcQEy+Th4eswFgQDwT0EXKp4AXrlubxalwQFH5O0Mk= -gitlab.com/xx_network/crypto v0.0.5-0.20201125005132-fd9d3cd31e0b/go.mod h1:+lcQEy+Th4eswFgQDwT0EXKp4AXrlubxalwQFH5O0Mk= -gitlab.com/xx_network/crypto v0.0.5-0.20201215233953-36cca1af8b2f h1:Qdd2h1FsX8KLdcAHn6TcT93ex23p3qcuwkg7XjAAx/g= -gitlab.com/xx_network/crypto v0.0.5-0.20201215233953-36cca1af8b2f/go.mod h1:NM4Lk3//mOSlWwySpaH8FMmYZNm8qtjr6EawfaAHzH4= -gitlab.com/xx_network/crypto v0.0.5-0.20201217195719-cc31e1d1eee3 h1:xXJAkvhHZl5CUX8/9rqe8hod5FbqZrxwMuT8cG48Mxs= -gitlab.com/xx_network/crypto v0.0.5-0.20201217195719-cc31e1d1eee3/go.mod h1:iHCS8UOFndbXivLTeIarxN8TKbi3NcanZj29KtMzs2o= -gitlab.com/xx_network/crypto v0.0.5-0.20210106014410-0554a33a7124 h1:G2fNW7uPzJEo+mUfFzBvXYC4Vt6GXOcAC2722pKtK5g= -gitlab.com/xx_network/crypto v0.0.5-0.20210106014410-0554a33a7124/go.mod h1:tTYlvAZNUFMtndcijM37iujkM4gP8kUwGiS9n7NA5Ck= -gitlab.com/xx_network/crypto v0.0.5-0.20210107183440-804e0f8b7d22 h1:SQga1vOuAGzbYURnBjG0f37r7WmWKZRdiqmdopaNMb4= -gitlab.com/xx_network/crypto v0.0.5-0.20210107183440-804e0f8b7d22/go.mod h1:tTYlvAZNUFMtndcijM37iujkM4gP8kUwGiS9n7NA5Ck= gitlab.com/xx_network/crypto v0.0.5-0.20210121204626-b251b926e4f7 h1:eraxUmI0EFDtfqTV4Ojndoh8Bv8PBUbZaT27VLU1yhc= gitlab.com/xx_network/crypto v0.0.5-0.20210121204626-b251b926e4f7/go.mod h1:61fEAGI2+JD6CbT5PMzxy1SBMvgiFxE4MyiQghzoOVg= gitlab.com/xx_network/primitives v0.0.0-20200803231956-9b192c57ea7c/go.mod h1:wtdCMr7DPePz9qwctNoAUzZtbOSHSedcK++3Df3psjA= @@ -383,33 +291,8 @@ gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da h1:CCVslUwNC gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da/go.mod h1:OK9xevzWCaPO7b1wiluVJGk7R5ZsuC7pHY5hteZFQug= gitlab.com/xx_network/primitives v0.0.2 h1:r45yKenJ9e7PylI1ZXJ1Es09oYNaYXjxVy9+uYlwo7Y= gitlab.com/xx_network/primitives v0.0.2/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= -gitlab.com/xx_network/primitives v0.0.3 h1:RBJGPtphUyDvN8iG8+VTF8tr5iT9f5WHo0NCbenspYE= -gitlab.com/xx_network/primitives v0.0.3/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= -gitlab.com/xx_network/primitives v0.0.4-0.20201216174909-808eb0fc97fc h1:nZ0kNhQfkEr4TIpf1MQxOIWiSd1M1YTE2JrFA1SPSD4= -gitlab.com/xx_network/primitives v0.0.4-0.20201216174909-808eb0fc97fc/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= -gitlab.com/xx_network/primitives v0.0.4-0.20201229212313-fe33d9809f27 h1:JGpYRKkhPw58dlhii/wH8N9uWZ1AOTyVw3b6ZYdndA8= -gitlab.com/xx_network/primitives v0.0.4-0.20201229212313-fe33d9809f27/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= -gitlab.com/xx_network/primitives v0.0.4-0.20210106014326-691ebfca3b07 h1:ZxGp7Q0Vyx2mWM84GIPPT3PZK2TLfwycSIk7EgNMIws= -gitlab.com/xx_network/primitives v0.0.4-0.20210106014326-691ebfca3b07/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= -gitlab.com/xx_network/primitives v0.0.4-0.20210114170718-1549f24d462c/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210118193646-93176e2e6925 h1:n40/5N6aXnye+QmkqKCnEEEepYw4lN9uQ/mhAyCyA3o= -gitlab.com/xx_network/primitives v0.0.4-0.20210118193646-93176e2e6925/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= gitlab.com/xx_network/primitives v0.0.4-0.20210121203635-8a771fc14f8a h1:ZDv8RHUsl9pjIkgqd8u6y00P+6TXEASwBg9dpvHSsT0= gitlab.com/xx_network/primitives v0.0.4-0.20210121203635-8a771fc14f8a/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210127181825-f9178f9d19b5 h1:dI/3SkJie/Twy4ZZnsNncyiLI6KHJboaRagSU5V96YY= -gitlab.com/xx_network/primitives v0.0.4-0.20210127181825-f9178f9d19b5/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210129181607-5b719add9171 h1:9nvaBYeOH/f8Ev/1b3IhoJdrxXaQZ5Lb/tFe1GzqH00= -gitlab.com/xx_network/primitives v0.0.4-0.20210129181607-5b719add9171/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210201174745-f294e495260d h1:tXEJOJq6rIizJyo/fgs6G17isq9UMahHx6BPtXgheLg= -gitlab.com/xx_network/primitives v0.0.4-0.20210201174745-f294e495260d/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210201180649-48711cee9127 h1:DYYHQeNyh/6Cj3swZYy8bAYFL4yqxedu2dFZMDt8D3M= -gitlab.com/xx_network/primitives v0.0.4-0.20210201180649-48711cee9127/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210201180820-639f0a366d52 h1:gZk8XTQOAFt3IUd2LUsWWYpQQz5ktQF5uD+gV4pu4e8= -gitlab.com/xx_network/primitives v0.0.4-0.20210201180820-639f0a366d52/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210202001929-8bf8bf35a234 h1:OXR+c++r+IsFu4OKEMY9pJrZFCTp/qt8irEdCgNj4Hw= -gitlab.com/xx_network/primitives v0.0.4-0.20210202001929-8bf8bf35a234/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20210208183356-ee1e9ec13f8f h1:21mljvQ0ZPNZbOP0BG5JNGlDgiC/vg9NZ/AaseXSxBI= -gitlab.com/xx_network/primitives v0.0.4-0.20210208183356-ee1e9ec13f8f/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= gitlab.com/xx_network/ring v0.0.2 h1:TlPjlbFdhtJrwvRgIg4ScdngMTaynx/ByHBRZiXCoL0= gitlab.com/xx_network/ring v0.0.2/go.mod h1:aLzpP2TiZTQut/PVHR40EJAomzugDdHXetbieRClXIM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -433,10 +316,6 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 h1:3wPMTskHO3+O6jqTEXyFcsnuxMQOqYSaHsDxcbUXpqA= -golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -467,14 +346,11 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/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-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201029221708-28c70e62bb1d/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -506,8 +382,6 @@ golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201029080932-201ba4db2418/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210105210732-16f7687f5001 h1:/dSxr6gT0FNI1MO5WLJo8mTmItROeOKTkDn+7OwWBos= golang.org/x/sys v0.0.0-20210105210732-16f7687f5001/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -562,8 +436,6 @@ google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBr google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 h1:Rt0FRalMgdSlXAVJvX4pr65KfqaxHXSLkSJRD9pw6g0= -google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1 h1:Zk6zlGXdtYdcY5TL+VrbTfmifvk3VvsXopCpszsHPBA= google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -585,13 +457,10 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= -gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= diff --git a/interfaces/params/E2E.go b/interfaces/params/E2E.go index 7a2e38428cfcf7c60604ad4445ec80e9ba680145..b0ae16cba1830709a3d826a5f99df6f8bf483b32 100644 --- a/interfaces/params/E2E.go +++ b/interfaces/params/E2E.go @@ -10,6 +10,7 @@ package params import ( "encoding/json" "fmt" + "gitlab.com/elixxir/crypto/e2e" ) type E2E struct { @@ -55,3 +56,43 @@ func (st SendType) String() string { return fmt.Sprintf("Unknown SendType %v", uint8(st)) } } + +// Network E2E Params + +// DEFAULT KEY GENERATION PARAMETERS +// Hardcoded limits for keys +// With 16 receiving states we can hold +// 16*64=1024 dirty bits for receiving keys +// With that limit, and setting maxKeys to 800, +// we need a Threshold of 224, and a scalar +// smaller than 1.28 to ensure we never generate +// more than 1024 keys +// With 1 receiving states for ReKeys we can hold +// 64 Rekeys +const ( + minKeys uint16 = 500 + maxKeys uint16 = 800 + ttlScalar float64 = 1.2 // generate 20% extra keys + threshold uint16 = 224 + numReKeys uint16 = 64 +) + +type E2ESessionParams struct { + MinKeys uint16 + MaxKeys uint16 + NumRekeys uint16 + e2e.TTLParams +} + +func GetDefaultE2ESessionParams() E2ESessionParams { + return E2ESessionParams{ + MinKeys: minKeys, + MaxKeys: maxKeys, + NumRekeys: numReKeys, + } +} + +func (p E2ESessionParams) String() string { + return fmt.Sprintf("Params{ MinKeys: %d, MaxKeys: %d, NumRekeys: %d }", + p.MinKeys, p.MaxKeys, p.NumRekeys) +} diff --git a/interfaces/params/E2E_test.go b/interfaces/params/E2E_test.go index f7d90c4eece73233d37e3941879ccff7bf640f57..1f4b599bdec30b5ed2461d7e6bdee3c172a279d5 100644 --- a/interfaces/params/E2E_test.go +++ b/interfaces/params/E2E_test.go @@ -66,3 +66,17 @@ func TestGetE2EParameters_Default(t *testing.T) { t.Errorf("Parameters failed to change! Got %d, Expected %d", q.RoundTries, p.RoundTries) } } + +// Test that the GetDefaultParams function returns the right default data +func Test_GetDefaultParams(t *testing.T) { + p := GetDefaultE2ESessionParams() + if p.MinKeys != minKeys { + t.Errorf("MinKeys mismatch\r\tGot: %d\r\tExpected: %d", p.MinKeys, minKeys) + } + if p.MaxKeys != maxKeys { + t.Errorf("MinKeys mismatch\r\tGot: %d\r\tExpected: %d", p.MaxKeys, maxKeys) + } + if p.NumRekeys != numReKeys { + t.Errorf("MinKeys mismatch\r\tGot: %d\r\tExpected: %d", p.NumRekeys, numReKeys) + } +} diff --git a/interfaces/params/network.go b/interfaces/params/network.go index 75e7aa4e4dd04d8a8a9d33f253d95eac8ae44e67..f3de8ea10ee17e5408c2b72d335e8b2ea884e428 100644 --- a/interfaces/params/network.go +++ b/interfaces/params/network.go @@ -25,6 +25,8 @@ type Network struct { Rounds Messages Rekey + + E2EParams E2ESessionParams } func GetDefaultNetwork() Network { @@ -33,6 +35,7 @@ func GetDefaultNetwork() Network { MaxCheckedRounds: 500, RegNodesBufferLen: 500, NetworkHealthTimeout: 30 * time.Second, + E2EParams: GetDefaultE2ESessionParams(), } n.Rounds = GetDefaultRounds() n.Messages = GetDefaultMessage() diff --git a/interfaces/params/rounds.go b/interfaces/params/rounds.go index 483e6872101ceee68e329173a09c92b0790886c9..dbf0d5a00fdbb07ad813244f75f84eda34ddcd57 100644 --- a/interfaces/params/rounds.go +++ b/interfaces/params/rounds.go @@ -12,22 +12,25 @@ import ( ) type Rounds struct { - // maximum number of times to attempt to retrieve a round from a gateway + // Maximum number of times to attempt to retrieve a round from a gateway // before giving up on it MaxAttemptsCheckingARound uint - // number of historical rounds required to automatically send a historical + // Number of historical rounds required to automatically send a historical // rounds query MaxHistoricalRounds uint - // maximum period of time a pending historical round query will wait before - // it si transmitted + // Maximum period of time a pending historical round query will wait before + // it is transmitted HistoricalRoundsPeriod time.Duration - // number of worker threads for retreiving messages from gateways + // Number of worker threads for retrieving messages from gateways NumMessageRetrievalWorkers uint - //Length of historical rounds channel buffer + // Length of historical rounds channel buffer HistoricalRoundsBufferLen uint - //Length of round lookup channel buffer + // Length of round lookup channel buffer LookupRoundsBufferLen uint + + // Toggles if historical rounds should always be used + ForceHistoricalRounds bool } func GetDefaultRounds() Rounds { @@ -39,5 +42,6 @@ func GetDefaultRounds() Rounds { HistoricalRoundsBufferLen: 1000, LookupRoundsBufferLen: 2000, + ForceHistoricalRounds: false, } } diff --git a/keyExchange/confirm_test.go b/keyExchange/confirm_test.go index 188a58686d72ba9ae8d306002f6229173b017db6..b2e619c684c0985ded4887178113ade1d489af1d 100644 --- a/keyExchange/confirm_test.go +++ b/keyExchange/confirm_test.go @@ -10,6 +10,7 @@ package keyExchange import ( "github.com/golang/protobuf/proto" "gitlab.com/elixxir/client/interfaces/message" + "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/e2e" "gitlab.com/xx_network/primitives/id" "testing" @@ -31,7 +32,8 @@ func TestHandleConfirm(t *testing.T) { // Add bob as a partner aliceSession.E2e().AddPartner(bobID, bobPubKey, alicePrivKey, - e2e.GetDefaultSessionParams(), e2e.GetDefaultSessionParams()) + params.GetDefaultE2ESessionParams(), + params.GetDefaultE2ESessionParams()) // Generate a session ID, bypassing some business logic here sessionID := GeneratePartnerID(alicePrivKey, bobPubKey, genericGroup) diff --git a/keyExchange/exchange_test.go b/keyExchange/exchange_test.go index 40265bc30389f6c81bc91c188af9978f4e44c743..2c1729995c28d528c19ffe88a92ae425d2b57e0d 100644 --- a/keyExchange/exchange_test.go +++ b/keyExchange/exchange_test.go @@ -49,9 +49,11 @@ func TestFullExchange(t *testing.T) { // Add Alice and Bob as partners aliceSession.E2e().AddPartner(exchangeBobId, bobPubKey, alicePrivKey, - e2e.GetDefaultSessionParams(), e2e.GetDefaultSessionParams()) + params.GetDefaultE2ESessionParams(), + params.GetDefaultE2ESessionParams()) bobSession.E2e().AddPartner(exchangeAliceId, alicePubKey, bobPrivKey, - e2e.GetDefaultSessionParams(), e2e.GetDefaultSessionParams()) + params.GetDefaultE2ESessionParams(), + params.GetDefaultE2ESessionParams()) // Start the listeners for alice and bob rekeyParams := params.GetDefaultRekey() diff --git a/keyExchange/rekey.go b/keyExchange/rekey.go index 8391f2653ebca789d875f4f79044ac67af91cacd..deeec7dbbe5ea2bf9a4b04b2db6688abccb4982b 100644 --- a/keyExchange/rekey.go +++ b/keyExchange/rekey.go @@ -49,7 +49,7 @@ func trigger(instance *network.Instance, sendE2E interfaces.SendE2E, fmt.Printf("in new session triggered\n") //create the session, pass a nil private key to generate a new one negotiatingSession = manager.NewSendSession(nil, - e2e.GetDefaultSessionParams()) + sess.E2e().GetE2ESessionParams()) //move the state of the triggering session forward session.SetNegotiationStatus(e2e.NewSessionCreated) fmt.Printf("after setting session: %v\n", negotiatingSession.NegotiationStatus()) diff --git a/keyExchange/trigger.go b/keyExchange/trigger.go index 5019dc05f936b85bea9a9f2d19bb436f8f199032..544cde8eee82c1979568f639cc0d454f6d205d06 100644 --- a/keyExchange/trigger.go +++ b/keyExchange/trigger.go @@ -81,7 +81,7 @@ func handleTrigger(sess *storage.Session, net interfaces.NetworkManager, //create the new session session, duplicate := partner.NewReceiveSession(PartnerPublicKey, - e2e.GetDefaultSessionParams(), oldSession) + sess.E2e().GetE2ESessionParams(), oldSession) // new session being nil means the session was a duplicate. This is possible // in edge cases where the partner crashes during operation. The session // creation in this case ignores the new session, but the confirmation diff --git a/keyExchange/trigger_test.go b/keyExchange/trigger_test.go index 60c7b4c65e4137ffab880498030b68ca845f1ccf..c69e09562bd10bbe998855c33f3c765b7f0ed085 100644 --- a/keyExchange/trigger_test.go +++ b/keyExchange/trigger_test.go @@ -38,8 +38,8 @@ func TestHandleTrigger(t *testing.T) { // Add bob as a partner aliceSession.E2e().AddPartner(bobID, bobSession.E2e().GetDHPublicKey(), - alicePrivKey, e2e.GetDefaultSessionParams(), - e2e.GetDefaultSessionParams()) + alicePrivKey, params.GetDefaultE2ESessionParams(), + params.GetDefaultE2ESessionParams()) // Generate a session ID, bypassing some business logic here oldSessionID := GeneratePartnerID(alicePrivKey, bobPubKey, genericGroup) diff --git a/network/gateway/gateway.go b/network/gateway/gateway.go index 1c2c247f33eb64993da2bd1288f979e454e5a9a9..2af245821076802716ffd2bd1412f5a3fdc43540 100644 --- a/network/gateway/gateway.go +++ b/network/gateway/gateway.go @@ -23,10 +23,14 @@ type HostGetter interface { GetHost(hostId *id.ID) (*connect.Host, bool) } +// Get the Host of a random gateway in the NDF func Get(ndf *ndf.NetworkDefinition, hg HostGetter, rng io.Reader) (*connect.Host, error) { - // Get a random gateway - gateways := ndf.Gateways - gwIdx := ReadRangeUint32(0, uint32(len(gateways)), rng) + gwLen := uint32(len(ndf.Gateways)) + if gwLen == 0 { + return nil, errors.Errorf("no gateways available") + } + + gwIdx := ReadRangeUint32(0, gwLen, rng) gwID, err := id.Unmarshal(ndf.Nodes[gwIdx].ID) if err != nil { return nil, errors.WithMessage(err, "failed to get Gateway") @@ -40,6 +44,7 @@ func Get(ndf *ndf.NetworkDefinition, hg HostGetter, rng io.Reader) (*connect.Hos return gwHost, nil } +// Get the last gateway Host from the given RoundInfo func GetLast(hg HostGetter, ri *mixmessages.RoundInfo) (*connect.Host, error) { roundTop := ri.GetTopology() lastGw, err := id.Unmarshal(roundTop[len(roundTop)-1]) diff --git a/network/manager.go b/network/manager.go index 592ee108b11fae5408c9f802c11c6874726e719f..fa6a319428c903c3cdf361f4efb5aa09530544b3 100644 --- a/network/manager.go +++ b/network/manager.go @@ -63,6 +63,11 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard, running := uint32(0) + // Note: These are not loaded/stored in E2E Store, but the + // E2E Session Params are a part of the network parameters, so we + // set them here when they are needed on startup + session.E2e().SetE2ESessionParams(params.E2EParams) + //create manager object m := manager{ param: params, diff --git a/network/message/garbled_test.go b/network/message/garbled_test.go index 4721d9ea18d57e8287c926c6862743e3506fdda0..7b5dd1864db860264860b1d8d71ccb2ff3633d58 100644 --- a/network/message/garbled_test.go +++ b/network/message/garbled_test.go @@ -7,7 +7,6 @@ import ( "gitlab.com/elixxir/client/network/internal" "gitlab.com/elixxir/client/network/message/parse" "gitlab.com/elixxir/client/storage" - "gitlab.com/elixxir/client/storage/e2e" "gitlab.com/elixxir/client/switchboard" "gitlab.com/elixxir/comms/client" "gitlab.com/elixxir/crypto/fastRNG" @@ -65,13 +64,18 @@ func TestManager_CheckGarbledMessages(t *testing.T) { }, nil) e2ekv := i.Session.E2e() - err = e2ekv.AddPartner(sess2.GetUser().ReceptionID, sess2.E2e().GetDHPublicKey(), e2ekv.GetDHPrivateKey(), e2e.GetDefaultSessionParams(), e2e.GetDefaultSessionParams()) + err = e2ekv.AddPartner(sess2.GetUser().ID, sess2.E2e().GetDHPublicKey(), e2ekv.GetDHPrivateKey(), + params.GetDefaultE2ESessionParams(), + params.GetDefaultE2ESessionParams()) if err != nil { t.Errorf("Failed to add e2e partner: %+v", err) t.FailNow() } - err = sess2.E2e().AddPartner(sess1.GetUser().ReceptionID, sess1.E2e().GetDHPublicKey(), sess2.E2e().GetDHPrivateKey(), e2e.GetDefaultSessionParams(), e2e.GetDefaultSessionParams()) + err = sess2.E2e().AddPartner(sess1.GetUser().ID, + sess1.E2e().GetDHPublicKey(), sess2.E2e().GetDHPrivateKey(), + params.GetDefaultE2ESessionParams(), + params.GetDefaultE2ESessionParams()) if err != nil { t.Errorf("Failed to add e2e partner: %+v", err) t.FailNow() diff --git a/network/message/parse/firstMessagePart_test.go b/network/message/parse/firstMessagePart_test.go index e1e7e692621e7251703695ac7c37861dfc18c830..676723247fec562607d43f9a29dec827890c76a8 100644 --- a/network/message/parse/firstMessagePart_test.go +++ b/network/message/parse/firstMessagePart_test.go @@ -1,34 +1,100 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright © 2020 xx network SEZC // +// // +// Use of this source code is governed by a license that can be found in the // +// LICENSE file // +/////////////////////////////////////////////////////////////////////////////// + package parse import ( "bytes" "gitlab.com/elixxir/client/interfaces/message" + "reflect" "testing" "time" ) -func TestnewFirstMessagePart(t *testing.T) { - now := time.Now() - fmp := newFirstMessagePart(message.Text, uint32(6), uint8(2), now, - []byte{'t', 'e', 's', 't', 'i', 'n', 'g'}) +// Expected firstMessagePart for checking against, generated by fmp in TestNewFirstMessagePart +var efmp = firstMessagePart{ + messagePart: messagePart{ + Data: []byte{0, 0, 4, 53, 0, 0, 13, 2, 0, 0, 0, 2, 1, 0, 0, 0, 14, 215, 133, 90, 117, 0, 0, 0, 0, 255, 255, + 116, 101, 115, 116, 105, 110, 103, 115, 116, 114, 105, 110, 103}, + Id: []byte{0, 0, 4, 53}, + Part: []byte{0}, + Len: []byte{0, 13}, + Contents: []byte{116, 101, 115, 116, 105, 110, 103, 115, 116, 114, 105, 110, 103}, + }, + NumParts: []byte{2}, + Type: []byte{0, 0, 0, 2}, + Timestamp: []byte{1, 0, 0, 0, 14, 215, 133, 90, 117, 0, 0, 0, 0, 255, 255}, +} - if fmp.GetType() != message.Text { +// Test that newFirstMessagePart returns a correctly made firstMessagePart +func TestNewFirstMessagePart(t *testing.T) { + fmp := newFirstMessagePart( + message.Text, + 1077, + 2, + time.Unix(1609786229, 0).UTC(), + []byte{'t', 'e', 's', 't', 'i', 'n', 'g', + 's', 't', 'r', 'i', 'n', 'g'}, + ) + gotTime, err := fmp.GetTimestamp() + if err != nil { + t.Error(err) + } + expectedTime, err := fmp.GetTimestamp() + if err != nil { + t.Error(err) } + if !gotTime.Equal(expectedTime) { + t.Errorf("Got time: %v, expected time: %v", gotTime, expectedTime) + } + + if !reflect.DeepEqual(fmp, efmp) { + t.Errorf("Expected and got firstMessagePart did not match.\n\tGot: %#v\n\tExpected: %#v", fmp, efmp) + } +} - if fmp.GetNumParts() != uint8(2) { +// Test that FirstMessagePartFromBytes returns a correctly made firstMessagePart from the bytes of one +func TestFirstMessagePartFromBytes(t *testing.T) { + fmp := FirstMessagePartFromBytes(efmp.Data) + if !reflect.DeepEqual(fmp, efmp) { + t.Error("Expected and got firstMessagePart did not match") } +} - recorded_now, err := fmp.GetTimestamp() - if err != nil { - t.Fatal(err) +// Test that GetType returns the correct type for a firstMessagePart +func TestFirstMessagePart_GetType(t *testing.T) { + if efmp.GetType() != message.Text { + t.Errorf("Got %v, expected %v", efmp.GetType(), message.Text) } - if recorded_now != now { +} +// Test that GetNumParts returns the correct number of parts for a firstMessagePart +func TestFirstMessagePart_GetNumParts(t *testing.T) { + if efmp.GetNumParts() != 2 { + t.Errorf("Got %v, expected %v", efmp.GetNumParts(), 2) } +} - if !bytes.Equal(fmp.Bytes(), []byte{'t', 'e', 's', 't', 'i', 'n', 'g'}) { +// Test that GetTimestamp returns the correct timestamp for a firstMessagePart +func TestFirstMessagePart_GetTimestamp(t *testing.T) { + et, err := efmp.GetTimestamp() + if err != nil { + t.Error(err) + } + if !time.Unix(1609786229, 0).Equal(et) { + t.Errorf("Got %v, expected %v", et, time.Unix(1609786229, 0)) + } +} +// Test that GetTimestamp returns the correct bytes for a firstMessagePart +func TestFirstMessagePart_Bytes(t *testing.T) { + if bytes.Compare(efmp.Bytes(), efmp.Data) != 0 { + t.Errorf("Got %v, expected %v", efmp.Bytes(), efmp.Data) } } diff --git a/network/message/parse/messagePart_test.go b/network/message/parse/messagePart_test.go new file mode 100644 index 0000000000000000000000000000000000000000..5ab1db0213c05a18f7615a836e627350a5879616 --- /dev/null +++ b/network/message/parse/messagePart_test.go @@ -0,0 +1,70 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright © 2020 xx network SEZC // +// // +// Use of this source code is governed by a license that can be found in the // +// LICENSE file // +/////////////////////////////////////////////////////////////////////////////// + +package parse + +import ( + "bytes" + "reflect" + "testing" +) + +// Expected messagePart for checking against, generated by gotmp in Test_newMessagePart +var emp = messagePart{ + Data: []uint8{0x0, 0x0, 0x0, 0x20, 0x6, 0x0, 0x7, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67}, + Id: []uint8{0x0, 0x0, 0x0, 0x20}, Part: []uint8{0x6}, + Len: []uint8{0x0, 0x7}, + Contents: []uint8{0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67}, +} + +// This tests that a new function part is successfully created +func Test_newMessagePart(t *testing.T) { + gotmp := newMessagePart(32, 6, []byte{'t', 'e', 's', 't', 'i', 'n', 'g'}) + if !reflect.DeepEqual(gotmp, emp) { + t.Errorf("MessagePart received and MessagePart expected do not match.\n\tGot: %#v\n\tExpected: %#v", gotmp, emp) + } +} + +// Test that GetID returns the correct ID +func TestMessagePart_GetID(t *testing.T) { + if emp.GetID() != 32 { + t.Errorf("received and expected do not match."+ + "\n\tGot: %#v\n\tExpected: %#v", emp.GetID(), 32) + } +} + +// Test that GetPart returns the correct part number +func TestMessagePart_GetPart(t *testing.T) { + if emp.GetPart() != 6 { + t.Errorf("received and expected do not match."+ + "\n\tGot: %#v\n\tExpected: %#v", emp.GetPart(), 6) + } +} + +// Test that GetContents returns the message contests +func TestMessagePart_GetContents(t *testing.T) { + if bytes.Compare(emp.GetContents(), []byte{'t', 'e', 's', 't', 'i', 'n', 'g'}) != 0 { + t.Errorf("received and expected do not match."+ + "\n\tGot: %#v\n\tExpected: %#v", emp.GetContents(), 6) + } +} + +// Test that GetSizedContents returns the message contests +func TestMessagePart_GetSizedContents(t *testing.T) { + if bytes.Compare(emp.GetSizedContents(), []byte{'t', 'e', 's', 't', 'i', 'n', 'g'}) != 0 { + t.Errorf("received and expected do not match."+ + "\n\tGot: %#v\n\tExpected: %#v", emp.GetSizedContents(), 6) + } +} + +// Test that GetContentsLength returns the message length +func TestMessagePart_GetContentsLength(t *testing.T) { + if emp.GetContentsLength() != 7 { + t.Errorf("received and expected do not match."+ + "\n\tGot: %#v\n\tExpected: %#v", emp.GetContentsLength(), 7) + } +} diff --git a/network/message/parse/partition_test.go b/network/message/parse/partition_test.go new file mode 100644 index 0000000000000000000000000000000000000000..59963cfefc57ab70d8d76e07fd384d8aae293a40 --- /dev/null +++ b/network/message/parse/partition_test.go @@ -0,0 +1,106 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright © 2020 xx network SEZC // +// // +// Use of this source code is governed by a license that can be found in the // +// LICENSE file // +/////////////////////////////////////////////////////////////////////////////// + +package parse + +import ( + "gitlab.com/elixxir/client/interfaces/message" + "gitlab.com/elixxir/client/storage" + "gitlab.com/xx_network/primitives/id" + "testing" + "time" +) + +var ipsumTestStr = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sit amet euismod est. Donec dolor " + + "neque, efficitur et interdum eu, lacinia quis mi. Duis bibendum elit ac lacus finibus pharetra. Suspendisse " + + "blandit erat in odio faucibus consectetur. Suspendisse sed consequat purus. Curabitur fringilla mi sit amet odio " + + "interdum suscipit. Etiam vitae dui posuere, congue mi a, convallis odio. In commodo risus at lorem volutpat " + + "placerat. In cursus magna purus, suscipit dictum lorem aliquam non. Praesent efficitur." + +// Test that NewPartitioner outputs a correctly made Partitioner +func TestNewPartitioner(t *testing.T) { + storeSession := storage.InitTestingSession(t) + p := NewPartitioner(4096, storeSession) + + if p.baseMessageSize != 4096 { + t.Errorf("baseMessageSize content mismatch"+ + "\n\texpected: %v\n\treceived: %v", + 4096, p.baseMessageSize) + } + + if p.deltaFirstPart != 20 { + t.Errorf("deltaFirstPart content mismatch"+ + "\n\texpected: %v\n\treceived: %v", + 20, p.deltaFirstPart) + } + + if p.firstContentsSize != 4069 { + t.Errorf("firstContentsSize content mismatch"+ + "\n\texpected: %v\n\treceived: %v", + 4069, p.firstContentsSize) + } + + if p.maxSize != 1042675 { + t.Errorf("maxSize content mismatch"+ + "\n\texpected: %v\n\treceived: %v", + 1042675, p.maxSize) + } + + if p.partContentsSize != 4089 { + t.Errorf("partContentsSize content mismatch"+ + "\n\texpected: %v\n\treceived: %v", + 4089, p.partContentsSize) + } + + if p.session != storeSession { + t.Errorf("session content mismatch") + } +} + +// Test that no error is returned running Partition +func TestPartitioner_Partition(t *testing.T) { + storeSession := storage.InitTestingSession(t) + p := NewPartitioner(len(ipsumTestStr), storeSession) + + _, _, err := p.Partition(&id.DummyUser, message.Text, + time.Now(), []byte(ipsumTestStr)) + if err != nil { + t.Error(err) + } +} + +// Test that HandlePartition can handle a message part +func TestPartitioner_HandlePartition(t *testing.T) { + storeSession := storage.InitTestingSession(t) + p := NewPartitioner(len(ipsumTestStr), storeSession) + + m := newMessagePart(1107, 1, []byte(ipsumTestStr)) + + _, _ = p.HandlePartition( + &id.DummyUser, + message.None, + m.Bytes(), + []byte{'t', 'e', 's', 't', 'i', 'n', 'g', + 's', 't', 'r', 'i', 'n', 'g'}, + ) +} + +// Test that HandlePartition can handle a first message part +func TestPartitioner_HandleFirstPartition(t *testing.T) { + storeSession := storage.InitTestingSession(t) + p := NewPartitioner(len(ipsumTestStr), storeSession) + + m := newFirstMessagePart(message.Text, 1107, 1, time.Now(), []byte(ipsumTestStr)) + + _, _ = p.HandlePartition( + &id.DummyUser, + message.None, + m.Bytes(), + []byte{'t', 'e', 's', 't', 'i', 'n', 'g', + 's', 't', 'r', 'i', 'n', 'g'}, + ) +} diff --git a/network/rounds/check.go b/network/rounds/check.go index b84676f5bf91ce8cbc24211310225ddf8dd730d0..81568b75b8d43c167aeac408155cf1cd88ed7862 100644 --- a/network/rounds/check.go +++ b/network/rounds/check.go @@ -74,7 +74,11 @@ func (m *Manager) Checker(roundID id.Round, filters []*RemoteFilter, identity re // Go get the round from the round infos, if it exists ri, err := m.Instance.GetRound(roundID) - if err != nil { + if err != nil || m.params.ForceHistoricalRounds { + if m.params.ForceHistoricalRounds { + jww.WARN.Printf("Forcing use of historical rounds for round ID %d.", + roundID) + } jww.DEBUG.Printf("HistoricalRound <- %d", roundID) // If we didn't find it, send to Historical Rounds Retrieval m.historicalRounds <- historicalRoundRequest{ @@ -83,7 +87,7 @@ func (m *Manager) Checker(roundID id.Round, filters []*RemoteFilter, identity re } } else { jww.DEBUG.Printf("lookupRoundMessages <- %d", roundID) - // IF found, send to Message Retrieval Workers + // If found, send to Message Retrieval Workers m.lookupRoundMessages <- roundLookup{ roundInfo: ri, identity: identity, diff --git a/storage/auth/store.go b/storage/auth/store.go index 9da7cb1cd6798965173d20c6fb07d7e17df9b025..89aff5457a94b9ea2b9e79dcd772b3a1a11ead32 100644 --- a/storage/auth/store.go +++ b/storage/auth/store.go @@ -326,7 +326,7 @@ func (s *Store) GetReceivedRequestData(partner *id.ID) (contact.Contact, error) r, ok := s.requests[*partner] s.mux.RUnlock() - if !ok { + if !ok || r.receive == nil { return contact.Contact{}, errors.Errorf("Received request not "+ "found: %s", partner) } diff --git a/storage/e2e/manager.go b/storage/e2e/manager.go index 5ca2dd58ef76b97aa98ee2afc8806eb0fc2f93dd..8faa45a08c635cfe357843be69ceca34f8af8eb2 100644 --- a/storage/e2e/manager.go +++ b/storage/e2e/manager.go @@ -38,7 +38,8 @@ type Manager struct { // newManager creates the relationship and its first Send and Receive sessions. func newManager(ctx *context, kv *versioned.KV, partnerID *id.ID, myPrivKey, - partnerPubKey *cyclic.Int, sendParams, receiveParams SessionParams) *Manager { + partnerPubKey *cyclic.Int, + sendParams, receiveParams params.E2ESessionParams) *Manager { kv = kv.Prefix(fmt.Sprintf(managerPrefix, partnerID)) @@ -112,7 +113,7 @@ func loadManager(ctx *context, kv *versioned.KV, partnerID *id.ID) (*Manager, er // session already exists, then it will not be overwritten and the extant // session will be returned with the bool set to true denoting a duplicate. This // allows for support of duplicate key exchange triggering. -func (m *Manager) NewReceiveSession(partnerPubKey *cyclic.Int, params SessionParams, +func (m *Manager) NewReceiveSession(partnerPubKey *cyclic.Int, e2eParams params.E2ESessionParams, source *Session) (*Session, bool) { // Check if the session already exists @@ -125,7 +126,7 @@ func (m *Manager) NewReceiveSession(partnerPubKey *cyclic.Int, params SessionPar // Add the session to the buffer session := m.receive.AddSession(source.myPrivKey, partnerPubKey, baseKey, - source.GetID(), params) + source.GetID(), e2eParams) return session, false } @@ -133,13 +134,13 @@ func (m *Manager) NewReceiveSession(partnerPubKey *cyclic.Int, params SessionPar // NewSendSession creates a new Receive session using the latest public key // received from the partner and a new private key for the user. Passing in a // private key is optional. A private key will be generated if none is passed. -func (m *Manager) NewSendSession(myPrivKey *cyclic.Int, params SessionParams) *Session { +func (m *Manager) NewSendSession(myPrivKey *cyclic.Int, e2eParams params.E2ESessionParams) *Session { // Find the latest public key from the other party sourceSession := m.receive.getNewestRekeyableSession() // Add the session to the Send session buffer and return return m.send.AddSession(myPrivKey, sourceSession.partnerPubKey, nil, - sourceSession.GetID(), params) + sourceSession.GetID(), e2eParams) } // GetKeyForSending gets the correct session to Send with depending on the type diff --git a/storage/e2e/manager_test.go b/storage/e2e/manager_test.go index ad58f483bf0cc3efb326a783438a2a14959d184e..58b0ca6bb6c5b846abc994b8c5f43e90819be664 100644 --- a/storage/e2e/manager_test.go +++ b/storage/e2e/manager_test.go @@ -33,12 +33,15 @@ func Test_newManager(t *testing.T) { originPartnerPubKey: s.partnerPubKey, originMyPrivKey: s.myPrivKey, } - expectedM.send = NewRelationship(expectedM, Send, GetDefaultSessionParams()) - expectedM.receive = NewRelationship(expectedM, Receive, GetDefaultSessionParams()) + expectedM.send = NewRelationship(expectedM, Send, + params.GetDefaultE2ESessionParams()) + expectedM.receive = NewRelationship(expectedM, Receive, + params.GetDefaultE2ESessionParams()) // Create new relationship - m := newManager(ctx, kv, partnerID, s.myPrivKey, s.partnerPubKey, s.params, - s.params) + m := newManager(ctx, kv, partnerID, s.myPrivKey, s.partnerPubKey, + s.e2eParams, + s.e2eParams) // Check if the new relationship matches the expected if !managersEqual(expectedM, m, t) { @@ -71,7 +74,7 @@ func TestManager_NewReceiveSession(t *testing.T) { m, _ := newTestManager(t) s, _ := makeTestSession() - se, exists := m.NewReceiveSession(s.partnerPubKey, s.params, s) + se, exists := m.NewReceiveSession(s.partnerPubKey, s.e2eParams, s) if exists { t.Errorf("NewReceiveSession() did not return the correct value."+ "\n\texpected: %v\n\treceived: %v", false, exists) @@ -83,7 +86,7 @@ func TestManager_NewReceiveSession(t *testing.T) { m.partner, se.GetPartner(), s.GetID(), se.GetID()) } - se, exists = m.NewReceiveSession(s.partnerPubKey, s.params, s) + se, exists = m.NewReceiveSession(s.partnerPubKey, s.e2eParams, s) if !exists { t.Errorf("NewReceiveSession() did not return the correct value."+ "\n\texpected: %v\n\treceived: %v", true, exists) @@ -102,14 +105,14 @@ func TestManager_NewSendSession(t *testing.T) { m, _ := newTestManager(t) s, _ := makeTestSession() - se := m.NewSendSession(s.myPrivKey, s.params) + se := m.NewSendSession(s.myPrivKey, s.e2eParams) if !m.partner.Cmp(se.GetPartner()) { t.Errorf("NewSendSession() did not return the correct session."+ "\n\texpected partner: %v\n\treceived partner: %v", m.partner, se.GetPartner()) } - se = m.NewSendSession(s.partnerPubKey, s.params) + se = m.NewSendSession(s.partnerPubKey, s.e2eParams) if !m.partner.Cmp(se.GetPartner()) { t.Errorf("NewSendSession() did not return the correct session."+ "\n\texpected partner: %v\n\treceived partner: %v", @@ -238,8 +241,9 @@ func newTestManager(t *testing.T) (*Manager, *versioned.KV) { prng.Uint64(), prng.Uint64()}, id.User, t) // Create new relationship - m := newManager(ctx, kv, partnerID, s.myPrivKey, s.partnerPubKey, s.params, - s.params) + m := newManager(ctx, kv, partnerID, s.myPrivKey, s.partnerPubKey, + s.e2eParams, + s.e2eParams) return m, kv } diff --git a/storage/e2e/params.go b/storage/e2e/params.go deleted file mode 100644 index f06484a3d8ccc2fd4a207f1abd10a6042f417283..0000000000000000000000000000000000000000 --- a/storage/e2e/params.go +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright © 2020 xx network SEZC // -// // -// Use of this source code is governed by a license that can be found in the // -// LICENSE file // -/////////////////////////////////////////////////////////////////////////////// - -package e2e - -import "gitlab.com/elixxir/crypto/e2e" - -// DEFAULT KEY GENERATION PARAMETERS -// Hardcoded limits for keys -// With 16 receiving states we can hold -// 16*64=1024 dirty bits for receiving keys -// With that limit, and setting maxKeys to 800, -// we need a Threshold of 224, and a scalar -// smaller than 1.28 to ensure we never generate -// more than 1024 keys -// With 1 receiving states for ReKeys we can hold -// 64 Rekeys -const ( - minKeys uint16 = 500 - maxKeys uint16 = 800 - ttlScalar float64 = 1.2 // generate 20% extra keys - threshold uint16 = 224 - numReKeys uint16 = 64 -) - -type SessionParams struct { - MinKeys uint16 - MaxKeys uint16 - NumRekeys uint16 - e2e.TTLParams -} - -func GetDefaultSessionParams() SessionParams { - return SessionParams{ - MinKeys: minKeys, - MaxKeys: maxKeys, - NumRekeys: numReKeys, - TTLParams: e2e.TTLParams{ - TTLScalar: ttlScalar, - MinNumKeys: threshold, - }, - } -} diff --git a/storage/e2e/params_test.go b/storage/e2e/params_test.go deleted file mode 100644 index bf92604d3d42368910a53d25f732f8041a1e25d5..0000000000000000000000000000000000000000 --- a/storage/e2e/params_test.go +++ /dev/null @@ -1,32 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright © 2020 xx network SEZC // -// // -// Use of this source code is governed by a license that can be found in the // -// LICENSE file // -/////////////////////////////////////////////////////////////////////////////// - -package e2e - -// Testing file for the params.go functions - -import "testing" - -// Test that the GetDefaultParams function returns the right default data -func Test_GetDefaultParams(t *testing.T) { - p := GetDefaultSessionParams() - if p.MinKeys != minKeys { - t.Errorf("MinKeys mismatch\r\tGot: %d\r\tExpected: %d", p.MinKeys, minKeys) - } - if p.MaxKeys != maxKeys { - t.Errorf("MinKeys mismatch\r\tGot: %d\r\tExpected: %d", p.MaxKeys, maxKeys) - } - if p.NumRekeys != numReKeys { - t.Errorf("MinKeys mismatch\r\tGot: %d\r\tExpected: %d", p.NumRekeys, numReKeys) - } - if p.TTLScalar != ttlScalar { - t.Errorf("MinKeys mismatch\r\tGot: %v\r\tExpected: %v", p.TTLScalar, ttlScalar) - } - if p.MinNumKeys != threshold { - t.Errorf("MinKeys mismatch\r\tGot: %d\r\tExpected: %d", p.MinNumKeys, threshold) - } -} diff --git a/storage/e2e/relationship.go b/storage/e2e/relationship.go index 77effe1661faacafae281fb4b011d1fe8e2367d6..167abcdaff6044361a1bd5ef0b9039074f7fe47e 100644 --- a/storage/e2e/relationship.go +++ b/storage/e2e/relationship.go @@ -11,6 +11,7 @@ import ( "encoding/json" "github.com/pkg/errors" jww "github.com/spf13/jwalterweatherman" + "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/crypto/cyclic" "sync" @@ -39,7 +40,7 @@ type relationship struct { } func NewRelationship(manager *Manager, t RelationshipType, - initialParams SessionParams) *relationship { + initialParams params.E2ESessionParams) *relationship { kv := manager.kv.Prefix(t.prefix()) @@ -167,12 +168,12 @@ func (r *relationship) unmarshal(b []byte) error { } func (r *relationship) AddSession(myPrivKey, partnerPubKey, baseKey *cyclic.Int, - trigger SessionID, params SessionParams) *Session { + trigger SessionID, e2eParams params.E2ESessionParams) *Session { r.mux.Lock() defer r.mux.Unlock() s := newSession(r, r.t, myPrivKey, partnerPubKey, baseKey, trigger, - r.fingerprint, params) + r.fingerprint, e2eParams) r.addSession(s) if err := r.save(); err != nil { diff --git a/storage/e2e/relationship_test.go b/storage/e2e/relationship_test.go index 5c5f262079ecadf7a53b374b9e8b930470229667..fe8b67d0d91063f1fd89751cd499c93469297887 100644 --- a/storage/e2e/relationship_test.go +++ b/storage/e2e/relationship_test.go @@ -9,6 +9,7 @@ package e2e import ( "bytes" + "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/ekv" "gitlab.com/xx_network/primitives/id" @@ -19,7 +20,7 @@ import ( // Subtest: unmarshal/marshal with one session in the buff func TestRelationship_MarshalUnmarshal(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) // Serialization should include session slice only serialized, err := sb.marshal() @@ -49,7 +50,7 @@ func TestRelationship_MarshalUnmarshal(t *testing.T) { // Shows that Relationship returns an equivalent session buff to the one that was saved func TestLoadRelationship(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) err := sb.save() if err != nil { @@ -69,7 +70,7 @@ func TestLoadRelationship(t *testing.T) { // Shows that Relationship returns a valid session buff func TestNewRelationshipBuff(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) if mgr != sb.manager { t.Error("managers should be identical") } @@ -86,7 +87,7 @@ func TestNewRelationshipBuff(t *testing.T) { // Shows that AddSession adds one session to the relationship func TestRelationship_AddSession(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) if len(sb.sessions) != 1 { t.Error("starting session slice length should be 1") } @@ -99,7 +100,7 @@ func TestRelationship_AddSession(t *testing.T) { // should have been created using the same relationship (which is not the case in // this test.) sb.AddSession(session.myPrivKey, session.partnerPubKey, nil, - session.partnerSource, session.params) + session.partnerSource, session.e2eParams) if len(sb.sessions) != 2 { t.Error("ending session slice length should be 2") } @@ -114,7 +115,7 @@ func TestRelationship_AddSession(t *testing.T) { // GetNewest should get the session that was most recently added to the buff func TestRelationship_GetNewest(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) // The newest session should be nil upon session buffer creation nilSession := sb.GetNewest() if nilSession == nil { @@ -124,14 +125,14 @@ func TestRelationship_GetNewest(t *testing.T) { session, _ := makeTestSession() sb.AddSession(session.myPrivKey, session.partnerPubKey, nil, - session.partnerSource, session.params) + session.partnerSource, session.e2eParams) if session.GetID() != sb.GetNewest().GetID() { t.Error("session added should have same ID") } session2, _ := makeTestSession() sb.AddSession(session2.myPrivKey, session2.partnerPubKey, nil, - session2.partnerSource, session2.params) + session2.partnerSource, session.e2eParams) if session2.GetID() != sb.GetNewest().GetID() { t.Error("session added should have same ID") } @@ -141,11 +142,11 @@ func TestRelationship_GetNewest(t *testing.T) { // Shows that Confirm confirms the specified session in the buff func TestRelationship_Confirm(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) session, _ := makeTestSession() sb.AddSession(session.myPrivKey, session.partnerPubKey, nil, - session.partnerSource, session.params) + session.partnerSource, session.e2eParams) sb.sessions[1].negotiationStatus = Sent if sb.sessions[1].IsConfirmed() { @@ -165,7 +166,7 @@ func TestRelationship_Confirm(t *testing.T) { // Shows that the session buff returns an error when the session doesn't exist func TestRelationship_Confirm_Err(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) session, _ := makeTestSession() err := sb.Confirm(session.GetID()) @@ -177,10 +178,10 @@ func TestRelationship_Confirm_Err(t *testing.T) { // Shows that a session can get got by ID from the buff func TestRelationship_GetByID(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) session, _ := makeTestSession() session = sb.AddSession(session.myPrivKey, session.partnerPubKey, nil, - session.partnerSource, session.params) + session.partnerSource, session.e2eParams) session2 := sb.GetByID(session.GetID()) if !reflect.DeepEqual(session, session2) { t.Error("gotten session should be the same") @@ -191,7 +192,7 @@ func TestRelationship_GetByID(t *testing.T) { // returning sessions that are confirmed and past ttl func TestRelationship_GetNewestRekeyableSession(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) sb.sessions[0].negotiationStatus = Unconfirmed // no available rekeyable sessions: nil session2 := sb.getNewestRekeyableSession() @@ -202,7 +203,7 @@ func TestRelationship_GetNewestRekeyableSession(t *testing.T) { // add a rekeyable session: that session session, _ := makeTestSession() sb.AddSession(session.myPrivKey, session.partnerPubKey, session.baseKey, - session.partnerSource, session.params) + session.partnerSource, session.e2eParams) sb.sessions[0].negotiationStatus = Confirmed session3 := sb.getNewestRekeyableSession() @@ -217,7 +218,7 @@ func TestRelationship_GetNewestRekeyableSession(t *testing.T) { additionalSession, _ := makeTestSession() sb.AddSession(additionalSession.myPrivKey, additionalSession.partnerPubKey, additionalSession.partnerPubKey, additionalSession.partnerSource, - additionalSession.params) + additionalSession.e2eParams) sb.sessions[0].negotiationStatus = Confirmed @@ -243,7 +244,7 @@ func TestRelationship_GetNewestRekeyableSession(t *testing.T) { // Shows that GetSessionForSending follows the hierarchy of sessions correctly func TestRelationship_GetSessionForSending(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) sb.sessions = make([]*Session, 0) sb.sessionByID = make(map[SessionID]*Session) @@ -258,7 +259,7 @@ func TestRelationship_GetSessionForSending(t *testing.T) { sb.AddSession(unconfirmedRekey.myPrivKey, unconfirmedRekey.partnerPubKey, unconfirmedRekey.partnerPubKey, unconfirmedRekey.partnerSource, - unconfirmedRekey.params) + unconfirmedRekey.e2eParams) sb.sessions[0].negotiationStatus = Unconfirmed sb.sessions[0].keyState.numAvailable = 600 sending := sb.getSessionForSending() @@ -271,7 +272,7 @@ func TestRelationship_GetSessionForSending(t *testing.T) { sb.AddSession(unconfirmedActive.myPrivKey, unconfirmedActive.partnerPubKey, unconfirmedActive.partnerPubKey, unconfirmedActive.partnerSource, - unconfirmedActive.params) + unconfirmedActive.e2eParams) sb.sessions[0].negotiationStatus = Unconfirmed sb.sessions[0].keyState.numAvailable = 2000 sending = sb.getSessionForSending() @@ -284,7 +285,7 @@ func TestRelationship_GetSessionForSending(t *testing.T) { sb.AddSession(confirmedRekey.myPrivKey, confirmedRekey.partnerPubKey, confirmedRekey.partnerPubKey, confirmedRekey.partnerSource, - confirmedRekey.params) + confirmedRekey.e2eParams) sb.sessions[0].negotiationStatus = Confirmed sb.sessions[0].keyState.numAvailable = 600 sending = sb.getSessionForSending() @@ -296,7 +297,7 @@ func TestRelationship_GetSessionForSending(t *testing.T) { confirmedActive, _ := makeTestSession() sb.AddSession(confirmedActive.myPrivKey, confirmedActive.partnerPubKey, confirmedActive.partnerPubKey, confirmedActive.partnerSource, - confirmedActive.params) + confirmedActive.e2eParams) sb.sessions[0].negotiationStatus = Confirmed sb.sessions[0].keyState.numAvailable = 2000 @@ -309,7 +310,7 @@ func TestRelationship_GetSessionForSending(t *testing.T) { // Shows that GetKeyForRekey returns a key if there's an appropriate session for rekeying func TestSessionBuff_GetKeyForRekey(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) sb.sessions = make([]*Session, 0) sb.sessionByID = make(map[SessionID]*Session) @@ -326,7 +327,7 @@ func TestSessionBuff_GetKeyForRekey(t *testing.T) { session, _ := makeTestSession() sb.AddSession(session.myPrivKey, session.partnerPubKey, session.partnerPubKey, session.partnerSource, - session.params) + session.e2eParams) sb.sessions[0].negotiationStatus = Confirmed key, err = sb.getKeyForRekey() if err != nil { @@ -340,7 +341,7 @@ func TestSessionBuff_GetKeyForRekey(t *testing.T) { // Shows that GetKeyForSending returns a key if there's an appropriate session for sending func TestSessionBuff_GetKeyForSending(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) sb.sessions = make([]*Session, 0) sb.sessionByID = make(map[SessionID]*Session) @@ -357,7 +358,7 @@ func TestSessionBuff_GetKeyForSending(t *testing.T) { session, _ := makeTestSession() sb.AddSession(session.myPrivKey, session.partnerPubKey, session.partnerPubKey, session.partnerSource, - session.params) + session.e2eParams) key, err = sb.getKeyForSending() if err != nil { t.Error(err) @@ -370,14 +371,14 @@ func TestSessionBuff_GetKeyForSending(t *testing.T) { // Shows that TriggerNegotiation sets up for negotiation correctly func TestSessionBuff_TriggerNegotiation(t *testing.T) { mgr := makeTestRelationshipManager(t) - sb := NewRelationship(mgr, Send, GetDefaultSessionParams()) + sb := NewRelationship(mgr, Send, params.GetDefaultE2ESessionParams()) sb.sessions = make([]*Session, 0) sb.sessionByID = make(map[SessionID]*Session) session, _ := makeTestSession() session = sb.AddSession(session.myPrivKey, session.partnerPubKey, session.partnerPubKey, session.partnerSource, - session.params) + session.e2eParams) session.negotiationStatus = Confirmed // The added session isn't ready for rekey so it's not returned here negotiations := sb.TriggerNegotiation() @@ -388,7 +389,7 @@ func TestSessionBuff_TriggerNegotiation(t *testing.T) { // Make only a few keys available to trigger the ttl session2 = sb.AddSession(session2.myPrivKey, session2.partnerPubKey, session2.partnerPubKey, session2.partnerSource, - session2.params) + session2.e2eParams) session2.keyState.numAvailable = 4 session2.negotiationStatus = Confirmed negotiations = sb.TriggerNegotiation() @@ -410,7 +411,7 @@ func TestSessionBuff_TriggerNegotiation(t *testing.T) { session3 = sb.AddSession(session3.myPrivKey, session3.partnerPubKey, session3.partnerPubKey, session3.partnerSource, - session3.params) + session3.e2eParams) session3.negotiationStatus = Unconfirmed // Set session 2 status back to Confirmed to show that more than one session can be returned diff --git a/storage/e2e/session.go b/storage/e2e/session.go index 1fd729e013a093eb706ec7cc8de220255cb9167c..6feedbebb95a7ecf86d2bd3e2e0248c2b7b8947d 100644 --- a/storage/e2e/session.go +++ b/storage/e2e/session.go @@ -13,6 +13,7 @@ import ( "github.com/pkg/errors" jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/globals" + "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/crypto/cyclic" dh "gitlab.com/elixxir/crypto/diffieHellman" @@ -35,7 +36,7 @@ type Session struct { //prefixed kv kv *versioned.KV //params - params SessionParams + e2eParams params.E2ESessionParams //type t RelationshipType @@ -71,7 +72,7 @@ type Session struct { // must be exported // Utility struct to write part of session data to disk type SessionDisk struct { - Params SessionParams + E2EParams params.E2ESessionParams //session type Type uint8 @@ -98,7 +99,7 @@ type SessionDisk struct { //Generator which creates all keys and structures func newSession(ship *relationship, t RelationshipType, myPrivKey, partnerPubKey, baseKey *cyclic.Int, trigger SessionID, relationshipFingerprint []byte, - params SessionParams) *Session { + e2eParams params.E2ESessionParams) *Session { confirmation := Unconfirmed if t == Receive { @@ -106,7 +107,7 @@ func newSession(ship *relationship, t RelationshipType, myPrivKey, partnerPubKey } session := &Session{ - params: params, + e2eParams: e2eParams, relationship: ship, t: t, myPrivKey: myPrivKey, @@ -272,7 +273,7 @@ func (s *Session) GetPartner() *id.ID { func (s *Session) marshal() ([]byte, error) { sd := SessionDisk{} - sd.Params = s.params + sd.E2EParams = s.e2eParams sd.Type = uint8(s.t) sd.BaseKey = s.baseKey.Bytes() sd.MyPrivKey = s.myPrivKey.Bytes() @@ -307,7 +308,7 @@ func (s *Session) unmarshal(b []byte) error { grp := s.relationship.manager.ctx.grp - s.params = sd.Params + s.e2eParams = sd.E2EParams s.t = RelationshipType(sd.Type) s.baseKey = grp.NewIntFromBytes(sd.BaseKey) s.myPrivKey = grp.NewIntFromBytes(sd.MyPrivKey) @@ -329,7 +330,7 @@ func (s *Session) unmarshal(b []byte) error { // Pops the first unused key, skipping any which are denoted as used. // will return if the remaining keys are designated as rekeys func (s *Session) PopKey() (*Key, error) { - if s.keyState.GetNumAvailable() <= uint32(s.params.NumRekeys) { + if s.keyState.GetNumAvailable() <= uint32(s.e2eParams.NumRekeys) { return nil, errors.New("no more keys left, remaining reserved " + "for rekey") } @@ -363,7 +364,7 @@ func (s *Session) Status() Status { if numAvailable == 0 { return RekeyEmpty - } else if numAvailable <= uint32(s.params.NumRekeys) { + } else if numAvailable <= uint32(s.e2eParams.NumRekeys) { return Empty // do not need to make a copy of getNumKeys becasue it is static and // only used once @@ -547,11 +548,19 @@ func (s *Session) generate(kv *versioned.KV) *versioned.KV { kv = kv.Prefix(makeSessionPrefix(s.GetID())) - //generate ttl and keying info + p := s.e2eParams h, _ := hash.NewCMixHash() - numKeys := uint32(randomness.RandInInterval(big.NewInt(int64(s.params.MaxKeys-s.params.MinKeys)), - s.baseKey.Bytes(), h).Int64() + int64(s.params.MinKeys)) + //generate ttl and keying info + numKeys := uint32(randomness.RandInInterval(big.NewInt( + int64(p.MaxKeys-p.MinKeys)), + s.baseKey.Bytes(), h).Int64() + int64(p.MinKeys)) + keysTTL := uint32(p.NumRekeys) + + //ensure that enough keys are remaining to rekey + if numKeys-keysTTL < uint32(p.NumRekeys) { + numKeys = keysTTL + uint32(p.NumRekeys) + } s.ttl = uint32(s.params.NumRekeys) diff --git a/storage/e2e/session_test.go b/storage/e2e/session_test.go index ec3c51bc9e3d261cdb881f5e05e079e936b36268..91a2d53e67bf4308104c8c7c2d044b18c26fe1ac 100644 --- a/storage/e2e/session_test.go +++ b/storage/e2e/session_test.go @@ -9,6 +9,7 @@ package e2e import ( "errors" + "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/versioned" dh "gitlab.com/elixxir/crypto/diffieHellman" "gitlab.com/elixxir/crypto/fastRNG" @@ -38,7 +39,7 @@ func TestSession_generate_noPrivateKeyReceive(t *testing.T) { //build the session s := &Session{ partnerPubKey: partnerPubKey, - params: GetDefaultSessionParams(), + e2eParams: params.GetDefaultE2ESessionParams(), relationship: &relationship{ manager: &Manager{ctx: ctx}, }, @@ -99,7 +100,7 @@ func TestSession_generate_PrivateKeySend(t *testing.T) { s := &Session{ myPrivKey: myPrivKey, partnerPubKey: partnerPubKey, - params: GetDefaultSessionParams(), + e2eParams: params.GetDefaultE2ESessionParams(), relationship: &relationship{ manager: &Manager{ctx: ctx}, }, @@ -147,7 +148,7 @@ func TestNewSession(t *testing.T) { // Make a new session with the variables we got from makeTestSession sessionB := newSession(sessionA.relationship, sessionA.t, sessionA.myPrivKey, sessionA.partnerPubKey, sessionA.baseKey, sessionA.GetID(), []byte(""), - sessionA.params) + sessionA.e2eParams) err := cmpSerializedFields(sessionA, sessionB) if err != nil { @@ -252,19 +253,19 @@ func cmpSerializedFields(a *Session, b *Session) error { if a.t != b.t { return errors.New("t differed") } - if a.params.MaxKeys != b.params.MaxKeys { + if a.e2eParams.MaxKeys != b.e2eParams.MaxKeys { return errors.New("maxKeys differed") } - if a.params.MinKeys != b.params.MinKeys { + if a.e2eParams.MinKeys != b.e2eParams.MinKeys { return errors.New("minKeys differed") } - if a.params.NumRekeys != b.params.NumRekeys { + if a.e2eParams.NumRekeys != b.e2eParams.NumRekeys { return errors.New("numRekeys differed") } - if a.params.MinNumKeys != b.params.MinNumKeys { + if a.e2eParams.MinNumKeys != b.e2eParams.MinNumKeys { return errors.New("minNumKeys differed") } - if a.params.TTLScalar != b.params.TTLScalar { + if a.e2eParams.TTLScalar != b.e2eParams.TTLScalar { return errors.New("ttlScalar differed") } if a.baseKey.Cmp(b.baseKey) != 0 { @@ -621,7 +622,7 @@ func makeTestSession() (*Session, *context) { baseKey: baseKey, myPrivKey: myPrivKey, partnerPubKey: partnerPubKey, - params: GetDefaultSessionParams(), + e2eParams: params.GetDefaultE2ESessionParams(), relationship: &relationship{ manager: &Manager{ ctx: ctx, diff --git a/storage/e2e/store.go b/storage/e2e/store.go index 03d0abac178c99410462d84e920cf3c7564b2a06..cff582cc6fe0c0638c410fe5c4e189ef78ec020a 100644 --- a/storage/e2e/store.go +++ b/storage/e2e/store.go @@ -11,6 +11,7 @@ import ( "encoding/json" "github.com/pkg/errors" jww "github.com/spf13/jwalterweatherman" + "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/utility" "gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/crypto/cyclic" @@ -46,6 +47,8 @@ type Store struct { *fingerprints *context + + e2eParams params.E2ESessionParams } func NewStore(grp *cyclic.Group, kv *versioned.KV, privKey *cyclic.Int, @@ -76,6 +79,8 @@ func NewStore(grp *cyclic.Group, kv *versioned.KV, privKey *cyclic.Int, rng: rng, myID: myID, }, + + e2eParams: params.GetDefaultE2ESessionParams(), } err := utility.StoreCyclicKey(kv, pubKey, pubKeyKey) @@ -119,6 +124,8 @@ func LoadStore(kv *versioned.KV, myID *id.ID, rng *fastRNG.StreamGenerator) (*St myID: myID, grp: grp, }, + + e2eParams: params.GetDefaultE2ESessionParams(), } obj, err := kv.Get(storeKey) @@ -154,7 +161,7 @@ func (s *Store) save() error { } func (s *Store) AddPartner(partnerID *id.ID, partnerPubKey, myPrivKey *cyclic.Int, - sendParams, receiveParams SessionParams) error { + sendParams, receiveParams params.E2ESessionParams) error { s.mux.Lock() defer s.mux.Unlock() @@ -267,6 +274,22 @@ func (s *Store) unmarshal(b []byte) error { return nil } +// GetE2ESessionParams returns a copy of the session params object +func (s *Store) GetE2ESessionParams() params.E2ESessionParams { + s.mux.RLock() + defer s.mux.RUnlock() + jww.DEBUG.Printf("Using Session Params: %s", s.e2eParams) + return s.e2eParams +} + +// SetE2ESessionParams overwrites the current session params +func (s *Store) SetE2ESessionParams(newParams params.E2ESessionParams) { + s.mux.Lock() + defer s.mux.Unlock() + jww.DEBUG.Printf("Setting Session Params: %s", newParams) + s.e2eParams = newParams +} + type fingerprints struct { toKey map[format.Fingerprint]*Key mux sync.RWMutex diff --git a/storage/e2e/store_test.go b/storage/e2e/store_test.go index fccb11fe3a0d5bb2c8f94597d7e4a25e43532b2c..0d7f760b934ab47024e88e231dd3726658527801 100644 --- a/storage/e2e/store_test.go +++ b/storage/e2e/store_test.go @@ -9,6 +9,7 @@ package e2e import ( "bytes" + "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/diffieHellman" @@ -30,6 +31,7 @@ func TestNewStore(t *testing.T) { kv := versioned.NewKV(make(ekv.Memstore)) fingerprints := newFingerprints() rng := fastRNG.NewStreamGenerator(12, 3, csprng.NewSystemRNG) + e2eP := params.GetDefaultE2ESessionParams() expectedStore := &Store{ managers: make(map[id.ID]*Manager), dhPrivateKey: privKey, @@ -43,6 +45,7 @@ func TestNewStore(t *testing.T) { rng: rng, myID: &id.ID{}, }, + e2eParams: e2eP, } expectedData, err := expectedStore.marshal() if err != nil { @@ -90,7 +93,7 @@ func TestStore_AddPartner(t *testing.T) { s, _, _ := makeTestStore() partnerID := id.NewIdFromUInt(rand.Uint64(), id.User, t) pubKey := diffieHellman.GeneratePublicKey(s.dhPrivateKey, s.grp) - p := GetDefaultSessionParams() + p := params.GetDefaultE2ESessionParams() expectedManager := newManager(s.context, s.kv, partnerID, s.dhPrivateKey, pubKey, p, p) @@ -112,7 +115,7 @@ func TestStore_GetPartner(t *testing.T) { s, _, _ := makeTestStore() partnerID := id.NewIdFromUInt(rand.Uint64(), id.User, t) pubKey := diffieHellman.GeneratePublicKey(s.dhPrivateKey, s.grp) - p := GetDefaultSessionParams() + p := params.GetDefaultE2ESessionParams() expectedManager := newManager(s.context, s.kv, partnerID, s.dhPrivateKey, pubKey, p, p) s.AddPartner(partnerID, pubKey, s.dhPrivateKey, p, p) diff --git a/storage/utility/e2eMessageBuffer.go b/storage/utility/e2eMessageBuffer.go index 28537e09883c5b1873e4e5131e0b25974d9b88c2..045175c8fd752ef790f4ded0c98d26f1107fdf2b 100644 --- a/storage/utility/e2eMessageBuffer.go +++ b/storage/utility/e2eMessageBuffer.go @@ -16,6 +16,7 @@ import ( "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/storage/versioned" "gitlab.com/xx_network/primitives/id" + "time" ) diff --git a/ud/lookup_test.go b/ud/lookup_test.go index 6bd9b7357855ef99f55d0fcdced916cfcba0d787..b8545de0c39d7eec23d47f132a13a52a795ba83c 100644 --- a/ud/lookup_test.go +++ b/ud/lookup_test.go @@ -38,7 +38,7 @@ func TestManager_Lookup(t *testing.T) { udID: &id.UDB, inProgressLookup: map[uint64]chan *LookupResponse{}, net: newTestNetworkManager(t), - registered: &isReg, + registered: &isReg, } // Generate callback function @@ -126,7 +126,7 @@ func TestManager_Lookup_CallbackError(t *testing.T) { udID: &id.UDB, inProgressLookup: map[uint64]chan *LookupResponse{}, net: newTestNetworkManager(t), - registered: &isReg, + registered: &isReg, } // Generate callback function @@ -189,7 +189,7 @@ func TestManager_Lookup_EventChanTimeout(t *testing.T) { udID: &id.UDB, inProgressLookup: map[uint64]chan *LookupResponse{}, net: newTestNetworkManager(t), - registered: &isReg, + registered: &isReg, } // Generate callback function @@ -242,7 +242,7 @@ func TestManager_lookupProcess(t *testing.T) { udID: &id.UDB, inProgressLookup: map[uint64]chan *LookupResponse{}, net: newTestNetworkManager(t), - registered: &isReg, + registered: &isReg, } c := make(chan message.Receive) @@ -298,7 +298,7 @@ func TestManager_lookupProcess_NoLookupResponse(t *testing.T) { udID: &id.UDB, inProgressLookup: map[uint64]chan *LookupResponse{}, net: newTestNetworkManager(t), - registered: &isReg, + registered: &isReg, } c := make(chan message.Receive)