diff --git a/api/errcode.proto b/api/errcode.proto index b0d379efe0..7bf67909c1 100644 --- a/api/errcode.proto +++ b/api/errcode.proto @@ -45,6 +45,11 @@ enum ErrCode { ErrHandshakeSessionInvalid = 2013; ErrHandshakeKeyNotInSigChain = 2014; ErrHandshakeDecrypt = 2015; + ErrGroupMemberLogEventOpen = 2020; + ErrGroupMemberLogEventSignature = 2021; + ErrGroupMemberLogWrongInviter = 2022; + ErrGroupMemberUnknownGroupID = 2023; + ErrGroupMemberMissingSecrets = 2024; // // Chat Bridge (starting at 3001) @@ -52,4 +57,4 @@ enum ErrCode { ErrBridgeInterrupted = 3001; ErrBridgeNotRunning = 3002; -} \ No newline at end of file +} diff --git a/api/go-internal/log_entry_member.proto b/api/go-internal/log_entry_member.proto deleted file mode 100644 index 093fe126b7..0000000000 --- a/api/go-internal/log_entry_member.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -option go_package = "berty.tech/go/internal/group"; - -message MemberEntryEnvelope { - bytes encrypted_member_payload = 1; - bytes member_payload_signature = 2; // Signed by member_device_priv_key -} - -message MemberEntryPayload { - bytes member_pub_key = 1; - bytes member_pub_key_signature = 2; // Signed by invitation_priv_key - bytes member_device_pub_key = 3; - bytes member_device_pub_key_signature = 4; // Signed by member_priv_key - - bytes inviter_member_pub_key = 5; - bytes invitation_pub_key = 6; - bytes invitation_pub_key_signature = 7; // Signed by inviter_member_priv_key -} diff --git a/api/go-internal/log_entry_message.proto b/api/go-internal/log_entry_message.proto deleted file mode 100644 index 285bf50443..0000000000 --- a/api/go-internal/log_entry_message.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -option go_package = "berty.tech/go/internal/group"; - -message MessageEntryEnvelope { - uint64 counter = 1; - bytes encrypted_payload = 2; - bytes signature = 3; // Signed with member_device_pub_key of author -} - -message MessageEntryPayload { - enum PayloadType { - PayloadTypeUnknown = 0; - PayloadTypeMessage = 1; - PayloadTypeInvitation = 2; - } - - PayloadType type = 1; - bytes message_body = 2; - Invitation invitation = 3; -} - -message Invitation { - bytes inviter_member_pub_key = 1; - bytes invitation_priv_key = 2; - bytes invitation_pub_key_signature = 3; // Signed by inviter_member_priv_key - - uint32 group_version = 4; - bytes group_id_pub_key = 5; - bytes shared_secret = 6; -} diff --git a/api/go-internal/log_entry_secret.proto b/api/go-internal/log_entry_secret.proto deleted file mode 100644 index 352a484b72..0000000000 --- a/api/go-internal/log_entry_secret.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -option go_package = "berty.tech/go/internal/group"; - -message SecretEntryEnvelope { - bytes encrypted_secret_payload = 1; - bytes secret_payload_signature = 2; -} - -message SecretEntryPayload { - bytes dest_member_pub_key = 1; - bytes sender_device_pub_key = 2; - bytes encrypted_device_secret = 3; -} - -message DeviceSecret { - bytes derivation_state = 1; - uint64 counter = 2; -} diff --git a/api/go-internal/log_entry_setting.proto b/api/go-internal/log_entry_setting.proto deleted file mode 100644 index 3e8639ada2..0000000000 --- a/api/go-internal/log_entry_setting.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; - -option go_package = "berty.tech/go/internal/group"; - -message SettingsEntryEnvelope { - bytes encrypted_settings_payload = 1; - bytes settings_payload_signature = 2; -} - -message SettingsEntryPayload { - enum PayloadType { - PayloadTypeUnknown = 0; - PayloadTypeGroupSetting = 1; - PayloadTypeMemberSetting = 2; - } - - PayloadType type = 1; - bytes member_pub_key = 2; - bytes key = 3; - bytes value = 4; -} diff --git a/api/go-internal/protocolmodel.proto b/api/go-internal/protocolmodel.proto index a17bf9ba24..a15c04e908 100644 --- a/api/go-internal/protocolmodel.proto +++ b/api/go-internal/protocolmodel.proto @@ -24,7 +24,7 @@ message GroupInfo { // group clashes with reserved SQL keyword // - Group details/meta bytes group_pub_key = 1 [(gogoproto.moretags) = "gorm:\"primary_key\""]; - bytes shared_secret = 2; + bytes group_signing_key = 2; bytes metadata = 3; GroupAudience audience = 4 [(gogoproto.moretags) = "gorm:\"index\""]; uint32 version = 5; @@ -61,7 +61,7 @@ message GroupIncomingRequest { bytes inviter_member_pub_key = 2; bytes invitation_sig = 3; bytes invitation_priv_key = 4; - bytes group_shared_secret = 5; + bytes group_signing_key = 5; bytes group_version = 6; bytes essential_metadata = 7; bytes inviter_contact_pub_key = 9; diff --git a/api/go-internal/store_entry.proto b/api/go-internal/store_entry.proto new file mode 100644 index 0000000000..f9ec7c8069 --- /dev/null +++ b/api/go-internal/store_entry.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +package berty.group; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option go_package = "berty.tech/go/internal/group"; +option (gogoproto.marshaler_all) = true; +option (gogoproto.unmarshaler_all) = true; +option (gogoproto.sizer_all) = true; + +message StoreEncryptedEntry { + bytes encrypted_payload = 1; + bytes signature = 2; +} + +message MemberEntryPayload { + bytes member_pub_key = 1; + bytes member_pub_key_signature = 2; // Signed by invitation_priv_key + bytes member_device_pub_key = 3; + bytes member_device_pub_key_signature = 4; // Signed by member_priv_key + + bytes inviter_device_pub_key = 5; + bytes invitation_pub_key = 6; + bytes invitation_pub_key_signature = 7; // Signed by inviter_member_priv_key +} + +message MessageEntryEnvelope { + uint64 counter = 1; + bytes encrypted_payload = 2; + bytes signature = 3; // Signed with member_device_pub_key of author +} + +message MessageEntryPayload { + enum PayloadType { + PayloadTypeUnknown = 0; + PayloadTypeMessage = 1; + PayloadTypeInvitation = 2; + } + + PayloadType type = 1; + bytes message_body = 2; + Invitation invitation = 3; +} + +message Invitation { + bytes inviter_device_pub_key = 1; + bytes invitation_priv_key = 2; // This will contains only the private part of the invitation key, as the other part can be calculated (we dont expect much invitations being received) + bytes invitation_pub_key_signature = 3; // Signed by inviter_member_priv_key + + uint32 group_version = 4; + bytes group_pub_key = 5; + bytes group_signing_key = 6; // This will contains only the private part of the signing key, same logic as invitation_priv_key above +} + +message SecretEntryPayload { + bytes dest_member_pub_key = 1; + bytes sender_device_pub_key = 2; + bytes encrypted_device_secret = 3; +} + +message DeviceSecret { + bytes derivation_state = 1; + uint64 counter = 2; +} + +message SettingsEntryPayload { + enum PayloadType { + PayloadTypeUnknown = 0; + PayloadTypeGroupSetting = 1; + PayloadTypeMemberSetting = 2; + } + + PayloadType type = 1; + bytes member_pub_key = 2; + bytes key = 3; + bytes value = 4; +} diff --git a/go/gen.sum b/go/gen.sum index d7261fa630..4c36af0318 100644 --- a/go/gen.sum +++ b/go/gen.sum @@ -1,12 +1,9 @@ ccafc91aeba8f90890022b94dbac0ab2190c8620 ../api/bertychat.proto a68e876ac502b90847f468066f3b68b02a8bbed0 ../api/bertyprotocol.proto dca713b79d06f72d26177098a2af23b5d30d911e ../api/chatmodel.proto -6382cb3045cd2e12ffa65a326138570df867cbc3 ../api/errcode.proto +bcbc1bb4bccee78792846d0f83156abee0befc3f ../api/errcode.proto d915a30248e7105cb1290f5798382ccf0bdb935a ../api/go-internal/handshake.proto -d065506424cab800ecca466ceca2f07dd71893ce ../api/go-internal/log_entry_member.proto -47cca8cbef29c059d3b9a7295c86e51ab20d2994 ../api/go-internal/log_entry_message.proto -734c4c245c493f3f09df2f6c32d29e642fcbde83 ../api/go-internal/log_entry_secret.proto -c4d8ae1bb2b1e3119bed152e705f4e84129f48c6 ../api/go-internal/log_entry_setting.proto -6d2d3712bf8fdb7772f9b7e536b8ad8a75868637 ../api/go-internal/protocolmodel.proto +aaeea37d30e9d0eb583ddc3e436790f66d466a22 ../api/go-internal/protocolmodel.proto e90229dbdbf76864981801538947a192cb62b448 ../api/go-internal/sigchain.proto +b37618290dbb86e13549c95c2e0fafd144560ccc ../api/go-internal/store_entry.proto 0891d73bd6f2b145bc95603a6c851b70b86606ee Makefile diff --git a/go/go.mod b/go/go.mod index a58475d794..f6ca2b339d 100644 --- a/go/go.mod +++ b/go/go.mod @@ -3,8 +3,10 @@ module berty.tech/go go 1.12 require ( + berty.tech/go-ipfs-log v0.0.0-20191118100004-2fb04713cace + berty.tech/go-orbit-db v0.0.2-0.20191118172355-7d7e876ee5d4 github.com/brianvoe/gofakeit v3.18.0+incompatible - github.com/gogo/protobuf v1.3.0 + github.com/gogo/protobuf v1.3.1 github.com/golang/protobuf v1.3.2 github.com/improbable-eng/grpc-web v0.11.0 github.com/ipfs/go-datastore v0.1.1 @@ -13,23 +15,26 @@ require ( github.com/ipfs/interface-go-ipfs-core v0.0.8 github.com/jinzhu/gorm v1.9.11 github.com/libp2p/go-libp2p v0.0.28 - github.com/libp2p/go-libp2p-core v0.0.1 + github.com/libp2p/go-libp2p-core v0.0.6 github.com/libp2p/go-libp2p-crypto v0.1.0 github.com/libp2p/go-libp2p-peer v0.2.0 + github.com/libp2p/go-libp2p-peerstore v0.0.6 github.com/multiformats/go-multiaddr v0.0.4 github.com/multiformats/go-multiaddr-net v0.0.1 github.com/multiformats/go-multihash v0.0.8 github.com/oklog/run v1.0.0 github.com/peterbourgon/ff v1.6.0 github.com/pkg/errors v0.8.1 - github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect go.uber.org/multierr v1.2.0 // indirect go.uber.org/zap v1.10.0 - golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 + golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 + golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 // indirect google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c google.golang.org/grpc v1.24.0 gopkg.in/gormigrate.v1 v1.6.0 ) +replace github.com/dgraph-io/badger => github.com/dgraph-io/badger v0.0.0-20190809121831-9d7b751e85c9 + replace github.com/libp2p/go-openssl v0.0.2 => github.com/berty/go-openssl v0.0.3-0.20191007152928-66bd988d235e diff --git a/go/go.sum b/go/go.sum index 90418ab520..c5206e9117 100644 --- a/go/go.sum +++ b/go/go.sum @@ -1,5 +1,9 @@ bazil.org/fuse v0.0.0-20180421153158-65cc252bf669 h1:FNCRpXiquG1aoyqcIWVFmpTSKVcx2bQD38uZZeGtdlw= bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= +berty.tech/go-ipfs-log v0.0.0-20191118100004-2fb04713cace h1:Zb+bgM/mIRqO6Rcwzx93NMu2wGZs+zK5/YJ8PNA5wO0= +berty.tech/go-ipfs-log v0.0.0-20191118100004-2fb04713cace/go.mod h1:OoyGxhQjvUkb17Lock2aa0aLKuvpuYhSzRDw7ThkUtg= +berty.tech/go-orbit-db v0.0.2-0.20191118172355-7d7e876ee5d4 h1:8hK+0E9Xt3KDqJMmx0eJqhVfjr+mbvblpnwLPzYlhDM= +berty.tech/go-orbit-db v0.0.2-0.20191118172355-7d7e876ee5d4/go.mod h1:yU2a6Kvu7j+5lWZqpHOozfSRV3nIKWosTOHH3BqIyUg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.33.1/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -12,6 +16,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/Kubuxu/gocovmerge v0.0.0-20161216165753-7ecaa51963cd/go.mod h1:bqoB8kInrTeEtYAwaIXoSRqdwnjQmFhsfusnzyui6yY= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI= +github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/OpenPeeDeeP/depguard v0.0.0-20180806142446-a69c782687b2/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o= github.com/Quasilyte/go-consistent v0.0.0-20181230194409-8f8379e70f99/go.mod h1:ds1OLa3HF2x4OGKCx0pNTVL1s9Ii/2mT0Bg/8PtW6AM= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -20,9 +26,14 @@ github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrU github.com/Stebalien/go-bitfield v0.0.0-20180330043415-076a62f9ce6e/go.mod h1:3oM7gXIttpYDAJXpVNnSCiUMYBLIZ6cb1t+Ip982MRo= github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= +github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -36,20 +47,27 @@ github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7 github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190427004231-96897255fd17 h1:m0N5Vg5nP3zEz8TREZpwX3gt4Biw3/8fbIf4A3hO96g= github.com/btcsuite/btcd v0.0.0-20190427004231-96897255fd17/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c h1:aEbSeNALREWXk0G7UdNhR3ayBV7tZ4M2PNmnrCAph6Q= +github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coocood/freecache v1.1.0/go.mod h1:ePwxCDzOYvARfHdr1pByNct1at3CoKnsipOHwKlNbzI= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -68,9 +86,10 @@ github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQY github.com/denisenkom/go-mssqldb v0.0.0-20181014144952-4e0d7dc8888f/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc= github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3 h1:tkum0XDgfR0jcVVXuTsYv/erY2NnEDqwRojbxR1rBYA= github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= -github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= -github.com/dgraph-io/badger v1.6.0-rc1 h1:JphPpoBZJ3WHha133BGYlQqltSGIhV+VsEID0++nN9A= -github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/dgraph-io/badger v0.0.0-20190809121831-9d7b751e85c9 h1:d1VXA/fah5BGgbquHuUlmH9tBCacAYMnFoDKShUQh74= +github.com/dgraph-io/badger v0.0.0-20190809121831-9d7b751e85c9/go.mod h1:zmuWBVEXFtixdGaO4wf/9iZh3AntlbA4pPmfpUHad1I= +github.com/dgraph-io/ristretto v0.0.0-20190801024210-18ba08fdea80 h1:ZVYvevH/zd9ygtRNosrnlGdvI6CEuUPwZ3EV0lfdGuM= +github.com/dgraph-io/ristretto v0.0.0-20190801024210-18ba08fdea80/go.mod h1:UvZmzj8odp3S1nli6yEb1vLME8iJFBrRcw8rAJEiu9Q= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= @@ -111,18 +130,22 @@ github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur9 github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= github.com/go-toolsmith/strparse v0.0.0-20180903215201-830b6daa1241/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= github.com/go-toolsmith/typep v0.0.0-20181030061450-d63dc7650676/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/goburrow/cache v0.1.0/go.mod h1:8oxkfud4hvjO4tNjEKZfEd+LrpDVDlBIauGYsWGEzio= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.0 h1:G8O7TerXerS4F6sx9OV7/nRfJdnXgHZu/S/7F2SN+UE= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -130,6 +153,8 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= @@ -150,6 +175,8 @@ github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -158,6 +185,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= +github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= @@ -183,6 +212,8 @@ github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOo github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk= +github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/improbable-eng/grpc-web v0.11.0 h1:drkI/L8GnHWtWeAZFB7bEUQz9bZqOf/X8Dhvsm2uV7Y= github.com/improbable-eng/grpc-web v0.11.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -190,6 +221,7 @@ github.com/ipfs/bbloom v0.0.1 h1:s7KkiBPfxCeDVo47KySjK0ACPc5GJRUxFpdyWEuDjhw= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= github.com/ipfs/dir-index-html v1.0.3/go.mod h1:TG9zbaH/+4MnkGel0xF4SLNhk+YZvBNo6jjBkO/LaWc= github.com/ipfs/go-bitswap v0.0.3/go.mod h1:jadAZYsP/tcRMl47ZhFxhaNuDQoXawT8iHMg+iFoQbg= +github.com/ipfs/go-bitswap v0.0.7/go.mod h1:++LZRc+e1/ZxYsZq7QLKIPQvybh+70TMgeGuX+WB0pY= github.com/ipfs/go-bitswap v0.0.8-0.20190704155249-cbb485998356 h1:DNc/6p5YnnHWnKab5Lmg6BS4CsRjWyYvapaIsQELAJg= github.com/ipfs/go-bitswap v0.0.8-0.20190704155249-cbb485998356/go.mod h1:kYh8QssUH3mAuCwV3WmfcSqwJLhQC4WynKpd1hxt85A= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= @@ -210,6 +242,7 @@ github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRV github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= +github.com/ipfs/go-ds-badger v0.0.3/go.mod h1:7AzMKCsGav0u46HpdLiAEAOqizR1H6AZsjpHpQSPYCQ= github.com/ipfs/go-ds-badger v0.0.5 h1:dxKuqw5T1Jm8OuV+lchA76H9QZFyPKZeLuT6bN42hJQ= github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaHzfGTzuE3s= github.com/ipfs/go-ds-flatfs v0.0.2 h1:1zujtU5bPBH6B8roE+TknKIbBCrpau865xUk0dH3x2A= @@ -221,6 +254,7 @@ github.com/ipfs/go-ds-measure v0.0.1 h1:PrCueug+yZLkDCOthZTXKinuoCal/GvlAT7cNxzr github.com/ipfs/go-ds-measure v0.0.1/go.mod h1:wiH6bepKsgyNKpz3nyb4erwhhIVpIxnZbsjN1QpVbbE= github.com/ipfs/go-fs-lock v0.0.1 h1:XHX8uW4jQBYWHj59XXcjg7BHlHxV9ZOYs6Y43yb7/l0= github.com/ipfs/go-fs-lock v0.0.1/go.mod h1:DNBekbboPKcxs1aukPSaOtFA3QfSdi5C855v0i9XJ8Y= +github.com/ipfs/go-ipfs v0.4.21/go.mod h1:T9zAmGO+rzbvLjDUm0DHtYXtdT4GhWOZeCPztgmt2V8= github.com/ipfs/go-ipfs v0.4.22 h1:dDUSkIj0kSrMJW55wOm9P+mYewxCDSATy+PGZrShdfI= github.com/ipfs/go-ipfs v0.4.22/go.mod h1:vgIn+MMrMEN2Yd6AWxAZVP/+YGI8dSGSgwiTEU6R2kw= github.com/ipfs/go-ipfs-addr v0.0.1 h1:DpDFybnho9v3/a1dzJ5KnWdThWD1HrFLpQ+tWIyBaFI= @@ -279,6 +313,7 @@ github.com/ipfs/go-mfs v0.0.7/go.mod h1:10Hdow7wUbSlIamnOduxeP6MEp58TozZmdnAhugO github.com/ipfs/go-path v0.0.3/go.mod h1:zIRQUez3LuQIU25zFjC2hpBTHimWx7VK5bjZgRLbbdo= github.com/ipfs/go-path v0.0.4 h1:zG/id80tV51XAfvCsRJIEGQSHGuTDBi8RWrtr3EfcfY= github.com/ipfs/go-path v0.0.4/go.mod h1:zIRQUez3LuQIU25zFjC2hpBTHimWx7VK5bjZgRLbbdo= +github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= github.com/ipfs/go-peertaskqueue v0.0.5-0.20190704154349-f09820a0a5b6 h1:/8zfOPbZ8q0YadOu7snck13TtYW9f08v65XDWag9+jU= github.com/ipfs/go-peertaskqueue v0.0.5-0.20190704154349-f09820a0a5b6/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= github.com/ipfs/go-todocounter v0.0.1 h1:kITWA5ZcQZfrUnDNkRn04Xzh0YFaDFXsoO2A81Eb6Lw= @@ -313,6 +348,7 @@ github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsj github.com/jbenet/goprocess v0.1.3 h1:YKyIEECS/XvcfHtBzxtjBBbWK+MbvA6dG8ASiqwvr10= github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/gorm v1.9.2/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= github.com/jinzhu/gorm v1.9.11 h1:gaHGvE+UnWGlbWG4Y3FUwY1EcZ5n6S9WtqBA/uySMLE= github.com/jinzhu/gorm v1.9.11/go.mod h1:bu/pK8szGZ2puuErfU0RwyeNdsf3e6nCX/noXaVxkfw= @@ -327,15 +363,16 @@ github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqx github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v0.0.0-20161130080628-0de1eaf82fa3/go.mod h1:jxZFDH7ILpTPQTk+E2s+z4CUas9lVNjIuKR4c5/zKgM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b h1:wxtKgYHEncAU00muMD06dzLiahtGM1eouRNOzVV7tdQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= @@ -383,6 +420,8 @@ github.com/libp2p/go-libp2p-connmgr v0.0.6 h1:oEUriPO/qWTvfHRPEU4HdNlNhYigdueOs2 github.com/libp2p/go-libp2p-connmgr v0.0.6/go.mod h1:uwDfgdgqB5248sQYib1xo603cSsMg9PgAKu0Z+Y65Qk= github.com/libp2p/go-libp2p-core v0.0.1 h1:HSTZtFIq/W5Ue43Zw+uWZyy2Vl5WtF0zDjKN8/DT/1I= github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= +github.com/libp2p/go-libp2p-core v0.0.6 h1:SsYhfWJ47vLP1Rd9/0hqEm/W/PlFbC/3YLZyLCcvo1w= +github.com/libp2p/go-libp2p-core v0.0.6/go.mod h1:0d9xmaYAVY5qmbp/fcgxHT3ZJsLjYeYPMJAUKpaCHrE= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ= @@ -518,10 +557,14 @@ github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwm github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= @@ -537,6 +580,7 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8Rv github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5 h1:l16XLUUJ34wIz+RIvLhSwGvLvKyy+W598b135bJN6mg= github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= +github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -588,6 +632,7 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= @@ -619,6 +664,7 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -637,18 +683,21 @@ github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v0.0.0-20190401211740-f487f9de1cd3 h1:hBSHahWMEgzwRyS6dRpxY0XyjZsHyQ61s084wo5PJe0= +github.com/smartystreets/assertions v0.0.0-20190401211740-f487f9de1cd3/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa h1:E+gaaifzi2xF65PbDmuKI3PhLWY6G5opMLniFq8vmXA= github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a h1:/eS3yfGjQKG+9kayBkj0ip1BGhq6zJ3eaVksphxAaek= github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.0/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -712,6 +761,8 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/dig v1.7.0 h1:E5/L92iQTNJTjfgJF2KgU+/JpMaiuvK2DHLBj0+kSZk= @@ -742,9 +793,11 @@ golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo= golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -752,6 +805,7 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -767,6 +821,7 @@ golang.org/x/net v0.0.0-20190310074541-c10a0554eabf/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 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-20190522135303-fa69b94a3b58/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -796,6 +851,7 @@ golang.org/x/sys v0.0.0-20190302025703-b6889370fb10/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -820,8 +876,8 @@ golang.org/x/tools v0.0.0-20190121143147-24cd39ecf745/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420000508-685fecacd0a0/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20190212162355-a5947ffaace3/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -838,14 +894,17 @@ google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c h1:hrpEMCZ2O7DR5gC1n2AJGVhrwiEjOi35+jxtIuZpTMo= google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/go/internal/group/demo/cfg.go b/go/internal/group/demo/cfg.go new file mode 100644 index 0000000000..3a0cf9da54 --- /dev/null +++ b/go/internal/group/demo/cfg.go @@ -0,0 +1,83 @@ +package main + +import ( + "crypto/rand" + "encoding/base64" + "fmt" + "math/big" + + "berty.tech/go/pkg/errcode" + ipfs_datastore "github.com/ipfs/go-datastore" + ipfs_datastoresync "github.com/ipfs/go-datastore/sync" + ipfs_cfg "github.com/ipfs/go-ipfs-config" + ipfs_node "github.com/ipfs/go-ipfs/core/node" + ipfs_libp2p "github.com/ipfs/go-ipfs/core/node/libp2p" + ipfs_repo "github.com/ipfs/go-ipfs/repo" + libp2p_ci "github.com/libp2p/go-libp2p-crypto" // nolint:staticcheck + libp2p_peer "github.com/libp2p/go-libp2p-peer" // nolint:staticcheck +) + +func createBuildConfig() (*ipfs_node.BuildCfg, error) { + ds := ipfs_datastore.NewMapDatastore() + repo, err := createRepo(ipfs_datastoresync.MutexWrap(ds)) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + routing := ipfs_libp2p.DHTOption + hostopts := ipfs_libp2p.DefaultHostOption + return &ipfs_node.BuildCfg{ + Online: true, + Permanent: true, + DisableEncryptedConnections: false, + NilRepo: false, + Routing: routing, + Host: hostopts, + Repo: repo, + ExtraOpts: map[string]bool{ + "pubsub": true, + }, + }, nil +} + +func createRepo(dstore ipfs_repo.Datastore) (ipfs_repo.Repo, error) { + c := ipfs_cfg.Config{} + priv, pub, err := libp2p_ci.GenerateKeyPairWithReader(libp2p_ci.RSA, 2048, rand.Reader) // nolint:staticcheck + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + pid, err := libp2p_peer.IDFromPublicKey(pub) // nolint:staticcheck + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + privkeyb, err := priv.Bytes() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + portOffsetBI, err := rand.Int(rand.Reader, big.NewInt(100)) + if err != nil { + panic(err) + } + + portOffset := portOffsetBI.Int64() % 100 + + println("Listening on port", 4001+portOffset) + + c.Bootstrap = ipfs_cfg.DefaultBootstrapAddresses + c.Addresses.Swarm = []string{ + fmt.Sprintf("/ip4/0.0.0.0/tcp/%d", 4001+portOffset), + fmt.Sprintf("/ip6/0.0.0.0/tcp/%d", 4001+portOffset), + } + c.Identity.PeerID = pid.Pretty() + c.Identity.PrivKey = base64.StdEncoding.EncodeToString(privkeyb) + c.Discovery.MDNS.Enabled = true + c.Discovery.MDNS.Interval = 1 + + return &ipfs_repo.Mock{ + D: dstore, + C: c, + }, nil +} diff --git a/go/internal/group/demo/cmd.go b/go/internal/group/demo/cmd.go new file mode 100644 index 0000000000..ddd855effb --- /dev/null +++ b/go/internal/group/demo/cmd.go @@ -0,0 +1,225 @@ +package main + +import ( + "context" + "crypto/rand" + "encoding/base64" + "fmt" + "os" + "path" + "sync" + + "berty.tech/go-orbit-db/stores" + + "berty.tech/go-orbit-db/events" + "berty.tech/go/internal/orbitutil" + "github.com/libp2p/go-libp2p-core/crypto" + + orbitdb "berty.tech/go-orbit-db" + + "berty.tech/go/internal/ipfsutil" + + "berty.tech/go/internal/group" +) + +func issueNewInvitation(device crypto.PrivKey, g *group.Group) { + newI, err := group.NewInvitation(device, g) + if err != nil { + panic(err) + } + + newIB64, err := newI.Marshal() + if err != nil { + panic(err) + } + + println("New invitation: ", base64.StdEncoding.EncodeToString(newIB64)) + +} + +func listMembers(s orbitutil.MemberStore) { + members, err := s.ListMembers() + if err != nil { + panic(err) + } + + println(fmt.Sprintf("Printing list of %d members", len(members))) + + for _, m := range members { + memberKeyBytes, err := m.Member.Raw() + if err != nil { + panic(err) + } + + deviceKeyBytes, err := m.Device.Raw() + if err != nil { + panic(err) + } + + println(" >> ", base64.StdEncoding.EncodeToString(memberKeyBytes), " >> ", base64.StdEncoding.EncodeToString(deviceKeyBytes)) + } +} + +func mainLoop(invitation *group.Invitation, create bool) { + //zaptest.Level(zapcore.DebugLevel) + //config := zap.NewDevelopmentConfig() + //config.OutputPaths = []string{"stdout"} + //logger, _ := config.Build() + //zap.ReplaceGlobals(logger) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + cfg, err := createBuildConfig() + if err != nil { + panic(err) + } + + api, err := ipfsutil.NewConfigurableCoreAPI(ctx, cfg, ipfsutil.OptionMDNSDiscovery) + if err != nil { + panic(err) + } + + self, err := api.Key().Self(ctx) + if err != nil { + panic(err) + } + + println("My own peer ID is", self.ID().String()) + + g, err := invitation.GetGroup() + if err != nil { + panic(err) + } + + secretHolder, err := orbitutil.NewGroupHolder() + if err != nil { + panic(err) + } + + p := path.Join(os.TempDir(), base64.StdEncoding.EncodeToString(invitation.InvitationPrivKey)) + + odb, err := orbitdb.NewOrbitDB(ctx, api, &orbitdb.NewOrbitDBOptions{Directory: &p}) + if err != nil { + panic(err) + } + + s, err := secretHolder.NewMemberStore(ctx, odb, g, &orbitdb.CreateDBOptions{ + Directory: &p, + }) + if err != nil { + panic(err) + } + + member, _, err := crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + panic(err) + } + + device, _, err := crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + panic(err) + } + + memberKeyBytes, err := member.GetPublic().Raw() + if err != nil { + panic(err) + } + + deviceKeyBytes, err := device.GetPublic().Raw() + if err != nil { + panic(err) + } + + inviterDevicePubKey, err := invitation.GetInviterDevicePublicKey() + if err != nil { + panic(err) + } + + println("Own member key:", base64.StdEncoding.EncodeToString(memberKeyBytes), "device key: ", base64.StdEncoding.EncodeToString(deviceKeyBytes)) + + if !create { + println("Waiting store replication") + + once := sync.Once{} + wg := sync.WaitGroup{} + wg.Add(1) + go s.Subscribe(ctx, func(evt events.Event) { + switch evt.(type) { + case *stores.EventReplicated, *stores.EventLoad, *stores.EventWrite, *stores.EventReady: + println("Replicated or ready") + members, err := s.ListMembers() + if err != nil { + panic(err) + } + + listMembers(s) + + for _, m := range members { + if m.Device.Equals(inviterDevicePubKey) { + once.Do(func() { + println("inviter found in store", base64.StdEncoding.EncodeToString(invitation.InviterDevicePubKey)) + wg.Done() + }) + } + } + } + }) + + wg.Wait() + + println("redeeming invitation issued by", base64.StdEncoding.EncodeToString(invitation.InviterDevicePubKey)) + } + + _, err = s.RedeemInvitation(ctx, member, device, invitation) + if err != nil { + panic(err) + } + + listMembers(s) + issueNewInvitation(device, g) + + s.Subscribe(ctx, func(e events.Event) { + switch e.(type) { + case *stores.EventReplicated: + println("New member detected") + listMembers(s) + issueNewInvitation(device, g) + break + } + }) + + <-ctx.Done() +} + +func main() { + var ( + i *group.Invitation + err error + ) + + create := len(os.Args) == 1 + + if create { + println("Creating a new group") + _, i, err = group.New() + if err != nil { + panic(err) + } + } else { + println("Joining an existing group") + // Read invitation (as base64 on stdin) + iB64, err := base64.StdEncoding.DecodeString(os.Args[1]) + if err != nil { + panic(err) + } + + i = &group.Invitation{} + err = i.Unmarshal(iB64) + if err != nil { + panic(err) + } + } + + mainLoop(i, create) +} diff --git a/go/internal/group/demo/doc.go b/go/internal/group/demo/doc.go new file mode 100644 index 0000000000..16e26f3dd0 --- /dev/null +++ b/go/internal/group/demo/doc.go @@ -0,0 +1,6 @@ +// this package is demoing how to use the orbitdb with the berty protocol groups +package main + +// Usage: +// go run doc.go +// go run doc.go diff --git a/go/internal/group/doc.go b/go/internal/group/doc.go new file mode 100644 index 0000000000..982311ed58 --- /dev/null +++ b/go/internal/group/doc.go @@ -0,0 +1,2 @@ +// group contains structs and helpers functions to manage a Berty protocol group +package group // import "berty.tech/go/internal/group" diff --git a/go/internal/group/group.go b/go/internal/group/group.go new file mode 100644 index 0000000000..22ba228eec --- /dev/null +++ b/go/internal/group/group.go @@ -0,0 +1,71 @@ +package group + +import ( + "crypto/rand" + "encoding/hex" + + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p-core/crypto" +) + +const CurrentGroupVersion = 1 + +// Group is a struct containing the cryptographic material to access its data +type Group struct { + PubKey crypto.PubKey + SigningKey crypto.PrivKey +} + +// MemberDevice is a device part of a group +type MemberDevice struct { + Member crypto.PubKey + Device crypto.PubKey +} + +// GroupIDAsString returns the group pub key as a string +func (g *Group) GroupIDAsString() (string, error) { + pkBytes, err := g.PubKey.Raw() + if err != nil { + return "", errcode.TODO.Wrap(err) + } + + return hex.EncodeToString(pkBytes), nil +} + +// New creates a new Group object and an invitation to be used by +// the first member of the group +func New() (*Group, *Invitation, error) { + priv, pub, err := crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + return nil, nil, errcode.TODO.Wrap(err) + } + + signing, _, err := crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + return nil, nil, errcode.TODO.Wrap(err) + } + + group := &Group{ + PubKey: pub, + SigningKey: signing, + } + + invitation, err := NewInvitation(priv, group) + if err != nil { + return nil, nil, errcode.TODO.Wrap(err) + } + + return group, invitation, nil +} + +func (g *Group) GetSharedSecret() (*[32]byte, error) { + s, err := seedFromEd25519PrivateKey(g.SigningKey) + if err != nil { + return nil, err + } + + sharedSecret := [32]byte{} + copy(sharedSecret[:], s[:]) + + return &sharedSecret, nil +} diff --git a/go/internal/group/invitation.go b/go/internal/group/invitation.go new file mode 100644 index 0000000000..6db93b7a2d --- /dev/null +++ b/go/internal/group/invitation.go @@ -0,0 +1,136 @@ +package group + +import ( + "crypto/rand" + + "golang.org/x/crypto/ed25519" + + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p-core/crypto" + pb "github.com/libp2p/go-libp2p-core/crypto/pb" +) + +func ed25519KeyFromSeed(seed []byte) (crypto.PrivKey, error) { + privWithPub := ed25519.NewKeyFromSeed(seed) + + return crypto.UnmarshalEd25519PrivateKey(privWithPub) +} + +func (m *Invitation) GetGroup() (*Group, error) { + pk, err := m.GetGroupPublicKey() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + signingKey, err := ed25519KeyFromSeed(m.GroupSigningKey) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return &Group{ + PubKey: pk, + SigningKey: signingKey, + }, nil +} + +func (m *Invitation) GetInviterDevicePublicKey() (crypto.PubKey, error) { + if m.InviterDevicePubKey == nil { + return nil, errcode.ErrInvalidInput + } + + return crypto.UnmarshalEd25519PublicKey(m.InviterDevicePubKey) +} + +func (m *Invitation) GetInvitationPrivateKey() (crypto.PrivKey, error) { + if m.InvitationPrivKey == nil { + return nil, errcode.ErrInvalidInput + } + + privWithPub := ed25519.NewKeyFromSeed(m.InvitationPrivKey) + + invitationPrivKey, err := crypto.UnmarshalEd25519PrivateKey(privWithPub) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return invitationPrivKey, nil +} + +func (m *Invitation) GetGroupPublicKey() (crypto.PubKey, error) { + if m.GroupPubKey == nil { + return nil, errcode.ErrInvalidInput + } + + return crypto.UnmarshalEd25519PublicKey(m.GroupPubKey) +} + +// NewInvitation generates a new Invitation to a group, the signer must be +// a current member device of the group +func NewInvitation(inviterDevice crypto.PrivKey, group *Group) (*Invitation, error) { + if group == nil || inviterDevice == nil || group.SigningKey == nil || group.PubKey == nil { + return nil, errcode.ErrInvalidInput + } + + priv, _, err := crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + privBytes, err := seedFromEd25519PrivateKey(priv) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + pubBytes, err := priv.GetPublic().Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + sig, err := inviterDevice.Sign(pubBytes) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + groupPubKeyBytes, err := group.PubKey.Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + inviterDevicePubKeyBytes, err := inviterDevice.GetPublic().Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + signingKeyBytes, err := seedFromEd25519PrivateKey(group.SigningKey) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return &Invitation{ + InviterDevicePubKey: inviterDevicePubKeyBytes, + InvitationPrivKey: privBytes, + InvitationPubKeySignature: sig, + + GroupVersion: CurrentGroupVersion, + GroupPubKey: groupPubKeyBytes, + GroupSigningKey: signingKeyBytes, + }, nil +} + +func seedFromEd25519PrivateKey(key crypto.PrivKey) ([]byte, error) { + // Similar to (*ed25519).Seed() + if key.Type() != pb.KeyType_Ed25519 { + return nil, errcode.ErrInvalidInput + } + + r, err := key.Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + if len(r) != ed25519.PrivateKeySize { + return nil, errcode.ErrInvalidInput + } + + return r[:ed25519.PrivateKeySize-ed25519.PublicKeySize], nil +} diff --git a/go/internal/group/log_entry_member.pb.go b/go/internal/group/log_entry_member.pb.go deleted file mode 100644 index 7f50eca2b2..0000000000 --- a/go/internal/group/log_entry_member.pb.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: go-internal/log_entry_member.proto - -package group - -import ( - fmt "fmt" - math "math" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MemberEntryEnvelope struct { - EncryptedMemberPayload []byte `protobuf:"bytes,1,opt,name=encrypted_member_payload,json=encryptedMemberPayload,proto3" json:"encrypted_member_payload,omitempty"` - MemberPayloadSignature []byte `protobuf:"bytes,2,opt,name=member_payload_signature,json=memberPayloadSignature,proto3" json:"member_payload_signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberEntryEnvelope) Reset() { *m = MemberEntryEnvelope{} } -func (m *MemberEntryEnvelope) String() string { return proto.CompactTextString(m) } -func (*MemberEntryEnvelope) ProtoMessage() {} -func (*MemberEntryEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_d7949e623aaddc12, []int{0} -} -func (m *MemberEntryEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MemberEntryEnvelope.Unmarshal(m, b) -} -func (m *MemberEntryEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MemberEntryEnvelope.Marshal(b, m, deterministic) -} -func (m *MemberEntryEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberEntryEnvelope.Merge(m, src) -} -func (m *MemberEntryEnvelope) XXX_Size() int { - return xxx_messageInfo_MemberEntryEnvelope.Size(m) -} -func (m *MemberEntryEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_MemberEntryEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberEntryEnvelope proto.InternalMessageInfo - -func (m *MemberEntryEnvelope) GetEncryptedMemberPayload() []byte { - if m != nil { - return m.EncryptedMemberPayload - } - return nil -} - -func (m *MemberEntryEnvelope) GetMemberPayloadSignature() []byte { - if m != nil { - return m.MemberPayloadSignature - } - return nil -} - -type MemberEntryPayload struct { - MemberPubKey []byte `protobuf:"bytes,1,opt,name=member_pub_key,json=memberPubKey,proto3" json:"member_pub_key,omitempty"` - MemberPubKeySignature []byte `protobuf:"bytes,2,opt,name=member_pub_key_signature,json=memberPubKeySignature,proto3" json:"member_pub_key_signature,omitempty"` - MemberDevicePubKey []byte `protobuf:"bytes,3,opt,name=member_device_pub_key,json=memberDevicePubKey,proto3" json:"member_device_pub_key,omitempty"` - MemberDevicePubKeySignature []byte `protobuf:"bytes,4,opt,name=member_device_pub_key_signature,json=memberDevicePubKeySignature,proto3" json:"member_device_pub_key_signature,omitempty"` - InviterMemberPubKey []byte `protobuf:"bytes,5,opt,name=inviter_member_pub_key,json=inviterMemberPubKey,proto3" json:"inviter_member_pub_key,omitempty"` - InvitationPubKey []byte `protobuf:"bytes,6,opt,name=invitation_pub_key,json=invitationPubKey,proto3" json:"invitation_pub_key,omitempty"` - InvitationPubKeySignature []byte `protobuf:"bytes,7,opt,name=invitation_pub_key_signature,json=invitationPubKeySignature,proto3" json:"invitation_pub_key_signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberEntryPayload) Reset() { *m = MemberEntryPayload{} } -func (m *MemberEntryPayload) String() string { return proto.CompactTextString(m) } -func (*MemberEntryPayload) ProtoMessage() {} -func (*MemberEntryPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_d7949e623aaddc12, []int{1} -} -func (m *MemberEntryPayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MemberEntryPayload.Unmarshal(m, b) -} -func (m *MemberEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MemberEntryPayload.Marshal(b, m, deterministic) -} -func (m *MemberEntryPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberEntryPayload.Merge(m, src) -} -func (m *MemberEntryPayload) XXX_Size() int { - return xxx_messageInfo_MemberEntryPayload.Size(m) -} -func (m *MemberEntryPayload) XXX_DiscardUnknown() { - xxx_messageInfo_MemberEntryPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberEntryPayload proto.InternalMessageInfo - -func (m *MemberEntryPayload) GetMemberPubKey() []byte { - if m != nil { - return m.MemberPubKey - } - return nil -} - -func (m *MemberEntryPayload) GetMemberPubKeySignature() []byte { - if m != nil { - return m.MemberPubKeySignature - } - return nil -} - -func (m *MemberEntryPayload) GetMemberDevicePubKey() []byte { - if m != nil { - return m.MemberDevicePubKey - } - return nil -} - -func (m *MemberEntryPayload) GetMemberDevicePubKeySignature() []byte { - if m != nil { - return m.MemberDevicePubKeySignature - } - return nil -} - -func (m *MemberEntryPayload) GetInviterMemberPubKey() []byte { - if m != nil { - return m.InviterMemberPubKey - } - return nil -} - -func (m *MemberEntryPayload) GetInvitationPubKey() []byte { - if m != nil { - return m.InvitationPubKey - } - return nil -} - -func (m *MemberEntryPayload) GetInvitationPubKeySignature() []byte { - if m != nil { - return m.InvitationPubKeySignature - } - return nil -} - -func init() { - proto.RegisterType((*MemberEntryEnvelope)(nil), "MemberEntryEnvelope") - proto.RegisterType((*MemberEntryPayload)(nil), "MemberEntryPayload") -} - -func init() { proto.RegisterFile("go-internal/log_entry_member.proto", fileDescriptor_d7949e623aaddc12) } - -var fileDescriptor_d7949e623aaddc12 = []byte{ - // 302 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4b, 0xc3, 0x30, - 0x14, 0xc7, 0xa9, 0xd3, 0x09, 0x61, 0x88, 0x64, 0x38, 0x2a, 0x0e, 0x95, 0xe2, 0xc1, 0x83, 0xae, - 0xc8, 0x0e, 0x7a, 0x13, 0x64, 0x3b, 0xc9, 0x40, 0xf4, 0xe6, 0x25, 0xf4, 0xc7, 0xa3, 0x06, 0xdb, - 0xa4, 0xc4, 0xb4, 0x90, 0x3f, 0xc1, 0x9b, 0x7f, 0xb2, 0x2c, 0x49, 0xd3, 0xb8, 0x7a, 0xcd, 0xe7, - 0xfb, 0x79, 0xdf, 0x17, 0x78, 0x28, 0x2a, 0xf8, 0x2d, 0x65, 0x12, 0x04, 0x4b, 0xca, 0xb8, 0xe4, - 0x05, 0x01, 0x26, 0x85, 0x22, 0x15, 0x54, 0x29, 0x88, 0x45, 0x2d, 0xb8, 0xe4, 0xd1, 0x77, 0x80, - 0xa6, 0x1b, 0xfd, 0xb0, 0xde, 0xc2, 0x35, 0x6b, 0xa1, 0xe4, 0x35, 0xe0, 0x07, 0x14, 0x02, 0xcb, - 0x84, 0xaa, 0x25, 0xe4, 0xd6, 0x20, 0x75, 0xa2, 0x4a, 0x9e, 0xe4, 0x61, 0x70, 0x19, 0x5c, 0x4f, - 0x5e, 0x67, 0x8e, 0x1b, 0xff, 0xc5, 0xd0, 0xad, 0xf9, 0x37, 0x4f, 0xbe, 0x68, 0xc1, 0x12, 0xd9, - 0x08, 0x08, 0xf7, 0x8c, 0x59, 0xf9, 0xc2, 0x5b, 0x47, 0xa3, 0x9f, 0x11, 0xc2, 0xde, 0x2e, 0xdd, - 0xc0, 0x2b, 0x74, 0xd4, 0x0d, 0x6c, 0x52, 0xf2, 0x09, 0xca, 0x2e, 0x30, 0xb1, 0x63, 0x9a, 0xf4, - 0x19, 0x14, 0xbe, 0xef, 0x6b, 0x4d, 0x6a, 0x50, 0x7b, 0xe2, 0xe7, 0x5d, 0x2b, 0xbe, 0x43, 0x16, - 0x90, 0x1c, 0x5a, 0x9a, 0x81, 0x6b, 0x19, 0x69, 0x0b, 0x1b, 0xb8, 0xd2, 0xcc, 0x76, 0xad, 0xd0, - 0xc5, 0xbf, 0x8a, 0x57, 0xb9, 0xaf, 0xe5, 0xb3, 0xa1, 0xdc, 0x17, 0x2f, 0xd1, 0x8c, 0xb2, 0x96, - 0x4a, 0x10, 0x64, 0xe7, 0x7f, 0x07, 0x5a, 0x9e, 0x5a, 0xba, 0xf1, 0xbf, 0x79, 0x83, 0xb0, 0x7e, - 0x4e, 0x24, 0xe5, 0xcc, 0x09, 0x63, 0x2d, 0x1c, 0xf7, 0xc4, 0xa6, 0x1f, 0xd1, 0x7c, 0x98, 0xf6, - 0xb6, 0x3c, 0xd4, 0xde, 0xe9, 0xae, 0xe7, 0x76, 0x7c, 0x3a, 0x7f, 0x9f, 0xa7, 0x20, 0xa4, 0x5a, - 0x48, 0xc8, 0x3e, 0xe2, 0x82, 0xc7, 0xee, 0x9e, 0x0a, 0xc1, 0x9b, 0x3a, 0x1d, 0xeb, 0x2b, 0x5a, - 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x83, 0xf9, 0x4b, 0xa4, 0x6b, 0x02, 0x00, 0x00, -} diff --git a/go/internal/group/log_entry_message.pb.go b/go/internal/group/log_entry_message.pb.go deleted file mode 100644 index 7aae6fb860..0000000000 --- a/go/internal/group/log_entry_message.pb.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: go-internal/log_entry_message.proto - -package group - -import ( - fmt "fmt" - math "math" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MessageEntryPayload_PayloadType int32 - -const ( - MessageEntryPayload_PayloadTypeUnknown MessageEntryPayload_PayloadType = 0 - MessageEntryPayload_PayloadTypeMessage MessageEntryPayload_PayloadType = 1 - MessageEntryPayload_PayloadTypeInvitation MessageEntryPayload_PayloadType = 2 -) - -var MessageEntryPayload_PayloadType_name = map[int32]string{ - 0: "PayloadTypeUnknown", - 1: "PayloadTypeMessage", - 2: "PayloadTypeInvitation", -} - -var MessageEntryPayload_PayloadType_value = map[string]int32{ - "PayloadTypeUnknown": 0, - "PayloadTypeMessage": 1, - "PayloadTypeInvitation": 2, -} - -func (x MessageEntryPayload_PayloadType) String() string { - return proto.EnumName(MessageEntryPayload_PayloadType_name, int32(x)) -} - -func (MessageEntryPayload_PayloadType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_eb30c2d83a30b073, []int{1, 0} -} - -type MessageEntryEnvelope struct { - Counter uint64 `protobuf:"varint,1,opt,name=counter,proto3" json:"counter,omitempty"` - EncryptedPayload []byte `protobuf:"bytes,2,opt,name=encrypted_payload,json=encryptedPayload,proto3" json:"encrypted_payload,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageEntryEnvelope) Reset() { *m = MessageEntryEnvelope{} } -func (m *MessageEntryEnvelope) String() string { return proto.CompactTextString(m) } -func (*MessageEntryEnvelope) ProtoMessage() {} -func (*MessageEntryEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_eb30c2d83a30b073, []int{0} -} -func (m *MessageEntryEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageEntryEnvelope.Unmarshal(m, b) -} -func (m *MessageEntryEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageEntryEnvelope.Marshal(b, m, deterministic) -} -func (m *MessageEntryEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageEntryEnvelope.Merge(m, src) -} -func (m *MessageEntryEnvelope) XXX_Size() int { - return xxx_messageInfo_MessageEntryEnvelope.Size(m) -} -func (m *MessageEntryEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_MessageEntryEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageEntryEnvelope proto.InternalMessageInfo - -func (m *MessageEntryEnvelope) GetCounter() uint64 { - if m != nil { - return m.Counter - } - return 0 -} - -func (m *MessageEntryEnvelope) GetEncryptedPayload() []byte { - if m != nil { - return m.EncryptedPayload - } - return nil -} - -func (m *MessageEntryEnvelope) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type MessageEntryPayload struct { - Type MessageEntryPayload_PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=MessageEntryPayload_PayloadType" json:"type,omitempty"` - MessageBody []byte `protobuf:"bytes,2,opt,name=message_body,json=messageBody,proto3" json:"message_body,omitempty"` - Invitation *Invitation `protobuf:"bytes,3,opt,name=invitation,proto3" json:"invitation,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageEntryPayload) Reset() { *m = MessageEntryPayload{} } -func (m *MessageEntryPayload) String() string { return proto.CompactTextString(m) } -func (*MessageEntryPayload) ProtoMessage() {} -func (*MessageEntryPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_eb30c2d83a30b073, []int{1} -} -func (m *MessageEntryPayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageEntryPayload.Unmarshal(m, b) -} -func (m *MessageEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageEntryPayload.Marshal(b, m, deterministic) -} -func (m *MessageEntryPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageEntryPayload.Merge(m, src) -} -func (m *MessageEntryPayload) XXX_Size() int { - return xxx_messageInfo_MessageEntryPayload.Size(m) -} -func (m *MessageEntryPayload) XXX_DiscardUnknown() { - xxx_messageInfo_MessageEntryPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageEntryPayload proto.InternalMessageInfo - -func (m *MessageEntryPayload) GetType() MessageEntryPayload_PayloadType { - if m != nil { - return m.Type - } - return MessageEntryPayload_PayloadTypeUnknown -} - -func (m *MessageEntryPayload) GetMessageBody() []byte { - if m != nil { - return m.MessageBody - } - return nil -} - -func (m *MessageEntryPayload) GetInvitation() *Invitation { - if m != nil { - return m.Invitation - } - return nil -} - -type Invitation struct { - InviterMemberPubKey []byte `protobuf:"bytes,1,opt,name=inviter_member_pub_key,json=inviterMemberPubKey,proto3" json:"inviter_member_pub_key,omitempty"` - InvitationPrivKey []byte `protobuf:"bytes,2,opt,name=invitation_priv_key,json=invitationPrivKey,proto3" json:"invitation_priv_key,omitempty"` - InvitationPubKeySignature []byte `protobuf:"bytes,3,opt,name=invitation_pub_key_signature,json=invitationPubKeySignature,proto3" json:"invitation_pub_key_signature,omitempty"` - GroupVersion uint32 `protobuf:"varint,4,opt,name=group_version,json=groupVersion,proto3" json:"group_version,omitempty"` - GroupIdPubKey []byte `protobuf:"bytes,5,opt,name=group_id_pub_key,json=groupIdPubKey,proto3" json:"group_id_pub_key,omitempty"` - SharedSecret []byte `protobuf:"bytes,6,opt,name=shared_secret,json=sharedSecret,proto3" json:"shared_secret,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Invitation) Reset() { *m = Invitation{} } -func (m *Invitation) String() string { return proto.CompactTextString(m) } -func (*Invitation) ProtoMessage() {} -func (*Invitation) Descriptor() ([]byte, []int) { - return fileDescriptor_eb30c2d83a30b073, []int{2} -} -func (m *Invitation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Invitation.Unmarshal(m, b) -} -func (m *Invitation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Invitation.Marshal(b, m, deterministic) -} -func (m *Invitation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Invitation.Merge(m, src) -} -func (m *Invitation) XXX_Size() int { - return xxx_messageInfo_Invitation.Size(m) -} -func (m *Invitation) XXX_DiscardUnknown() { - xxx_messageInfo_Invitation.DiscardUnknown(m) -} - -var xxx_messageInfo_Invitation proto.InternalMessageInfo - -func (m *Invitation) GetInviterMemberPubKey() []byte { - if m != nil { - return m.InviterMemberPubKey - } - return nil -} - -func (m *Invitation) GetInvitationPrivKey() []byte { - if m != nil { - return m.InvitationPrivKey - } - return nil -} - -func (m *Invitation) GetInvitationPubKeySignature() []byte { - if m != nil { - return m.InvitationPubKeySignature - } - return nil -} - -func (m *Invitation) GetGroupVersion() uint32 { - if m != nil { - return m.GroupVersion - } - return 0 -} - -func (m *Invitation) GetGroupIdPubKey() []byte { - if m != nil { - return m.GroupIdPubKey - } - return nil -} - -func (m *Invitation) GetSharedSecret() []byte { - if m != nil { - return m.SharedSecret - } - return nil -} - -func init() { - proto.RegisterEnum("MessageEntryPayload_PayloadType", MessageEntryPayload_PayloadType_name, MessageEntryPayload_PayloadType_value) - proto.RegisterType((*MessageEntryEnvelope)(nil), "MessageEntryEnvelope") - proto.RegisterType((*MessageEntryPayload)(nil), "MessageEntryPayload") - proto.RegisterType((*Invitation)(nil), "Invitation") -} - -func init() { - proto.RegisterFile("go-internal/log_entry_message.proto", fileDescriptor_eb30c2d83a30b073) -} - -var fileDescriptor_eb30c2d83a30b073 = []byte{ - // 423 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x5f, 0x6b, 0xdb, 0x30, - 0x14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xef, - 0x2d, 0xbb, 0x7e, 0xf7, 0x73, 0x99, 0xa2, 0xd2, 0x26, 0xd2, 0x98, 0x3d, 0xec, 0x0a, 0xb1, 0xeb, - 0x9f, 0xb3, 0xdd, 0x2c, 0x3d, 0xb1, 0x6f, 0xf8, 0xea, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, - 0x01, 0xe0, 0x44, 0xea, 0x02, 0x00, 0x00, -} diff --git a/go/internal/group/log_entry_secret.pb.go b/go/internal/group/log_entry_secret.pb.go deleted file mode 100644 index 9ec043d778..0000000000 --- a/go/internal/group/log_entry_secret.pb.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: go-internal/log_entry_secret.proto - -package group - -import ( - fmt "fmt" - math "math" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SecretEntryEnvelope struct { - EncryptedSecretPayload []byte `protobuf:"bytes,1,opt,name=encrypted_secret_payload,json=encryptedSecretPayload,proto3" json:"encrypted_secret_payload,omitempty"` - SecretPayloadSignature []byte `protobuf:"bytes,2,opt,name=secret_payload_signature,json=secretPayloadSignature,proto3" json:"secret_payload_signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecretEntryEnvelope) Reset() { *m = SecretEntryEnvelope{} } -func (m *SecretEntryEnvelope) String() string { return proto.CompactTextString(m) } -func (*SecretEntryEnvelope) ProtoMessage() {} -func (*SecretEntryEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_5e1711af9e257970, []int{0} -} -func (m *SecretEntryEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecretEntryEnvelope.Unmarshal(m, b) -} -func (m *SecretEntryEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecretEntryEnvelope.Marshal(b, m, deterministic) -} -func (m *SecretEntryEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecretEntryEnvelope.Merge(m, src) -} -func (m *SecretEntryEnvelope) XXX_Size() int { - return xxx_messageInfo_SecretEntryEnvelope.Size(m) -} -func (m *SecretEntryEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_SecretEntryEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_SecretEntryEnvelope proto.InternalMessageInfo - -func (m *SecretEntryEnvelope) GetEncryptedSecretPayload() []byte { - if m != nil { - return m.EncryptedSecretPayload - } - return nil -} - -func (m *SecretEntryEnvelope) GetSecretPayloadSignature() []byte { - if m != nil { - return m.SecretPayloadSignature - } - return nil -} - -type SecretEntryPayload struct { - DestMemberPubKey []byte `protobuf:"bytes,1,opt,name=dest_member_pub_key,json=destMemberPubKey,proto3" json:"dest_member_pub_key,omitempty"` - SenderDevicePubKey []byte `protobuf:"bytes,2,opt,name=sender_device_pub_key,json=senderDevicePubKey,proto3" json:"sender_device_pub_key,omitempty"` - EncryptedDeviceSecret []byte `protobuf:"bytes,3,opt,name=encrypted_device_secret,json=encryptedDeviceSecret,proto3" json:"encrypted_device_secret,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecretEntryPayload) Reset() { *m = SecretEntryPayload{} } -func (m *SecretEntryPayload) String() string { return proto.CompactTextString(m) } -func (*SecretEntryPayload) ProtoMessage() {} -func (*SecretEntryPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_5e1711af9e257970, []int{1} -} -func (m *SecretEntryPayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecretEntryPayload.Unmarshal(m, b) -} -func (m *SecretEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecretEntryPayload.Marshal(b, m, deterministic) -} -func (m *SecretEntryPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecretEntryPayload.Merge(m, src) -} -func (m *SecretEntryPayload) XXX_Size() int { - return xxx_messageInfo_SecretEntryPayload.Size(m) -} -func (m *SecretEntryPayload) XXX_DiscardUnknown() { - xxx_messageInfo_SecretEntryPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_SecretEntryPayload proto.InternalMessageInfo - -func (m *SecretEntryPayload) GetDestMemberPubKey() []byte { - if m != nil { - return m.DestMemberPubKey - } - return nil -} - -func (m *SecretEntryPayload) GetSenderDevicePubKey() []byte { - if m != nil { - return m.SenderDevicePubKey - } - return nil -} - -func (m *SecretEntryPayload) GetEncryptedDeviceSecret() []byte { - if m != nil { - return m.EncryptedDeviceSecret - } - return nil -} - -type DeviceSecret struct { - DerivationState []byte `protobuf:"bytes,1,opt,name=derivation_state,json=derivationState,proto3" json:"derivation_state,omitempty"` - Counter uint64 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeviceSecret) Reset() { *m = DeviceSecret{} } -func (m *DeviceSecret) String() string { return proto.CompactTextString(m) } -func (*DeviceSecret) ProtoMessage() {} -func (*DeviceSecret) Descriptor() ([]byte, []int) { - return fileDescriptor_5e1711af9e257970, []int{2} -} -func (m *DeviceSecret) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeviceSecret.Unmarshal(m, b) -} -func (m *DeviceSecret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeviceSecret.Marshal(b, m, deterministic) -} -func (m *DeviceSecret) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeviceSecret.Merge(m, src) -} -func (m *DeviceSecret) XXX_Size() int { - return xxx_messageInfo_DeviceSecret.Size(m) -} -func (m *DeviceSecret) XXX_DiscardUnknown() { - xxx_messageInfo_DeviceSecret.DiscardUnknown(m) -} - -var xxx_messageInfo_DeviceSecret proto.InternalMessageInfo - -func (m *DeviceSecret) GetDerivationState() []byte { - if m != nil { - return m.DerivationState - } - return nil -} - -func (m *DeviceSecret) GetCounter() uint64 { - if m != nil { - return m.Counter - } - return 0 -} - -func init() { - proto.RegisterType((*SecretEntryEnvelope)(nil), "SecretEntryEnvelope") - proto.RegisterType((*SecretEntryPayload)(nil), "SecretEntryPayload") - proto.RegisterType((*DeviceSecret)(nil), "DeviceSecret") -} - -func init() { proto.RegisterFile("go-internal/log_entry_secret.proto", fileDescriptor_5e1711af9e257970) } - -var fileDescriptor_5e1711af9e257970 = []byte{ - // 293 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0x41, 0x4b, 0xc3, 0x30, - 0x14, 0xc7, 0xa9, 0x8a, 0x42, 0x18, 0x38, 0x32, 0xa6, 0x3d, 0x88, 0x48, 0x4f, 0x7a, 0xd8, 0x86, - 0x08, 0xe2, 0x59, 0xdc, 0x49, 0x84, 0xb1, 0xde, 0xbc, 0x84, 0xb4, 0x79, 0xd4, 0x62, 0x97, 0x84, - 0x97, 0xd7, 0x41, 0x3e, 0x82, 0x5f, 0xc6, 0xcf, 0x28, 0x4d, 0xba, 0xae, 0x1e, 0xdf, 0xfb, 0xe5, - 0x97, 0xfc, 0xc3, 0x9f, 0x65, 0x95, 0x59, 0xd4, 0x9a, 0x00, 0xb5, 0x6c, 0x56, 0x8d, 0xa9, 0x04, - 0x68, 0x42, 0x2f, 0x1c, 0x94, 0x08, 0xb4, 0xb4, 0x68, 0xc8, 0x64, 0x3f, 0x09, 0x9b, 0xe5, 0x61, - 0xb1, 0xee, 0xe0, 0x5a, 0xef, 0xa1, 0x31, 0x16, 0xf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0xc1, - 0x02, 0xde, 0x01, 0x00, 0x00, -} diff --git a/go/internal/group/log_entry_setting.pb.go b/go/internal/group/log_entry_setting.pb.go deleted file mode 100644 index eecf156060..0000000000 --- a/go/internal/group/log_entry_setting.pb.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: go-internal/log_entry_setting.proto - -package group - -import ( - fmt "fmt" - math "math" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SettingsEntryPayload_PayloadType int32 - -const ( - SettingsEntryPayload_PayloadTypeUnknown SettingsEntryPayload_PayloadType = 0 - SettingsEntryPayload_PayloadTypeGroupSetting SettingsEntryPayload_PayloadType = 1 - SettingsEntryPayload_PayloadTypeMemberSetting SettingsEntryPayload_PayloadType = 2 -) - -var SettingsEntryPayload_PayloadType_name = map[int32]string{ - 0: "PayloadTypeUnknown", - 1: "PayloadTypeGroupSetting", - 2: "PayloadTypeMemberSetting", -} - -var SettingsEntryPayload_PayloadType_value = map[string]int32{ - "PayloadTypeUnknown": 0, - "PayloadTypeGroupSetting": 1, - "PayloadTypeMemberSetting": 2, -} - -func (x SettingsEntryPayload_PayloadType) String() string { - return proto.EnumName(SettingsEntryPayload_PayloadType_name, int32(x)) -} - -func (SettingsEntryPayload_PayloadType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f48654281ae787cf, []int{1, 0} -} - -type SettingsEntryEnvelope struct { - EncryptedSettingsPayload []byte `protobuf:"bytes,1,opt,name=encrypted_settings_payload,json=encryptedSettingsPayload,proto3" json:"encrypted_settings_payload,omitempty"` - SettingsPayloadSignature []byte `protobuf:"bytes,2,opt,name=settings_payload_signature,json=settingsPayloadSignature,proto3" json:"settings_payload_signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SettingsEntryEnvelope) Reset() { *m = SettingsEntryEnvelope{} } -func (m *SettingsEntryEnvelope) String() string { return proto.CompactTextString(m) } -func (*SettingsEntryEnvelope) ProtoMessage() {} -func (*SettingsEntryEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_f48654281ae787cf, []int{0} -} -func (m *SettingsEntryEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SettingsEntryEnvelope.Unmarshal(m, b) -} -func (m *SettingsEntryEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SettingsEntryEnvelope.Marshal(b, m, deterministic) -} -func (m *SettingsEntryEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_SettingsEntryEnvelope.Merge(m, src) -} -func (m *SettingsEntryEnvelope) XXX_Size() int { - return xxx_messageInfo_SettingsEntryEnvelope.Size(m) -} -func (m *SettingsEntryEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_SettingsEntryEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_SettingsEntryEnvelope proto.InternalMessageInfo - -func (m *SettingsEntryEnvelope) GetEncryptedSettingsPayload() []byte { - if m != nil { - return m.EncryptedSettingsPayload - } - return nil -} - -func (m *SettingsEntryEnvelope) GetSettingsPayloadSignature() []byte { - if m != nil { - return m.SettingsPayloadSignature - } - return nil -} - -type SettingsEntryPayload struct { - Type SettingsEntryPayload_PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=SettingsEntryPayload_PayloadType" json:"type,omitempty"` - MemberPubKey []byte `protobuf:"bytes,2,opt,name=member_pub_key,json=memberPubKey,proto3" json:"member_pub_key,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SettingsEntryPayload) Reset() { *m = SettingsEntryPayload{} } -func (m *SettingsEntryPayload) String() string { return proto.CompactTextString(m) } -func (*SettingsEntryPayload) ProtoMessage() {} -func (*SettingsEntryPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_f48654281ae787cf, []int{1} -} -func (m *SettingsEntryPayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SettingsEntryPayload.Unmarshal(m, b) -} -func (m *SettingsEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SettingsEntryPayload.Marshal(b, m, deterministic) -} -func (m *SettingsEntryPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_SettingsEntryPayload.Merge(m, src) -} -func (m *SettingsEntryPayload) XXX_Size() int { - return xxx_messageInfo_SettingsEntryPayload.Size(m) -} -func (m *SettingsEntryPayload) XXX_DiscardUnknown() { - xxx_messageInfo_SettingsEntryPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_SettingsEntryPayload proto.InternalMessageInfo - -func (m *SettingsEntryPayload) GetType() SettingsEntryPayload_PayloadType { - if m != nil { - return m.Type - } - return SettingsEntryPayload_PayloadTypeUnknown -} - -func (m *SettingsEntryPayload) GetMemberPubKey() []byte { - if m != nil { - return m.MemberPubKey - } - return nil -} - -func (m *SettingsEntryPayload) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *SettingsEntryPayload) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func init() { - proto.RegisterEnum("SettingsEntryPayload_PayloadType", SettingsEntryPayload_PayloadType_name, SettingsEntryPayload_PayloadType_value) - proto.RegisterType((*SettingsEntryEnvelope)(nil), "SettingsEntryEnvelope") - proto.RegisterType((*SettingsEntryPayload)(nil), "SettingsEntryPayload") -} - -func init() { - proto.RegisterFile("go-internal/log_entry_setting.proto", fileDescriptor_f48654281ae787cf) -} - -var fileDescriptor_f48654281ae787cf = []byte{ - // 300 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xc1, 0x4b, 0xc3, 0x30, - 0x14, 0xc6, 0xed, 0x36, 0x3d, 0x3c, 0xc7, 0x28, 0x61, 0x6a, 0xd1, 0x21, 0x5a, 0x3d, 0x78, 0xb1, - 0x05, 0xc5, 0x9b, 0x27, 0x61, 0x78, 0x10, 0x61, 0x6c, 0x7a, 0xf1, 0x12, 0xdb, 0xed, 0x11, 0xcb, - 0xba, 0x24, 0xa4, 0xe9, 0x24, 0x7f, 0x87, 0x7f, 0xaf, 0x20, 0x4d, 0x9b, 0xd1, 0xc9, 0x4e, 0xc9, - 0xfb, 0x7e, 0xef, 0x7b, 0xef, 0x83, 0x07, 0x57, 0x4c, 0xdc, 0x66, 0x5c, 0xa3, 0xe2, 0x49, 0x1e, - 0xe7, 0x82, 0x51, 0xe4, 0x5a, 0x19, 0x5a, 0xa0, 0xd6, 0x19, 0x67, 0x91, 0x54, 0x42, 0x8b, 0xf0, - 0xc7, 0x83, 0xa3, 0x59, 0xad, 0x14, 0xe3, 0x8a, 0x8f, 0xf9, 0x1a, 0x73, 0x21, 0x91, 0x3c, 0xc2, - 0x29, 0xf2, 0xb9, 0x32, 0x52, 0xe3, 0xc2, 0x99, 0x0a, 0x2a, 0x13, 0x93, 0x8b, 0x64, 0x11, 0x78, - 0x17, 0xde, 0x4d, 0x7f, 0x1a, 0x6c, 0x3a, 0xdc, 0x8c, 0x49, 0xcd, 0x2b, 0xf7, 0x7f, 0x0f, 0x2d, - 0x32, 0xc6, 0x13, 0x5d, 0x2a, 0x0c, 0x3a, 0xb5, 0xbb, 0xd8, 0x36, 0xcd, 0x1c, 0x0f, 0x7f, 0x3d, - 0x18, 0x6e, 0xa5, 0x72, 0x63, 0x1f, 0xa0, 0xa7, 0x8d, 0x44, 0xbb, 0x7e, 0x70, 0x77, 0x19, 0xed, - 0x6a, 0x8a, 0x9a, 0xf7, 0xcd, 0x48, 0x9c, 0xda, 0x76, 0x72, 0x0d, 0x83, 0x15, 0xae, 0x52, 0x54, - 0x54, 0x96, 0x29, 0x5d, 0xa2, 0x69, 0x12, 0xf4, 0x6b, 0x75, 0x52, 0xa6, 0x2f, 0x68, 0x88, 0x0f, - 0xdd, 0x0a, 0x75, 0x2d, 0xaa, 0xbe, 0x64, 0x08, 0xfb, 0xeb, 0x24, 0x2f, 0x31, 0xe8, 0x59, 0xad, - 0x2e, 0xc2, 0x4f, 0x38, 0x6c, 0xad, 0x20, 0xc7, 0x40, 0x5a, 0xe5, 0x3b, 0x5f, 0x72, 0xf1, 0xcd, - 0xfd, 0x3d, 0x72, 0x06, 0x27, 0x2d, 0xfd, 0x59, 0x89, 0x52, 0x36, 0x71, 0x7d, 0x8f, 0x8c, 0x20, - 0x68, 0xc1, 0x57, 0x1b, 0xc3, 0xd1, 0xce, 0xd3, 0xf9, 0xc7, 0x28, 0x45, 0xa5, 0x4d, 0xa4, 0x71, - 0xfe, 0x15, 0x33, 0x11, 0x6f, 0xee, 0xc8, 0xaa, 0x31, 0xe9, 0x81, 0x3d, 0xde, 0xfd, 0x5f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x9b, 0x33, 0x20, 0x10, 0xe3, 0x01, 0x00, 0x00, -} diff --git a/go/internal/group/member_entry_payload.go b/go/internal/group/member_entry_payload.go new file mode 100644 index 0000000000..6a367e6ad8 --- /dev/null +++ b/go/internal/group/member_entry_payload.go @@ -0,0 +1,120 @@ +package group + +import ( + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p-core/crypto" +) + +// CheckStructure checks signatures of the MemberEntryPayload +func (m *MemberEntryPayload) CheckStructure() error { + inviterPubKey, err := crypto.UnmarshalEd25519PublicKey(m.InviterDevicePubKey) + if err != nil { + return errcode.TODO.Wrap(err) + } + + ok, err := inviterPubKey.Verify(m.InvitationPubKey, m.InvitationPubKeySignature) + if err != nil { + return errcode.TODO.Wrap(err) + } + + if !ok { + return errcode.ErrGroupMemberLogEventSignature + } + + invitationPubKey, err := crypto.UnmarshalEd25519PublicKey(m.InvitationPubKey) + if err != nil { + return errcode.TODO.Wrap(err) + } + + ok, err = invitationPubKey.Verify(m.MemberPubKey, m.MemberPubKeySignature) + if err != nil { + return errcode.TODO.Wrap(err) + } + + if !ok { + return errcode.ErrGroupMemberLogEventSignature + } + + memberPubKey, err := crypto.UnmarshalEd25519PublicKey(m.MemberPubKey) + if err != nil { + return errcode.TODO.Wrap(err) + } + + ok, err = memberPubKey.Verify(m.MemberDevicePubKey, m.MemberDevicePubKeySignature) + if err != nil { + return errcode.TODO.Wrap(err) + } + + if !ok { + return errcode.ErrGroupMemberLogEventSignature + } + + return nil +} + +// ToMemberDevice converts a MemberEntryPayload to a MemberDevice object +func (m *MemberEntryPayload) ToMemberDevice() (*MemberDevice, error) { + member, err := crypto.UnmarshalEd25519PublicKey(m.MemberPubKey) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + device, err := crypto.UnmarshalEd25519PublicKey(m.MemberDevicePubKey) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return &MemberDevice{ + Device: device, + Member: member, + }, nil +} + +func (m *MemberEntryPayload) GetDevicePubKey() (crypto.PubKey, error) { + return crypto.UnmarshalEd25519PublicKey(m.MemberDevicePubKey) +} + +// NewMemberEntryPayload creates a new MemberEntryPayload entry using +// an invitation +func NewMemberEntryPayload(memberPrivateKey, memberDevicePrivateKey crypto.PrivKey, invitation *Invitation) (*MemberEntryPayload, error) { + memberPubKeyBytes, err := memberPrivateKey.GetPublic().Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + memberDevicePubKeyBytes, err := memberDevicePrivateKey.GetPublic().Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + invitationPrivateKey, err := invitation.GetInvitationPrivateKey() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + invitationPubKeyBytes, err := invitationPrivateKey.GetPublic().Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + memberPubKeySignature, err := invitationPrivateKey.Sign(memberPubKeyBytes) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + memberDevicePubKeySig, err := memberPrivateKey.Sign(memberDevicePubKeyBytes) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return &MemberEntryPayload{ + MemberPubKey: memberPubKeyBytes, + MemberPubKeySignature: memberPubKeySignature, + MemberDevicePubKey: memberDevicePubKeyBytes, + MemberDevicePubKeySignature: memberDevicePubKeySig, + InviterDevicePubKey: invitation.InviterDevicePubKey, + InvitationPubKey: invitationPubKeyBytes, + InvitationPubKeySignature: invitation.InvitationPubKeySignature, + }, nil +} + +var _ ClearPayload = (*MemberEntryPayload)(nil) diff --git a/go/internal/group/store_entry.go b/go/internal/group/store_entry.go new file mode 100644 index 0000000000..67014952b5 --- /dev/null +++ b/go/internal/group/store_entry.go @@ -0,0 +1,97 @@ +package group + +import ( + "berty.tech/go/pkg/errcode" + "github.com/gogo/protobuf/proto" + "github.com/libp2p/go-libp2p-core/crypto" + "golang.org/x/crypto/nacl/secretbox" +) + +type ClearPayload interface { + proto.Marshaler + proto.Unmarshaler + + CheckStructure() error + GetDevicePubKey() (crypto.PubKey, error) +} + +// OpenStorePayload opens a symmetric encrypted group payload, type is defined +// by the "out" type +func OpenStorePayload(out ClearPayload, envelopeBytes []byte, g *Group) error { + sharedSecret, err := g.GetSharedSecret() + if err != nil { + return errcode.TODO.Wrap(err) + } + + env := &StoreEncryptedEntry{} + if err := env.Unmarshal(envelopeBytes); err != nil { + return errcode.ErrInvalidInput.Wrap(err) + } + + if len(env.Signature) < 24 { + return errcode.ErrInvalidInput + } + + var nonce [24]byte + copy(nonce[:], env.Signature[:24]) + + data, ok := secretbox.Open(nil, env.EncryptedPayload, &nonce, sharedSecret) + if !ok { + return errcode.ErrGroupMemberLogEventOpen + } + + err = out.Unmarshal(data) + if err != nil { + return errcode.TODO.Wrap(err) + } + + err = out.CheckStructure() + if err != nil { + return errcode.TODO.Wrap(err) + } + + signerPubKey, err := out.GetDevicePubKey() + if err != nil { + return errcode.TODO.Wrap(err) + } + + ok, err = signerPubKey.Verify(data, env.Signature) + if err != nil { + return errcode.TODO.Wrap(err) + } + + if !ok { + return errcode.ErrGroupMemberLogEventSignature + } + + return nil +} + +func SealStorePayload(payload proto.Marshaler, g *Group, devicePrivateKey crypto.PrivKey) ([]byte, error) { + payloadBytes, err := payload.Marshal() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + signature, err := devicePrivateKey.Sign(payloadBytes) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + var nonce [24]byte + copy(nonce[:], signature) + + sharedSecret, err := g.GetSharedSecret() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + data := secretbox.Seal(nil, payloadBytes, &nonce, sharedSecret) + + env := &StoreEncryptedEntry{ + EncryptedPayload: data, + Signature: signature, + } + + return env.Marshal() +} diff --git a/go/internal/group/store_entry.pb.go b/go/internal/group/store_entry.pb.go new file mode 100644 index 0000000000..ddc12aeb73 --- /dev/null +++ b/go/internal/group/store_entry.pb.go @@ -0,0 +1,2812 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: go-internal/store_entry.proto + +package group + +import ( + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MessageEntryPayload_PayloadType int32 + +const ( + MessageEntryPayload_PayloadTypeUnknown MessageEntryPayload_PayloadType = 0 + MessageEntryPayload_PayloadTypeMessage MessageEntryPayload_PayloadType = 1 + MessageEntryPayload_PayloadTypeInvitation MessageEntryPayload_PayloadType = 2 +) + +var MessageEntryPayload_PayloadType_name = map[int32]string{ + 0: "PayloadTypeUnknown", + 1: "PayloadTypeMessage", + 2: "PayloadTypeInvitation", +} + +var MessageEntryPayload_PayloadType_value = map[string]int32{ + "PayloadTypeUnknown": 0, + "PayloadTypeMessage": 1, + "PayloadTypeInvitation": 2, +} + +func (x MessageEntryPayload_PayloadType) String() string { + return proto.EnumName(MessageEntryPayload_PayloadType_name, int32(x)) +} + +func (MessageEntryPayload_PayloadType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{3, 0} +} + +type SettingsEntryPayload_PayloadType int32 + +const ( + SettingsEntryPayload_PayloadTypeUnknown SettingsEntryPayload_PayloadType = 0 + SettingsEntryPayload_PayloadTypeGroupSetting SettingsEntryPayload_PayloadType = 1 + SettingsEntryPayload_PayloadTypeMemberSetting SettingsEntryPayload_PayloadType = 2 +) + +var SettingsEntryPayload_PayloadType_name = map[int32]string{ + 0: "PayloadTypeUnknown", + 1: "PayloadTypeGroupSetting", + 2: "PayloadTypeMemberSetting", +} + +var SettingsEntryPayload_PayloadType_value = map[string]int32{ + "PayloadTypeUnknown": 0, + "PayloadTypeGroupSetting": 1, + "PayloadTypeMemberSetting": 2, +} + +func (x SettingsEntryPayload_PayloadType) String() string { + return proto.EnumName(SettingsEntryPayload_PayloadType_name, int32(x)) +} + +func (SettingsEntryPayload_PayloadType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{7, 0} +} + +type StoreEncryptedEntry struct { + EncryptedPayload []byte `protobuf:"bytes,1,opt,name=encrypted_payload,json=encryptedPayload,proto3" json:"encrypted_payload,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StoreEncryptedEntry) Reset() { *m = StoreEncryptedEntry{} } +func (m *StoreEncryptedEntry) String() string { return proto.CompactTextString(m) } +func (*StoreEncryptedEntry) ProtoMessage() {} +func (*StoreEncryptedEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{0} +} +func (m *StoreEncryptedEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StoreEncryptedEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StoreEncryptedEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StoreEncryptedEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_StoreEncryptedEntry.Merge(m, src) +} +func (m *StoreEncryptedEntry) XXX_Size() int { + return m.Size() +} +func (m *StoreEncryptedEntry) XXX_DiscardUnknown() { + xxx_messageInfo_StoreEncryptedEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_StoreEncryptedEntry proto.InternalMessageInfo + +func (m *StoreEncryptedEntry) GetEncryptedPayload() []byte { + if m != nil { + return m.EncryptedPayload + } + return nil +} + +func (m *StoreEncryptedEntry) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type MemberEntryPayload struct { + MemberPubKey []byte `protobuf:"bytes,1,opt,name=member_pub_key,json=memberPubKey,proto3" json:"member_pub_key,omitempty"` + MemberPubKeySignature []byte `protobuf:"bytes,2,opt,name=member_pub_key_signature,json=memberPubKeySignature,proto3" json:"member_pub_key_signature,omitempty"` + MemberDevicePubKey []byte `protobuf:"bytes,3,opt,name=member_device_pub_key,json=memberDevicePubKey,proto3" json:"member_device_pub_key,omitempty"` + MemberDevicePubKeySignature []byte `protobuf:"bytes,4,opt,name=member_device_pub_key_signature,json=memberDevicePubKeySignature,proto3" json:"member_device_pub_key_signature,omitempty"` + InviterDevicePubKey []byte `protobuf:"bytes,5,opt,name=inviter_device_pub_key,json=inviterDevicePubKey,proto3" json:"inviter_device_pub_key,omitempty"` + InvitationPubKey []byte `protobuf:"bytes,6,opt,name=invitation_pub_key,json=invitationPubKey,proto3" json:"invitation_pub_key,omitempty"` + InvitationPubKeySignature []byte `protobuf:"bytes,7,opt,name=invitation_pub_key_signature,json=invitationPubKeySignature,proto3" json:"invitation_pub_key_signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberEntryPayload) Reset() { *m = MemberEntryPayload{} } +func (m *MemberEntryPayload) String() string { return proto.CompactTextString(m) } +func (*MemberEntryPayload) ProtoMessage() {} +func (*MemberEntryPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{1} +} +func (m *MemberEntryPayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberEntryPayload.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberEntryPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberEntryPayload.Merge(m, src) +} +func (m *MemberEntryPayload) XXX_Size() int { + return m.Size() +} +func (m *MemberEntryPayload) XXX_DiscardUnknown() { + xxx_messageInfo_MemberEntryPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberEntryPayload proto.InternalMessageInfo + +func (m *MemberEntryPayload) GetMemberPubKey() []byte { + if m != nil { + return m.MemberPubKey + } + return nil +} + +func (m *MemberEntryPayload) GetMemberPubKeySignature() []byte { + if m != nil { + return m.MemberPubKeySignature + } + return nil +} + +func (m *MemberEntryPayload) GetMemberDevicePubKey() []byte { + if m != nil { + return m.MemberDevicePubKey + } + return nil +} + +func (m *MemberEntryPayload) GetMemberDevicePubKeySignature() []byte { + if m != nil { + return m.MemberDevicePubKeySignature + } + return nil +} + +func (m *MemberEntryPayload) GetInviterDevicePubKey() []byte { + if m != nil { + return m.InviterDevicePubKey + } + return nil +} + +func (m *MemberEntryPayload) GetInvitationPubKey() []byte { + if m != nil { + return m.InvitationPubKey + } + return nil +} + +func (m *MemberEntryPayload) GetInvitationPubKeySignature() []byte { + if m != nil { + return m.InvitationPubKeySignature + } + return nil +} + +type MessageEntryEnvelope struct { + Counter uint64 `protobuf:"varint,1,opt,name=counter,proto3" json:"counter,omitempty"` + EncryptedPayload []byte `protobuf:"bytes,2,opt,name=encrypted_payload,json=encryptedPayload,proto3" json:"encrypted_payload,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageEntryEnvelope) Reset() { *m = MessageEntryEnvelope{} } +func (m *MessageEntryEnvelope) String() string { return proto.CompactTextString(m) } +func (*MessageEntryEnvelope) ProtoMessage() {} +func (*MessageEntryEnvelope) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{2} +} +func (m *MessageEntryEnvelope) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MessageEntryEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MessageEntryEnvelope.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MessageEntryEnvelope) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageEntryEnvelope.Merge(m, src) +} +func (m *MessageEntryEnvelope) XXX_Size() int { + return m.Size() +} +func (m *MessageEntryEnvelope) XXX_DiscardUnknown() { + xxx_messageInfo_MessageEntryEnvelope.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageEntryEnvelope proto.InternalMessageInfo + +func (m *MessageEntryEnvelope) GetCounter() uint64 { + if m != nil { + return m.Counter + } + return 0 +} + +func (m *MessageEntryEnvelope) GetEncryptedPayload() []byte { + if m != nil { + return m.EncryptedPayload + } + return nil +} + +func (m *MessageEntryEnvelope) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type MessageEntryPayload struct { + Type MessageEntryPayload_PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=berty.group.MessageEntryPayload_PayloadType" json:"type,omitempty"` + MessageBody []byte `protobuf:"bytes,2,opt,name=message_body,json=messageBody,proto3" json:"message_body,omitempty"` + Invitation *Invitation `protobuf:"bytes,3,opt,name=invitation,proto3" json:"invitation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageEntryPayload) Reset() { *m = MessageEntryPayload{} } +func (m *MessageEntryPayload) String() string { return proto.CompactTextString(m) } +func (*MessageEntryPayload) ProtoMessage() {} +func (*MessageEntryPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{3} +} +func (m *MessageEntryPayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MessageEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MessageEntryPayload.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MessageEntryPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageEntryPayload.Merge(m, src) +} +func (m *MessageEntryPayload) XXX_Size() int { + return m.Size() +} +func (m *MessageEntryPayload) XXX_DiscardUnknown() { + xxx_messageInfo_MessageEntryPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageEntryPayload proto.InternalMessageInfo + +func (m *MessageEntryPayload) GetType() MessageEntryPayload_PayloadType { + if m != nil { + return m.Type + } + return MessageEntryPayload_PayloadTypeUnknown +} + +func (m *MessageEntryPayload) GetMessageBody() []byte { + if m != nil { + return m.MessageBody + } + return nil +} + +func (m *MessageEntryPayload) GetInvitation() *Invitation { + if m != nil { + return m.Invitation + } + return nil +} + +type Invitation struct { + InviterDevicePubKey []byte `protobuf:"bytes,1,opt,name=inviter_device_pub_key,json=inviterDevicePubKey,proto3" json:"inviter_device_pub_key,omitempty"` + InvitationPrivKey []byte `protobuf:"bytes,2,opt,name=invitation_priv_key,json=invitationPrivKey,proto3" json:"invitation_priv_key,omitempty"` + InvitationPubKeySignature []byte `protobuf:"bytes,3,opt,name=invitation_pub_key_signature,json=invitationPubKeySignature,proto3" json:"invitation_pub_key_signature,omitempty"` + GroupVersion uint32 `protobuf:"varint,4,opt,name=group_version,json=groupVersion,proto3" json:"group_version,omitempty"` + GroupPubKey []byte `protobuf:"bytes,5,opt,name=group_pub_key,json=groupPubKey,proto3" json:"group_pub_key,omitempty"` + GroupSigningKey []byte `protobuf:"bytes,6,opt,name=group_signing_key,json=groupSigningKey,proto3" json:"group_signing_key,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Invitation) Reset() { *m = Invitation{} } +func (m *Invitation) String() string { return proto.CompactTextString(m) } +func (*Invitation) ProtoMessage() {} +func (*Invitation) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{4} +} +func (m *Invitation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Invitation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Invitation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Invitation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Invitation.Merge(m, src) +} +func (m *Invitation) XXX_Size() int { + return m.Size() +} +func (m *Invitation) XXX_DiscardUnknown() { + xxx_messageInfo_Invitation.DiscardUnknown(m) +} + +var xxx_messageInfo_Invitation proto.InternalMessageInfo + +func (m *Invitation) GetInviterDevicePubKey() []byte { + if m != nil { + return m.InviterDevicePubKey + } + return nil +} + +func (m *Invitation) GetInvitationPrivKey() []byte { + if m != nil { + return m.InvitationPrivKey + } + return nil +} + +func (m *Invitation) GetInvitationPubKeySignature() []byte { + if m != nil { + return m.InvitationPubKeySignature + } + return nil +} + +func (m *Invitation) GetGroupVersion() uint32 { + if m != nil { + return m.GroupVersion + } + return 0 +} + +func (m *Invitation) GetGroupPubKey() []byte { + if m != nil { + return m.GroupPubKey + } + return nil +} + +func (m *Invitation) GetGroupSigningKey() []byte { + if m != nil { + return m.GroupSigningKey + } + return nil +} + +type SecretEntryPayload struct { + DestMemberPubKey []byte `protobuf:"bytes,1,opt,name=dest_member_pub_key,json=destMemberPubKey,proto3" json:"dest_member_pub_key,omitempty"` + SenderDevicePubKey []byte `protobuf:"bytes,2,opt,name=sender_device_pub_key,json=senderDevicePubKey,proto3" json:"sender_device_pub_key,omitempty"` + EncryptedDeviceSecret []byte `protobuf:"bytes,3,opt,name=encrypted_device_secret,json=encryptedDeviceSecret,proto3" json:"encrypted_device_secret,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SecretEntryPayload) Reset() { *m = SecretEntryPayload{} } +func (m *SecretEntryPayload) String() string { return proto.CompactTextString(m) } +func (*SecretEntryPayload) ProtoMessage() {} +func (*SecretEntryPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{5} +} +func (m *SecretEntryPayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SecretEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SecretEntryPayload.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SecretEntryPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecretEntryPayload.Merge(m, src) +} +func (m *SecretEntryPayload) XXX_Size() int { + return m.Size() +} +func (m *SecretEntryPayload) XXX_DiscardUnknown() { + xxx_messageInfo_SecretEntryPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_SecretEntryPayload proto.InternalMessageInfo + +func (m *SecretEntryPayload) GetDestMemberPubKey() []byte { + if m != nil { + return m.DestMemberPubKey + } + return nil +} + +func (m *SecretEntryPayload) GetSenderDevicePubKey() []byte { + if m != nil { + return m.SenderDevicePubKey + } + return nil +} + +func (m *SecretEntryPayload) GetEncryptedDeviceSecret() []byte { + if m != nil { + return m.EncryptedDeviceSecret + } + return nil +} + +type DeviceSecret struct { + DerivationState []byte `protobuf:"bytes,1,opt,name=derivation_state,json=derivationState,proto3" json:"derivation_state,omitempty"` + Counter uint64 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeviceSecret) Reset() { *m = DeviceSecret{} } +func (m *DeviceSecret) String() string { return proto.CompactTextString(m) } +func (*DeviceSecret) ProtoMessage() {} +func (*DeviceSecret) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{6} +} +func (m *DeviceSecret) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceSecret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeviceSecret.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeviceSecret) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceSecret.Merge(m, src) +} +func (m *DeviceSecret) XXX_Size() int { + return m.Size() +} +func (m *DeviceSecret) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceSecret.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceSecret proto.InternalMessageInfo + +func (m *DeviceSecret) GetDerivationState() []byte { + if m != nil { + return m.DerivationState + } + return nil +} + +func (m *DeviceSecret) GetCounter() uint64 { + if m != nil { + return m.Counter + } + return 0 +} + +type SettingsEntryPayload struct { + Type SettingsEntryPayload_PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=berty.group.SettingsEntryPayload_PayloadType" json:"type,omitempty"` + MemberPubKey []byte `protobuf:"bytes,2,opt,name=member_pub_key,json=memberPubKey,proto3" json:"member_pub_key,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SettingsEntryPayload) Reset() { *m = SettingsEntryPayload{} } +func (m *SettingsEntryPayload) String() string { return proto.CompactTextString(m) } +func (*SettingsEntryPayload) ProtoMessage() {} +func (*SettingsEntryPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_588070fb2e1cba7f, []int{7} +} +func (m *SettingsEntryPayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SettingsEntryPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SettingsEntryPayload.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SettingsEntryPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_SettingsEntryPayload.Merge(m, src) +} +func (m *SettingsEntryPayload) XXX_Size() int { + return m.Size() +} +func (m *SettingsEntryPayload) XXX_DiscardUnknown() { + xxx_messageInfo_SettingsEntryPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_SettingsEntryPayload proto.InternalMessageInfo + +func (m *SettingsEntryPayload) GetType() SettingsEntryPayload_PayloadType { + if m != nil { + return m.Type + } + return SettingsEntryPayload_PayloadTypeUnknown +} + +func (m *SettingsEntryPayload) GetMemberPubKey() []byte { + if m != nil { + return m.MemberPubKey + } + return nil +} + +func (m *SettingsEntryPayload) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *SettingsEntryPayload) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func init() { + proto.RegisterEnum("berty.group.MessageEntryPayload_PayloadType", MessageEntryPayload_PayloadType_name, MessageEntryPayload_PayloadType_value) + proto.RegisterEnum("berty.group.SettingsEntryPayload_PayloadType", SettingsEntryPayload_PayloadType_name, SettingsEntryPayload_PayloadType_value) + proto.RegisterType((*StoreEncryptedEntry)(nil), "berty.group.StoreEncryptedEntry") + proto.RegisterType((*MemberEntryPayload)(nil), "berty.group.MemberEntryPayload") + proto.RegisterType((*MessageEntryEnvelope)(nil), "berty.group.MessageEntryEnvelope") + proto.RegisterType((*MessageEntryPayload)(nil), "berty.group.MessageEntryPayload") + proto.RegisterType((*Invitation)(nil), "berty.group.Invitation") + proto.RegisterType((*SecretEntryPayload)(nil), "berty.group.SecretEntryPayload") + proto.RegisterType((*DeviceSecret)(nil), "berty.group.DeviceSecret") + proto.RegisterType((*SettingsEntryPayload)(nil), "berty.group.SettingsEntryPayload") +} + +func init() { proto.RegisterFile("go-internal/store_entry.proto", fileDescriptor_588070fb2e1cba7f) } + +var fileDescriptor_588070fb2e1cba7f = []byte{ + // 737 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xdd, 0x6e, 0xd3, 0x4a, + 0x10, 0x3e, 0x76, 0xfa, 0xa3, 0x33, 0x49, 0x5b, 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 0x01, 0x67, 0x92, 0x3b, 0xd0, 0x98, 0x88, 0x44, 0xc3, 0xa2, 0x76, + 0x92, 0xd5, 0x57, 0xcf, 0xb0, 0x63, 0x6a, 0xa7, 0x7e, 0x82, 0xa2, 0x2d, 0xbc, 0xb6, 0xfa, 0xe1, + 0x56, 0x49, 0xea, 0xc5, 0x34, 0x3c, 0x90, 0x52, 0xf5, 0x37, 0x50, 0x97, 0x04, 0xc9, 0x26, 0x10, + 0xe9, 0xf8, 0xca, 0xbb, 0xf6, 0xe8, 0x7b, 0x4f, 0xfb, 0x6b, 0x06, 0xcf, 0xca, 0xd6, 0x14, 0xb2, + 0x0d, 0x2d, 0x09, 0x2f, 0x34, 0x34, 0x55, 0xff, 0xa2, 0x02, 0x14, 0xc0, 0x6f, 0xfc, 0xa3, 0xfc, + 0xda, 0x3f, 0x3d, 0x68, 0xca, 0x8e, 0x08, 0xdc, 0x98, 0x33, 0x44, 0x03, 0xd6, 0x25, 0x23, 0x04, + 0x6e, 0x7c, 0x1b, 0x07, 0xd5, 0xfe, 0xe0, 0x20, 0x72, 0x17, 0x56, 0x78, 0xbb, 0x8c, 0x18, 0x83, + 0x30, 0x6d, 0x65, 0x3a, 0x19, 0x2b, 0x83, 0x06, 0x07, 0x5f, 0x0b, 0x8c, 0xe8, 0x79, 0x52, 0x79, + 0x02, 0xea, 0x1c, 0xcc, 0x2a, 0xdf, 0x83, 0x75, 0x91, 0x93, 0x8a, 0xbb, 0x9e, 0x23, 0x19, 0x7f, + 0x8d, 0x07, 0x86, 0x02, 0x3f, 0xc3, 0x44, 0xff, 0xaa, 0x00, 0x19, 0xe2, 0x28, 0x40, 0x56, 0x32, + 0x4e, 0x17, 0x9a, 0x36, 0x86, 0xcc, 0xa8, 0x5c, 0x27, 0x5a, 0x1a, 0x3a, 0x97, 0x57, 0xca, 0x01, + 0xb4, 0x42, 0xf4, 0xec, 0xf9, 0xfe, 0x8a, 0x6e, 0x11, 0x11, 0x2c, 0xb5, 0xf7, 0x11, 0x6c, 0x15, + 0xee, 0xcf, 0x58, 0x21, 0x2f, 0x24, 0xeb, 0x54, 0x6b, 0x1a, 0x16, 0x3c, 0x51, 0xa5, 0x3e, 0x84, + 0x86, 0x7c, 0x26, 0x0f, 0x40, 0xb3, 0x31, 0x70, 0x63, 0xd1, 0xf6, 0x90, 0x99, 0x0c, 0xb3, 0x32, + 0xd7, 0x0a, 0x7c, 0x98, 0xc2, 0xf2, 0x28, 0xaa, 0xa5, 0x51, 0xd4, 0x3f, 0xaa, 0xb0, 0x31, 0x44, + 0xc6, 0x5c, 0xcf, 0x09, 0x4b, 0x7d, 0x78, 0x56, 0x1a, 0xa0, 0x6e, 0xc9, 0xd5, 0x55, 0x84, 0x8a, + 0x09, 0x9a, 0x5f, 0xca, 0x6a, 0xc5, 0x52, 0xd6, 0xa0, 0x56, 0x6c, 0xd2, 0xf4, 0x91, 0x6c, 0xc0, + 0x62, 0x6c, 0x8e, 0xa3, 0x7c, 0x41, 0x8a, 0x83, 0x7e, 0x79, 0xbb, 0x99, 0xd9, 0x81, 0x2d, 0x09, + 0x7f, 0xce, 0x5f, 0xba, 0x28, 0x57, 0x53, 0x48, 0x07, 0xda, 0xa5, 0x81, 0x4a, 0xcb, 0xc8, 0xa3, + 0xea, 0xf1, 0xde, 0xb7, 0x9b, 0x5d, 0xe5, 0xfb, 0xcd, 0xae, 0xf2, 0xe3, 0x66, 0x57, 0x79, 0xdb, + 0x11, 0xff, 0x98, 0xe1, 0xe8, 0xaa, 0xef, 0xd0, 0xfe, 0xf4, 0x8b, 0xc9, 0x5b, 0x60, 0x2d, 0xf1, + 0x0f, 0xde, 0xd1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x77, 0xc6, 0x11, 0x60, 0x4d, 0x07, 0x00, + 0x00, +} + +func (m *StoreEncryptedEntry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreEncryptedEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreEncryptedEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(m.EncryptedPayload) > 0 { + i -= len(m.EncryptedPayload) + copy(dAtA[i:], m.EncryptedPayload) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.EncryptedPayload))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MemberEntryPayload) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MemberEntryPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberEntryPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.InvitationPubKeySignature) > 0 { + i -= len(m.InvitationPubKeySignature) + copy(dAtA[i:], m.InvitationPubKeySignature) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.InvitationPubKeySignature))) + i-- + dAtA[i] = 0x3a + } + if len(m.InvitationPubKey) > 0 { + i -= len(m.InvitationPubKey) + copy(dAtA[i:], m.InvitationPubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.InvitationPubKey))) + i-- + dAtA[i] = 0x32 + } + if len(m.InviterDevicePubKey) > 0 { + i -= len(m.InviterDevicePubKey) + copy(dAtA[i:], m.InviterDevicePubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.InviterDevicePubKey))) + i-- + dAtA[i] = 0x2a + } + if len(m.MemberDevicePubKeySignature) > 0 { + i -= len(m.MemberDevicePubKeySignature) + copy(dAtA[i:], m.MemberDevicePubKeySignature) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.MemberDevicePubKeySignature))) + i-- + dAtA[i] = 0x22 + } + if len(m.MemberDevicePubKey) > 0 { + i -= len(m.MemberDevicePubKey) + copy(dAtA[i:], m.MemberDevicePubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.MemberDevicePubKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.MemberPubKeySignature) > 0 { + i -= len(m.MemberPubKeySignature) + copy(dAtA[i:], m.MemberPubKeySignature) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.MemberPubKeySignature))) + i-- + dAtA[i] = 0x12 + } + if len(m.MemberPubKey) > 0 { + i -= len(m.MemberPubKey) + copy(dAtA[i:], m.MemberPubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.MemberPubKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MessageEntryEnvelope) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MessageEntryEnvelope) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MessageEntryEnvelope) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x1a + } + if len(m.EncryptedPayload) > 0 { + i -= len(m.EncryptedPayload) + copy(dAtA[i:], m.EncryptedPayload) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.EncryptedPayload))) + i-- + dAtA[i] = 0x12 + } + if m.Counter != 0 { + i = encodeVarintStoreEntry(dAtA, i, uint64(m.Counter)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MessageEntryPayload) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MessageEntryPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MessageEntryPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Invitation != nil { + { + size, err := m.Invitation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStoreEntry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.MessageBody) > 0 { + i -= len(m.MessageBody) + copy(dAtA[i:], m.MessageBody) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.MessageBody))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintStoreEntry(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Invitation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Invitation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Invitation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.GroupSigningKey) > 0 { + i -= len(m.GroupSigningKey) + copy(dAtA[i:], m.GroupSigningKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.GroupSigningKey))) + i-- + dAtA[i] = 0x32 + } + if len(m.GroupPubKey) > 0 { + i -= len(m.GroupPubKey) + copy(dAtA[i:], m.GroupPubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.GroupPubKey))) + i-- + dAtA[i] = 0x2a + } + if m.GroupVersion != 0 { + i = encodeVarintStoreEntry(dAtA, i, uint64(m.GroupVersion)) + i-- + dAtA[i] = 0x20 + } + if len(m.InvitationPubKeySignature) > 0 { + i -= len(m.InvitationPubKeySignature) + copy(dAtA[i:], m.InvitationPubKeySignature) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.InvitationPubKeySignature))) + i-- + dAtA[i] = 0x1a + } + if len(m.InvitationPrivKey) > 0 { + i -= len(m.InvitationPrivKey) + copy(dAtA[i:], m.InvitationPrivKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.InvitationPrivKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.InviterDevicePubKey) > 0 { + i -= len(m.InviterDevicePubKey) + copy(dAtA[i:], m.InviterDevicePubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.InviterDevicePubKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SecretEntryPayload) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SecretEntryPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretEntryPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.EncryptedDeviceSecret) > 0 { + i -= len(m.EncryptedDeviceSecret) + copy(dAtA[i:], m.EncryptedDeviceSecret) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.EncryptedDeviceSecret))) + i-- + dAtA[i] = 0x1a + } + if len(m.SenderDevicePubKey) > 0 { + i -= len(m.SenderDevicePubKey) + copy(dAtA[i:], m.SenderDevicePubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.SenderDevicePubKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.DestMemberPubKey) > 0 { + i -= len(m.DestMemberPubKey) + copy(dAtA[i:], m.DestMemberPubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.DestMemberPubKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeviceSecret) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceSecret) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceSecret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Counter != 0 { + i = encodeVarintStoreEntry(dAtA, i, uint64(m.Counter)) + i-- + dAtA[i] = 0x10 + } + if len(m.DerivationState) > 0 { + i -= len(m.DerivationState) + copy(dAtA[i:], m.DerivationState) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.DerivationState))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SettingsEntryPayload) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SettingsEntryPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SettingsEntryPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if len(m.MemberPubKey) > 0 { + i -= len(m.MemberPubKey) + copy(dAtA[i:], m.MemberPubKey) + i = encodeVarintStoreEntry(dAtA, i, uint64(len(m.MemberPubKey))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintStoreEntry(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintStoreEntry(dAtA []byte, offset int, v uint64) int { + offset -= sovStoreEntry(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *StoreEncryptedEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EncryptedPayload) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MemberEntryPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MemberPubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.MemberPubKeySignature) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.MemberDevicePubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.MemberDevicePubKeySignature) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.InviterDevicePubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.InvitationPubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.InvitationPubKeySignature) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MessageEntryEnvelope) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Counter != 0 { + n += 1 + sovStoreEntry(uint64(m.Counter)) + } + l = len(m.EncryptedPayload) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MessageEntryPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovStoreEntry(uint64(m.Type)) + } + l = len(m.MessageBody) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.Invitation != nil { + l = m.Invitation.Size() + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Invitation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.InviterDevicePubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.InvitationPrivKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.InvitationPubKeySignature) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.GroupVersion != 0 { + n += 1 + sovStoreEntry(uint64(m.GroupVersion)) + } + l = len(m.GroupPubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.GroupSigningKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SecretEntryPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DestMemberPubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.SenderDevicePubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.EncryptedDeviceSecret) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeviceSecret) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DerivationState) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.Counter != 0 { + n += 1 + sovStoreEntry(uint64(m.Counter)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SettingsEntryPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovStoreEntry(uint64(m.Type)) + } + l = len(m.MemberPubKey) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovStoreEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovStoreEntry(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStoreEntry(x uint64) (n int) { + return sovStoreEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *StoreEncryptedEntry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StoreEncryptedEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreEncryptedEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EncryptedPayload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EncryptedPayload = append(m.EncryptedPayload[:0], dAtA[iNdEx:postIndex]...) + if m.EncryptedPayload == nil { + m.EncryptedPayload = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemberEntryPayload) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MemberEntryPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MemberEntryPayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberPubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MemberPubKey = append(m.MemberPubKey[:0], dAtA[iNdEx:postIndex]...) + if m.MemberPubKey == nil { + m.MemberPubKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberPubKeySignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MemberPubKeySignature = append(m.MemberPubKeySignature[:0], dAtA[iNdEx:postIndex]...) + if m.MemberPubKeySignature == nil { + m.MemberPubKeySignature = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberDevicePubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MemberDevicePubKey = append(m.MemberDevicePubKey[:0], dAtA[iNdEx:postIndex]...) + if m.MemberDevicePubKey == nil { + m.MemberDevicePubKey = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberDevicePubKeySignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MemberDevicePubKeySignature = append(m.MemberDevicePubKeySignature[:0], dAtA[iNdEx:postIndex]...) + if m.MemberDevicePubKeySignature == nil { + m.MemberDevicePubKeySignature = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InviterDevicePubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InviterDevicePubKey = append(m.InviterDevicePubKey[:0], dAtA[iNdEx:postIndex]...) + if m.InviterDevicePubKey == nil { + m.InviterDevicePubKey = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvitationPubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InvitationPubKey = append(m.InvitationPubKey[:0], dAtA[iNdEx:postIndex]...) + if m.InvitationPubKey == nil { + m.InvitationPubKey = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvitationPubKeySignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InvitationPubKeySignature = append(m.InvitationPubKeySignature[:0], dAtA[iNdEx:postIndex]...) + if m.InvitationPubKeySignature == nil { + m.InvitationPubKeySignature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MessageEntryEnvelope) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MessageEntryEnvelope: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MessageEntryEnvelope: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + m.Counter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Counter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EncryptedPayload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EncryptedPayload = append(m.EncryptedPayload[:0], dAtA[iNdEx:postIndex]...) + if m.EncryptedPayload == nil { + m.EncryptedPayload = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MessageEntryPayload) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MessageEntryPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MessageEntryPayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= MessageEntryPayload_PayloadType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageBody", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageBody = append(m.MessageBody[:0], dAtA[iNdEx:postIndex]...) + if m.MessageBody == nil { + m.MessageBody = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Invitation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Invitation == nil { + m.Invitation = &Invitation{} + } + if err := m.Invitation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Invitation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Invitation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Invitation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InviterDevicePubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InviterDevicePubKey = append(m.InviterDevicePubKey[:0], dAtA[iNdEx:postIndex]...) + if m.InviterDevicePubKey == nil { + m.InviterDevicePubKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvitationPrivKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InvitationPrivKey = append(m.InvitationPrivKey[:0], dAtA[iNdEx:postIndex]...) + if m.InvitationPrivKey == nil { + m.InvitationPrivKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvitationPubKeySignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InvitationPubKeySignature = append(m.InvitationPubKeySignature[:0], dAtA[iNdEx:postIndex]...) + if m.InvitationPubKeySignature == nil { + m.InvitationPubKeySignature = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupVersion", wireType) + } + m.GroupVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GroupVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupPubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupPubKey = append(m.GroupPubKey[:0], dAtA[iNdEx:postIndex]...) + if m.GroupPubKey == nil { + m.GroupPubKey = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupSigningKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupSigningKey = append(m.GroupSigningKey[:0], dAtA[iNdEx:postIndex]...) + if m.GroupSigningKey == nil { + m.GroupSigningKey = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecretEntryPayload) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SecretEntryPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SecretEntryPayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestMemberPubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestMemberPubKey = append(m.DestMemberPubKey[:0], dAtA[iNdEx:postIndex]...) + if m.DestMemberPubKey == nil { + m.DestMemberPubKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderDevicePubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SenderDevicePubKey = append(m.SenderDevicePubKey[:0], dAtA[iNdEx:postIndex]...) + if m.SenderDevicePubKey == nil { + m.SenderDevicePubKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EncryptedDeviceSecret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EncryptedDeviceSecret = append(m.EncryptedDeviceSecret[:0], dAtA[iNdEx:postIndex]...) + if m.EncryptedDeviceSecret == nil { + m.EncryptedDeviceSecret = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceSecret) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceSecret: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceSecret: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DerivationState", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DerivationState = append(m.DerivationState[:0], dAtA[iNdEx:postIndex]...) + if m.DerivationState == nil { + m.DerivationState = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + m.Counter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Counter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SettingsEntryPayload) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SettingsEntryPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SettingsEntryPayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= SettingsEntryPayload_PayloadType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberPubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MemberPubKey = append(m.MemberPubKey[:0], dAtA[iNdEx:postIndex]...) + if m.MemberPubKey == nil { + m.MemberPubKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStoreEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStoreEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoreEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStoreEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStoreEntry(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStoreEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStoreEntry + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStoreEntry + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStoreEntry + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStoreEntry = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStoreEntry = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStoreEntry = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/internal/ipfsutil/api_configurable.go b/go/internal/ipfsutil/api_configurable.go new file mode 100644 index 0000000000..2a7bc3b8b0 --- /dev/null +++ b/go/internal/ipfsutil/api_configurable.go @@ -0,0 +1,35 @@ +package ipfsutil + +import ( + "context" + + "berty.tech/go/pkg/errcode" + ipfs_core "github.com/ipfs/go-ipfs/core" + ipfs_coreapi "github.com/ipfs/go-ipfs/core/coreapi" + ipfs_node "github.com/ipfs/go-ipfs/core/node" + ipfs_interface "github.com/ipfs/interface-go-ipfs-core" +) + +type NewAPIOption func(context.Context, *ipfs_core.IpfsNode, ipfs_interface.CoreAPI) error + +// NewConfigurableCoreAPI returns an IPFS CoreAPI from a provided ipfs_node.BuildCfg +func NewConfigurableCoreAPI(ctx context.Context, cfg *ipfs_node.BuildCfg, options ...NewAPIOption) (ipfs_interface.CoreAPI, error) { + node, err := ipfs_core.NewNode(ctx, cfg) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + api, err := ipfs_coreapi.NewCoreAPI(node) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + for _, o := range options { + err := o(ctx, node, api) + if err != nil { + return nil, err + } + } + + return api, nil +} diff --git a/go/internal/ipfsutil/api_inmemory.go b/go/internal/ipfsutil/api_inmemory.go index 870d86eab4..0d78387f74 100644 --- a/go/internal/ipfsutil/api_inmemory.go +++ b/go/internal/ipfsutil/api_inmemory.go @@ -9,8 +9,6 @@ import ( ipfs_datastore "github.com/ipfs/go-datastore" ipfs_datastoresync "github.com/ipfs/go-datastore/sync" ipfs_cfg "github.com/ipfs/go-ipfs-config" - ipfs_core "github.com/ipfs/go-ipfs/core" - ipfs_coreapi "github.com/ipfs/go-ipfs/core/coreapi" ipfs_node "github.com/ipfs/go-ipfs/core/node" ipfs_libp2p "github.com/ipfs/go-ipfs/core/node/libp2p" ipfs_repo "github.com/ipfs/go-ipfs/repo" @@ -26,12 +24,7 @@ func NewInMemoryCoreAPI(ctx context.Context) (ipfs_interface.CoreAPI, error) { return nil, errcode.TODO.Wrap(err) } - node, err := ipfs_core.NewNode(ctx, cfg) - if err != nil { - return nil, errcode.TODO.Wrap(err) - } - - return ipfs_coreapi.NewCoreAPI(node) + return NewConfigurableCoreAPI(ctx, cfg) } func createBuildConfig() (*ipfs_node.BuildCfg, error) { @@ -51,6 +44,9 @@ func createBuildConfig() (*ipfs_node.BuildCfg, error) { Routing: routing, Host: hostopts, Repo: repo, + ExtraOpts: map[string]bool{ + "pubsub": true, + }, }, nil } diff --git a/go/internal/ipfsutil/mdns_discovery.go b/go/internal/ipfsutil/mdns_discovery.go new file mode 100644 index 0000000000..119168bc71 --- /dev/null +++ b/go/internal/ipfsutil/mdns_discovery.go @@ -0,0 +1,36 @@ +package ipfsutil + +import ( + "context" + "time" + + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p/p2p/discovery" + + ipfs_core "github.com/ipfs/go-ipfs/core" + ipfs_interface "github.com/ipfs/interface-go-ipfs-core" + peerstore "github.com/libp2p/go-libp2p-peerstore" +) + +type DiscoveryNotifee struct { + api ipfs_interface.CoreAPI +} + +func (n *DiscoveryNotifee) HandlePeerFound(pi peerstore.PeerInfo) { + if err := n.api.Swarm().Connect(context.Background(), pi); err != nil { + println("HandlePeerFound: Unable to connect to peer", err.Error()) + } +} + +func OptionMDNSDiscovery(ctx context.Context, node *ipfs_core.IpfsNode, api ipfs_interface.CoreAPI) error { + s, err := discovery.NewMdnsService(ctx, node.PeerHost, time.Second, "") + if err != nil { + return errcode.TODO.Wrap(err) + } + + n := &DiscoveryNotifee{api: api} + + s.RegisterNotifee(n) + + return nil +} diff --git a/go/internal/ipfsutil/testing.go b/go/internal/ipfsutil/testing.go index 3b74612db5..3568de746e 100644 --- a/go/internal/ipfsutil/testing.go +++ b/go/internal/ipfsutil/testing.go @@ -19,14 +19,12 @@ type CoreAPIMock interface { MockNode() *ipfs_core.IpfsNode } -// TestingCoreAPI returns a fully initialized mocked Core API -func TestingCoreAPI(ctx context.Context, t *testing.T) CoreAPIMock { +func TestingCoreAPIUsingMockNet(ctx context.Context, t *testing.T, m libp2p_mocknet.Mocknet) CoreAPIMock { t.Helper() - mocknet := libp2p_mocknet.New(ctx) node, err := ipfs_core.NewNode(ctx, &ipfs_core.BuildCfg{ Online: true, - Host: ipfs_mock.MockHostOption(mocknet), + Host: ipfs_mock.MockHostOption(m), ExtraOpts: map[string]bool{ "pubsub": true, }, @@ -40,7 +38,16 @@ func TestingCoreAPI(ctx context.Context, t *testing.T) CoreAPIMock { t.Fatalf("failed to initialize IPFS Core API mock: %v", err) } - return &coreAPIMock{coreapi, mocknet, node} + return &coreAPIMock{coreapi, m, node} +} + +// TestingCoreAPI returns a fully initialized mocked Core API +func TestingCoreAPI(ctx context.Context, t *testing.T) CoreAPIMock { + t.Helper() + + m := libp2p_mocknet.New(ctx) + + return TestingCoreAPIUsingMockNet(ctx, t, m) } type coreAPIMock struct { diff --git a/go/internal/orbitutil/doc.go b/go/internal/orbitutil/doc.go new file mode 100644 index 0000000000..95bd2e46ff --- /dev/null +++ b/go/internal/orbitutil/doc.go @@ -0,0 +1,2 @@ +// orbitutil contains access controllers and stores for the Berty protocol +package orbitutil // import "berty.tech/go/internal/orbitutil" diff --git a/go/internal/orbitutil/group_holder.go b/go/internal/orbitutil/group_holder.go new file mode 100644 index 0000000000..4d6329308f --- /dev/null +++ b/go/internal/orbitutil/group_holder.go @@ -0,0 +1,171 @@ +package orbitutil + +import ( + "context" + "encoding/hex" + + "berty.tech/go/internal/group" + + "berty.tech/go-orbit-db/accesscontroller" + + "berty.tech/go-orbit-db/stores" + + "berty.tech/go-ipfs-log/identityprovider" + orbitdb "berty.tech/go-orbit-db" + "berty.tech/go-orbit-db/address" + "berty.tech/go-orbit-db/iface" + "berty.tech/go/pkg/errcode" + coreapi "github.com/ipfs/interface-go-ipfs-core" + "github.com/libp2p/go-libp2p-core/crypto" + "github.com/pkg/errors" +) + +const memberStoreType = "member_store" +const groupIDKey = "group_id" + +func (s *GroupHolder) getGroup(groupID string) (*group.Group, error) { + g, ok := s.groups[groupID] + + if !ok { + return nil, errcode.ErrGroupMemberMissingSecrets + } + + return g, nil +} + +func (s *GroupHolder) memberStoreConstructor(ctx context.Context, ipfs coreapi.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) (iface.Store, error) { + groupIDs, err := options.AccessController.GetAuthorizedByRole(groupIDKey) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + if len(groupIDs) != 1 { + return nil, errcode.ErrInvalidInput + } + + store := &memberStore{} + g, err := s.getGroup(groupIDs[0]) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + options.Index = NewMemberStoreIndex(g) + + err = store.InitBaseStore(ctx, ipfs, identity, addr, options) + if err != nil { + return nil, errors.Wrap(err, "unable to initialize base store") + } + + return store, nil +} + +// NewMemberStore Creates or opens an MemberStore +func (s *GroupHolder) NewMemberStore(ctx context.Context, o orbitdb.OrbitDB, g *group.Group, options *orbitdb.CreateDBOptions) (MemberStore, error) { + if err := s.setGroup(g); err != nil { + return nil, errcode.TODO.Wrap(err) + } + + if options == nil { + options = &orbitdb.CreateDBOptions{ + Create: boolPtr(true), + } + } + + groupID, err := g.GroupIDAsString() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + signingKeyBytes, err := g.SigningKey.GetPublic().Raw() + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + if options.AccessController == nil { + options.AccessController = accesscontroller.NewSimpleManifestParams("simple", map[string][]string{ + "write": {hex.EncodeToString(signingKeyBytes)}, + groupIDKey: {groupID}, + }) + } + + if err := s.keyStore.SetKey(g.SigningKey); err != nil { + return nil, errcode.TODO.Wrap(err) + } + + options.Create = boolPtr(true) + options.StoreType = stringPtr(memberStoreType) + options.Keystore = s.keyStore + options.Identity, err = identityprovider.CreateIdentity(&identityprovider.CreateIdentityOptions{ + Type: IdentityType, + Keystore: s.keyStore, + ID: hex.EncodeToString(signingKeyBytes), + }) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + store, err := o.Open(ctx, groupID, options) + if err != nil { + return nil, errors.Wrap(err, "unable to open database") + } + + memberStore, ok := store.(*memberStore) + if !ok { + return nil, errors.New("unable to cast store to member store") + } + + memberStore.group = g + + return memberStore, nil +} + +type GroupHolder struct { + groups map[string]*group.Group + groupsSigPubKey map[string]crypto.PubKey + keyStore *BertySignedKeyStore +} + +// NewGroupHolder creates a new GroupHolder which will hold the groups +func NewGroupHolder() (*GroupHolder, error) { + secretHolder := &GroupHolder{ + groups: map[string]*group.Group{}, + groupsSigPubKey: map[string]crypto.PubKey{}, + keyStore: NewBertySignedKeyStore(), + } + + // TODO: we can only have a single instance of GroupHolder, otherwise secrets won't be properly retrieved + stores.RegisterStore(memberStoreType, secretHolder.memberStoreConstructor) + if err := identityprovider.AddIdentityProvider(NewBertySignedIdentityProviderFactory(secretHolder.keyStore)); err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return secretHolder, nil +} + +// setGroup registers a new group +func (s *GroupHolder) setGroup(g *group.Group) error { + groupID, err := g.GroupIDAsString() + if err != nil { + return errcode.TODO.Wrap(err) + } + + s.groups[groupID] = g + + if err = s.SetGroupSigPubKey(groupID, g.SigningKey.GetPublic()); err != nil { + return errcode.TODO.Wrap(err) + } + + return nil +} + +// SetGroupSigPubKey registers a new group signature pubkey, mainly used to +// replicate a store data without needing to access to its content +func (s *GroupHolder) SetGroupSigPubKey(groupID string, pubKey crypto.PubKey) error { + if pubKey == nil { + return errcode.ErrInvalidInput + } + + s.groupsSigPubKey[groupID] = pubKey + + return nil +} diff --git a/go/internal/orbitutil/member_store.go b/go/internal/orbitutil/member_store.go new file mode 100644 index 0000000000..81a09e918d --- /dev/null +++ b/go/internal/orbitutil/member_store.go @@ -0,0 +1,66 @@ +package orbitutil + +import ( + "context" + + "berty.tech/go-orbit-db/iface" + "berty.tech/go-orbit-db/stores/basestore" + "berty.tech/go-orbit-db/stores/operation" + "berty.tech/go/internal/group" + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p-core/crypto" + "github.com/pkg/errors" +) + +type MemberStore interface { + iface.Store + + // ListMembers gets the list of the devices of the group + ListMembers() ([]*group.MemberDevice, error) + + // RedeemInvitation add a device to the list of the members of the group + RedeemInvitation(ctx context.Context, memberPrivateKey crypto.PrivKey, devicePrivateKey crypto.PrivKey, invitation *group.Invitation) (operation.Operation, error) +} + +type memberStore struct { + basestore.BaseStore + + group *group.Group +} + +func (m *memberStore) ListMembers() ([]*group.MemberDevice, error) { + values, ok := m.Index().Get("").([]*group.MemberDevice) + if !ok { + return nil, errors.New("unable to cast entries") + } + + return values, nil +} + +func (m *memberStore) RedeemInvitation(ctx context.Context, memberPrivateKey, devicePrivateKey crypto.PrivKey, invitation *group.Invitation) (operation.Operation, error) { + payload, err := group.NewMemberEntryPayload(memberPrivateKey, devicePrivateKey, invitation) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + env, err := group.SealStorePayload(payload, m.group, devicePrivateKey) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + op := operation.NewOperation(nil, "ADD", env) + + e, err := m.AddOperation(ctx, op, nil) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + op, err = operation.ParseOperation(e) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return op, nil +} + +var _ MemberStore = (*memberStore)(nil) diff --git a/go/internal/orbitutil/member_store_index.go b/go/internal/orbitutil/member_store_index.go new file mode 100644 index 0000000000..cac63d0529 --- /dev/null +++ b/go/internal/orbitutil/member_store_index.go @@ -0,0 +1,183 @@ +package orbitutil + +import ( + ipfslog "berty.tech/go-ipfs-log" + "berty.tech/go-orbit-db/iface" + "berty.tech/go-orbit-db/stores/operation" + "berty.tech/go/internal/group" + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p-core/crypto" +) + +type indexEntry struct { + memberDevice *group.MemberDevice + err error + root bool + children []*indexEntry + isValid bool + parentPubKey crypto.PubKey + parent *indexEntry + payload *group.MemberEntryPayload + fullyValid bool +} + +func (i *indexEntry) findParent(index *memberStoreIndex) *indexEntry { + if i.parent != nil { + return i.parent + } + + for _, e := range index.entries { + if e.memberDevice.Device.Equals(i.parentPubKey) { + i.parent = e + e.children = append(e.children, i) + + return e + } + } + + return nil +} + +type memberStoreIndex struct { + group *group.Group + entries map[string]*indexEntry + members []*group.MemberDevice +} + +func (m *memberStoreIndex) Get(key string) interface{} { + return m.members +} + +func (m *memberStoreIndex) checkMemberLogEntryPayloadFirst(entry *indexEntry) error { + if !entry.parentPubKey.Equals(m.group.PubKey) { + return errcode.ErrGroupMemberLogWrongInviter + } + + return nil +} + +func (m *memberStoreIndex) checkMemberLogEntryPayloadInvited(entry *indexEntry) error { + for _, e := range m.entries { + if e.memberDevice.Device.Equals(entry.parentPubKey) { + return nil + } + } + + return errcode.ErrGroupMemberLogWrongInviter +} + +func unwrapOperation(opEntry ipfslog.Entry) ([]byte, error) { + entry, ok := opEntry.(ipfslog.Entry) + if !ok { + return nil, errcode.ErrInvalidInput + } + + op, err := operation.ParseOperation(entry) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return op.GetValue(), nil +} + +func (m *memberStoreIndex) UpdateIndex(log ipfslog.Log, entries []ipfslog.Entry) error { + for _, e := range log.Values().Slice() { + var ( + idxE *indexEntry + ok bool + entryBytes []byte + ) + + entryHash := e.GetHash().String() + if idxE, ok = m.entries[entryHash]; !ok { + payload := &group.MemberEntryPayload{} + + idxE = &indexEntry{} + m.entries[entryHash] = idxE + + if entryBytes, idxE.err = unwrapOperation(e); idxE.err != nil { + continue + } + + if idxE.err = group.OpenStorePayload(payload, entryBytes, m.group); idxE.err != nil { + continue + } + + if idxE.err = payload.CheckStructure(); idxE.err != nil { + continue + } + + idxE.payload = payload + + if idxE.memberDevice, idxE.err = payload.ToMemberDevice(); idxE.err != nil { + continue + } + + if idxE.parentPubKey, idxE.err = crypto.UnmarshalEd25519PublicKey(payload.InviterDevicePubKey); idxE.err != nil { + continue + } + } + + if err := m.checkMemberLogEntryPayloadFirst(idxE); err == nil { + m.validateEntry(idxE, true) + continue + } + + if err := m.checkMemberLogEntryPayloadInvited(idxE); err == nil { + m.validateEntry(idxE, false) + continue + } + } + + return nil +} + +func (m *memberStoreIndex) validateEntry(entry *indexEntry, isRoot bool) { + if entry.fullyValid { + return + } + entry.isValid = true + + if isRoot { + entry.root = true + } + + entry.parent = entry.findParent(m) + + if hasAllParentsValid(entry, m) { + m.members = append(m.members, entry.memberDevice) + entry.fullyValid = true + } + + for _, child := range entry.children { + m.validateEntry(child, false) + } +} + +func hasAllParentsValid(entry *indexEntry, index *memberStoreIndex) bool { + if entry.root { + return true + } + + if entry.parent == nil { + return false + } + + if !entry.parent.isValid { + return false + } + + return hasAllParentsValid(entry.parent, index) +} + +// NewMemberStoreIndex returns a new index to manage the list of the group members +func NewMemberStoreIndex(g *group.Group) iface.IndexConstructor { + return func(publicKey []byte) iface.StoreIndex { + return &memberStoreIndex{ + group: g, + entries: map[string]*indexEntry{}, + } + } +} + +var _ iface.StoreIndex = &memberStoreIndex{} diff --git a/go/internal/orbitutil/member_store_test.go b/go/internal/orbitutil/member_store_test.go new file mode 100644 index 0000000000..82bf9e725f --- /dev/null +++ b/go/internal/orbitutil/member_store_test.go @@ -0,0 +1,296 @@ +package orbitutil + +import ( + "context" + "crypto/rand" + "os" + "testing" + "time" + + "berty.tech/go-orbit-db/events" + "berty.tech/go-orbit-db/stores" + + "berty.tech/go/internal/group" + "berty.tech/go/internal/ipfsutil" + + orbitdb "berty.tech/go-orbit-db" + + "github.com/libp2p/go-libp2p-core/crypto" + peerstore "github.com/libp2p/go-libp2p-peerstore" +) + +type memberDevices struct { + privKey crypto.PrivKey + devices []crypto.PrivKey +} + +func createMemberAndDevices(t *testing.T, deviceCount int) *memberDevices { + ret := &memberDevices{} + + memberPrivKey, _, err := crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + t.Fatalf("unable to generate a key %v", err) + } + + ret.privKey = memberPrivKey + ret.devices = make([]crypto.PrivKey, deviceCount) + for i := 0; i < deviceCount; i++ { + ret.devices[i], _, err = crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + t.Fatalf("unable to generate a key %v", err) + } + } + + return ret +} + +func makeDummySigningKey() crypto.PrivKey { + priv, _, err := crypto.GenerateEd25519Key(rand.Reader) + if err != nil { + panic(err) + } + + return priv +} + +func createInvitation(t *testing.T, inviter crypto.PrivKey) *group.Invitation { + invitation, err := group.NewInvitation(inviter, &group.Group{PubKey: inviter.GetPublic(), SigningKey: makeDummySigningKey()}) + if err != nil { + t.Fatalf("err: %v", err) + } + + return invitation +} + +func TestMemberStore(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + groupHolder, err := NewGroupHolder() + if err != nil { + t.Fatal(err) + } + + memberA := createMemberAndDevices(t, 2) + + ipfsMock := ipfsutil.TestingCoreAPI(ctx, t) + + odb, err := orbitdb.NewOrbitDB(ctx, ipfsMock, nil) + if err != nil { + t.Fatalf("unable to init orbitdb") + } + + g, invitation, err := group.New() + + store, err := groupHolder.NewMemberStore(ctx, odb, g, nil) + defer store.Drop() + + if err != nil { + t.Fatalf("unable to initialize store, err: %v", err) + } + + _, err = store.RedeemInvitation(ctx, memberA.privKey, memberA.devices[0], invitation) + if err != nil { + t.Fatalf("unable to initialize group, err: %v", err) + } + + members, err := store.ListMembers() + if err != nil { + t.Fatalf("unable to initialize group, err: %v", err) + } + + if len(members) != 1 { + t.Fatalf("1 device should be listed") + } + + if !members[0].Member.Equals(memberA.privKey.GetPublic()) { + t.Fatalf("member A should be listed") + } + + if !members[0].Device.Equals(memberA.devices[0].GetPublic()) { + t.Fatalf("device A1 should be listed") + } + + invitation = createInvitation(t, memberA.devices[0]) + + _, err = store.RedeemInvitation(ctx, memberA.privKey, memberA.devices[1], invitation) + if err != nil { + t.Fatalf("unable to redeem invitation, err: %v", err) + } + + members, err = store.ListMembers() + if err != nil { + t.Fatalf("unable to list members, err: %v", err) + } + + if len(members) != 2 { + t.Fatalf("2 devices should be listed") + } + + if !members[0].Member.Equals(memberA.privKey.GetPublic()) { + t.Fatalf("member A should be listed") + } + + if !members[1].Member.Equals(memberA.privKey.GetPublic()) { + t.Fatalf("member A should be listed") + } + + if !members[0].Device.Equals(memberA.devices[0].GetPublic()) { + t.Fatalf("device A1 should be listed") + } + + if !members[1].Device.Equals(memberA.devices[1].GetPublic()) { + t.Fatalf("device A2 should be listed") + } +} + +func TestMemberReplicateStore(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + dbPath1 := "./orbitdb/tests/replicate-automatically/1" + dbPath2 := "./orbitdb/tests/replicate-automatically/2" + + defer os.RemoveAll("./orbitdb/") + + groupHolder, err := NewGroupHolder() + if err != nil { + t.Fatal(err) + } + + ipfsMock1 := ipfsutil.TestingCoreAPI(ctx, t) + ipfsMock2 := ipfsutil.TestingCoreAPIUsingMockNet(ctx, t, ipfsMock1.MockNetwork()) + + if _, err := ipfsMock1.MockNetwork().LinkPeers(ipfsMock1.MockNode().Identity, ipfsMock2.MockNode().Identity); err != nil { + t.Fatal(err) + } + + peerInfo2 := peerstore.PeerInfo{ID: ipfsMock2.MockNode().Identity, Addrs: ipfsMock2.MockNode().PeerHost.Addrs()} + if err := ipfsMock1.Swarm().Connect(ctx, peerInfo2); err != nil { + t.Fatal(err) + } + + g, invitation, err := group.New() + if err != nil { + t.Fatal(err) + } + + memberA := createMemberAndDevices(t, 2) + + peerInfo1 := peerstore.PeerInfo{ID: ipfsMock1.MockNode().Identity, Addrs: ipfsMock1.MockNode().PeerHost.Addrs()} + if err := ipfsMock2.Swarm().Connect(ctx, peerInfo1); err != nil { + t.Fatal(err) + } + + orbitdb1, err := orbitdb.NewOrbitDB(ctx, ipfsMock1, &orbitdb.NewOrbitDBOptions{Directory: &dbPath1}) + if err != nil { + t.Fatal(err) + } + + orbitdb2, err := orbitdb.NewOrbitDB(ctx, ipfsMock2, &orbitdb.NewOrbitDBOptions{Directory: &dbPath2}) + if err != nil { + t.Fatal(err) + } + + db1, err := groupHolder.NewMemberStore(ctx, orbitdb1, g, &orbitdb.CreateDBOptions{ + Directory: &dbPath1, + }) + if err != nil { + t.Fatal(err) + } + + defer db1.Drop() + + _, err = db1.RedeemInvitation(ctx, memberA.privKey, memberA.devices[0], invitation) + if err != nil { + t.Fatal(err) + } + + db2, err := groupHolder.NewMemberStore(ctx, orbitdb2, g, &orbitdb.CreateDBOptions{ + Directory: &dbPath2, + }) + + if err != nil { + t.Fatal(err) + } + + defer db2.Drop() + + { + ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + defer cancel() + + hasAllResults := false + go db2.Subscribe(ctx, func(evt events.Event) { + switch evt.(type) { + case *stores.EventReplicated: + result1, err := db1.ListMembers() + if err != nil { + t.Fatal(err) + } + + result2, err := db2.ListMembers() + if err != nil { + t.Fatal(err) + } + + if len(result1) != 1 || len(result2) != 1 { + return + } + + hasAllResults = true + cancel() + } + }) + + <-ctx.Done() + if !hasAllResults { + t.Fatalf("all results should be listed") + } + } + + { + memberB := createMemberAndDevices(t, 2) + + invitation, err := group.NewInvitation(memberA.devices[0], g) + if err != nil { + t.Fatal(err) + } + + _, err = db2.RedeemInvitation(ctx, memberB.privKey, memberB.devices[0], invitation) + if err != nil { + t.Fatal(err) + } + + ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + defer cancel() + + hasAllResults := false + go db1.Subscribe(ctx, func(evt events.Event) { + switch evt.(type) { + case *stores.EventReplicated: + result1, err := db1.ListMembers() + if err != nil { + t.Fatal(err) + } + + result2, err := db2.ListMembers() + if err != nil { + t.Fatal(err) + } + + if len(result1) != 2 || len(result2) != 2 { + return + } + + hasAllResults = true + cancel() + } + }) + + <-ctx.Done() + if !hasAllResults { + t.Fatalf("all results should be listed") + } + } +} diff --git a/go/internal/orbitutil/signed_entry_identity_provider.go b/go/internal/orbitutil/signed_entry_identity_provider.go new file mode 100644 index 0000000000..7855b89a28 --- /dev/null +++ b/go/internal/orbitutil/signed_entry_identity_provider.go @@ -0,0 +1,57 @@ +package orbitutil + +import ( + "berty.tech/go-ipfs-log/identityprovider" + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p-core/crypto" +) + +const IdentityType = "betry_group_entry" + +type bertySignedIdentityProvider struct { + keyStore *BertySignedKeyStore +} + +func (b *bertySignedIdentityProvider) UnmarshalPublicKey(data []byte) (crypto.PubKey, error) { + return crypto.UnmarshalEd25519PublicKey(data) +} + +func (b *bertySignedIdentityProvider) GetID(opts *identityprovider.CreateIdentityOptions) (string, error) { + return opts.ID, nil +} + +func (b *bertySignedIdentityProvider) SignIdentity(data []byte, id string) ([]byte, error) { + return nil, nil +} + +func (b *bertySignedIdentityProvider) GetType() string { + return IdentityType +} + +func (b *bertySignedIdentityProvider) VerifyIdentity(identity *identityprovider.Identity) error { + return nil +} + +func (b *bertySignedIdentityProvider) Sign(identity *identityprovider.Identity, bytes []byte) ([]byte, error) { + key, err := b.keyStore.GetKey(identity.ID) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + sig, err := key.Sign(bytes) + if err != nil { + return nil, errcode.TODO.Wrap(err) + } + + return sig, nil +} + +func NewBertySignedIdentityProviderFactory(ks *BertySignedKeyStore) func(options *identityprovider.CreateIdentityOptions) identityprovider.Interface { + return func(options *identityprovider.CreateIdentityOptions) identityprovider.Interface { + return &bertySignedIdentityProvider{ + keyStore: ks, + } + } +} + +var _ identityprovider.Interface = (*bertySignedIdentityProvider)(nil) diff --git a/go/internal/orbitutil/signed_entry_keystore.go b/go/internal/orbitutil/signed_entry_keystore.go new file mode 100644 index 0000000000..756dc32887 --- /dev/null +++ b/go/internal/orbitutil/signed_entry_keystore.go @@ -0,0 +1,72 @@ +package orbitutil + +import ( + "encoding/hex" + + "berty.tech/go-ipfs-log/keystore" + + "berty.tech/go/pkg/errcode" + "github.com/libp2p/go-libp2p-core/crypto" +) + +type BertySignedKeyStore struct { + keys map[string]crypto.PrivKey +} + +func (s *BertySignedKeyStore) SetKey(pk crypto.PrivKey) error { + pubKeyBytes, err := pk.GetPublic().Raw() + if err != nil { + return errcode.TODO.Wrap(err) + } + + keyID := hex.EncodeToString(pubKeyBytes) + + s.keys[keyID] = pk + + return nil +} + +func (s *BertySignedKeyStore) HasKey(id string) (bool, error) { + _, ok := s.keys[id] + + return ok, nil +} + +func (s *BertySignedKeyStore) CreateKey(id string) (crypto.PrivKey, error) { + return s.GetKey(id) +} + +func (s *BertySignedKeyStore) GetKey(id string) (crypto.PrivKey, error) { + if privKey, ok := s.keys[id]; ok { + return privKey, nil + } + + return nil, errcode.ErrGroupMemberUnknownGroupID +} + +func (s *BertySignedKeyStore) Sign(privKey crypto.PrivKey, bytes []byte) ([]byte, error) { + return privKey.Sign(bytes) +} + +func (s *BertySignedKeyStore) Verify(signature []byte, publicKey crypto.PubKey, data []byte) error { + ok, err := publicKey.Verify(data, signature) + if err != nil { + return err + } + + if !ok { + return errcode.ErrGroupMemberLogEventSignature + } + + return nil +} + +func NewBertySignedKeyStore() *BertySignedKeyStore { + ks := &BertySignedKeyStore{ + keys: map[string]crypto.PrivKey{}, + } + + return ks +} + +var _ keystore.Interface = (*BertySignedKeyStore)(nil) diff --git a/go/internal/orbitutil/utils.go b/go/internal/orbitutil/utils.go new file mode 100644 index 0000000000..5b4666a034 --- /dev/null +++ b/go/internal/orbitutil/utils.go @@ -0,0 +1,9 @@ +package orbitutil + +func stringPtr(s string) *string { + return &s +} + +func boolPtr(b bool) *bool { + return &b +} diff --git a/go/internal/protocoldb/migrations/v0001init/migration.go b/go/internal/protocoldb/migrations/v0001init/migration.go index 2561c892af..af39bd773f 100644 --- a/go/internal/protocoldb/migrations/v0001init/migration.go +++ b/go/internal/protocoldb/migrations/v0001init/migration.go @@ -12,11 +12,11 @@ type EnumValueInt32 int32 type GroupInfo struct { // Fields // - Group details/meta - GroupPubKey []byte `protobuf:"bytes,1,opt,name=group_pub_key,json=groupPubKey,proto3" json:"group_pub_key,omitempty" gorm:"primary_key"` - SharedSecret []byte `protobuf:"bytes,2,opt,name=shared_secret,json=sharedSecret,proto3" json:"shared_secret,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - Audience EnumValueInt32 `protobuf:"varint,4,opt,name=audience,proto3,enum=berty.protocolmodel.GroupInfo_GroupAudience" json:"audience,omitempty" gorm:"index"` - Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` + GroupPubKey []byte `protobuf:"bytes,1,opt,name=group_pub_key,json=groupPubKey,proto3" json:"group_pub_key,omitempty" gorm:"primary_key"` + GroupSigningKey []byte `protobuf:"bytes,2,opt,name=group_signing_key,json=groupSigningKey,proto3" json:"group_signing_key,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Audience EnumValueInt32 `protobuf:"varint,4,opt,name=audience,proto3,enum=berty.protocolmodel.GroupInfo_GroupAudience" json:"audience,omitempty" gorm:"index"` + Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` // - Own secrets SelfPrivKeyAccount []byte `protobuf:"bytes,6,opt,name=self_priv_key_account,json=selfPrivKeyAccount,proto3" json:"self_priv_key_account,omitempty"` SelfPrivKeyDevice []byte `protobuf:"bytes,7,opt,name=self_priv_key_device,json=selfPrivKeyDevice,proto3" json:"self_priv_key_device,omitempty"` @@ -41,7 +41,7 @@ type GroupIncomingRequest struct { InviterMemberPubKey []byte `protobuf:"bytes,2,opt,name=inviter_member_pub_key,json=inviterMemberPubKey,proto3" json:"inviter_member_pub_key,omitempty"` InvitationSig []byte `protobuf:"bytes,3,opt,name=invitation_sig,json=invitationSig,proto3" json:"invitation_sig,omitempty"` InvitationPrivKey []byte `protobuf:"bytes,4,opt,name=invitation_priv_key,json=invitationPrivKey,proto3" json:"invitation_priv_key,omitempty"` - GroupSharedSecret []byte `protobuf:"bytes,5,opt,name=group_shared_secret,json=groupSharedSecret,proto3" json:"group_shared_secret,omitempty"` + GroupSigningKey []byte `protobuf:"bytes,5,opt,name=group_signing_key,json=groupSigningKey,proto3" json:"group_signing_key,omitempty"` GroupVersion []byte `protobuf:"bytes,6,opt,name=group_version,json=groupVersion,proto3" json:"group_version,omitempty"` EssentialMetadata []byte `protobuf:"bytes,7,opt,name=essential_metadata,json=essentialMetadata,proto3" json:"essential_metadata,omitempty"` InviterContactPubKey []byte `protobuf:"bytes,9,opt,name=inviter_contact_pub_key,json=inviterContactPubKey,proto3" json:"inviter_contact_pub_key,omitempty"` diff --git a/go/internal/protocoldb/protocolmodel.pb.go b/go/internal/protocoldb/protocolmodel.pb.go index f99775db7d..6f98b0a4b2 100644 --- a/go/internal/protocoldb/protocolmodel.pb.go +++ b/go/internal/protocoldb/protocolmodel.pb.go @@ -93,7 +93,7 @@ func (Contact_TrustLevel) EnumDescriptor() ([]byte, []int) { // GroupInfo is the internal version of bertyprotocol.GroupInfo and should stay in sync type GroupInfo struct { GroupPubKey []byte `protobuf:"bytes,1,opt,name=group_pub_key,json=groupPubKey,proto3" json:"group_pub_key,omitempty" gorm:"primary_key"` - SharedSecret []byte `protobuf:"bytes,2,opt,name=shared_secret,json=sharedSecret,proto3" json:"shared_secret,omitempty"` + GroupSigningKey []byte `protobuf:"bytes,2,opt,name=group_signing_key,json=groupSigningKey,proto3" json:"group_signing_key,omitempty"` Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` Audience GroupInfo_GroupAudience `protobuf:"varint,4,opt,name=audience,proto3,enum=berty.protocolmodel.GroupInfo_GroupAudience" json:"audience,omitempty" gorm:"index"` Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` @@ -142,9 +142,9 @@ func (m *GroupInfo) GetGroupPubKey() []byte { return nil } -func (m *GroupInfo) GetSharedSecret() []byte { +func (m *GroupInfo) GetGroupSigningKey() []byte { if m != nil { - return m.SharedSecret + return m.GroupSigningKey } return nil } @@ -259,7 +259,7 @@ type GroupIncomingRequest struct { InviterMemberPubKey []byte `protobuf:"bytes,2,opt,name=inviter_member_pub_key,json=inviterMemberPubKey,proto3" json:"inviter_member_pub_key,omitempty"` InvitationSig []byte `protobuf:"bytes,3,opt,name=invitation_sig,json=invitationSig,proto3" json:"invitation_sig,omitempty"` InvitationPrivKey []byte `protobuf:"bytes,4,opt,name=invitation_priv_key,json=invitationPrivKey,proto3" json:"invitation_priv_key,omitempty"` - GroupSharedSecret []byte `protobuf:"bytes,5,opt,name=group_shared_secret,json=groupSharedSecret,proto3" json:"group_shared_secret,omitempty"` + GroupSigningKey []byte `protobuf:"bytes,5,opt,name=group_signing_key,json=groupSigningKey,proto3" json:"group_signing_key,omitempty"` GroupVersion []byte `protobuf:"bytes,6,opt,name=group_version,json=groupVersion,proto3" json:"group_version,omitempty"` EssentialMetadata []byte `protobuf:"bytes,7,opt,name=essential_metadata,json=essentialMetadata,proto3" json:"essential_metadata,omitempty"` InviterContactPubKey []byte `protobuf:"bytes,9,opt,name=inviter_contact_pub_key,json=inviterContactPubKey,proto3" json:"inviter_contact_pub_key,omitempty"` @@ -320,9 +320,9 @@ func (m *GroupIncomingRequest) GetInvitationPrivKey() []byte { return nil } -func (m *GroupIncomingRequest) GetGroupSharedSecret() []byte { +func (m *GroupIncomingRequest) GetGroupSigningKey() []byte { if m != nil { - return m.GroupSharedSecret + return m.GroupSigningKey } return nil } @@ -957,108 +957,108 @@ func init() { func init() { proto.RegisterFile("go-internal/protocolmodel.proto", fileDescriptor_e2f5bc4155f6089b) } var fileDescriptor_e2f5bc4155f6089b = []byte{ - // 1644 bytes of a gzipped FileDescriptorProto + // 1646 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x6f, 0xdb, 0xc8, 0x15, 0xb7, 0x62, 0x3b, 0x92, 0x9e, 0x24, 0x5b, 0x1e, 0x7b, 0x37, 0xac, 0x93, 0x46, 0x5e, 0x6d, - 0x9b, 0xba, 0x40, 0x2d, 0x61, 0x93, 0x06, 0x29, 0x9c, 0xa0, 0x0b, 0xc9, 0x09, 0xd2, 0x60, 0xd7, + 0xeb, 0xba, 0x45, 0x2d, 0x61, 0x93, 0x06, 0x2e, 0xec, 0xa0, 0x0b, 0xc9, 0x0e, 0xd2, 0x60, 0xd7, 0xb5, 0x4b, 0x39, 0x8b, 0x22, 0x3d, 0x10, 0x14, 0xf9, 0x44, 0x0f, 0x4c, 0xcd, 0xb0, 0xe4, 0x48, - 0x8d, 0x72, 0x29, 0xda, 0x4f, 0xb0, 0xa7, 0xde, 0x7a, 0xef, 0xad, 0xdf, 0xa2, 0xe8, 0xa9, 0xe8, - 0xb1, 0x27, 0x15, 0xd8, 0x9c, 0x7a, 0xd5, 0x27, 0x28, 0xc8, 0x19, 0x4a, 0xa4, 0xfe, 0xd9, 0x4e, - 0xb0, 0x80, 0x4f, 0xd2, 0xcc, 0xfb, 0xbd, 0x37, 0xff, 0x7e, 0xef, 0x37, 0x6f, 0x08, 0x15, 0x87, - 0x1f, 0x50, 0x26, 0xd0, 0x67, 0xa6, 0x5b, 0xf7, 0x7c, 0x2e, 0xb8, 0xc5, 0xdd, 0x2e, 0xb7, 0xd1, - 0xad, 0x45, 0x2d, 0xb2, 0xdd, 0x46, 0x5f, 0x0c, 0x6a, 0x29, 0xd3, 0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, 0x0f, 0x21, 0xe7, 0x21, + 0xa2, 0x81, 0x68, 0x93, 0x17, 0x50, 0x9a, 0x17, 0x00, 0x99, 0xd9, 0x74, 0xd1, 0x8e, 0xc4, 0x27, + 0xa3, 0x3f, 0x9a, 0x19, 0xe3, 0x85, 0xc4, 0x90, 0x87, 0x90, 0x0d, 0xa8, 0x63, 0x58, 0x97, 0x26, + 0x8d, 0xaf, 0x50, 0x99, 0x80, 0x3a, 0xc7, 0x61, 0x9b, 0x78, 0x93, 0x95, 0xe7, 0x67, 0x33, 0x09, + 0x26, 0xd7, 0x5d, 0x71, 0x6b, 0x76, 0x21, 0x76, 0x5d, 0x4d, 0x14, 0xd7, 0x9b, 0x77, 0x87, 0x50, + 0x7f, 0x59, 0x86, 0xfc, 0xf8, 0x87, 0x91, 0xe7, 0xb0, 0x76, 0xab, 0x0a, 0x28, 0x6f, 0x8f, 0xa7, + 0xea, 0x2e, 0xac, 0xc7, 0xde, 0x49, 0x12, 0x15, 0x14, 0x4c, 0x91, 0x67, 0x77, 0x9a, 0xb5, 0xea, + 0xaa, 0x92, 0x64, 0x67, 0x07, 0xd2, 0xf1, 0x43, 0x9f, 0xcc, 0xfd, 0xf2, 0x82, 0xad, 0x89, 0x6f, + 0x1c, 0x07, 0xaa, 0xe6, 0xb8, 0xfd, 0xfe, 0x28, 0xfb, 0xdd, 0xd9, 0x9f, 0x7a, 0xf5, 0xdb, 0xf7, + 0x8f, 0x97, 0xfe, 0xf5, 0xfe, 0xf1, 0xd2, 0xbf, 0xdf, 0x3f, 0x5e, 0x7a, 0xf3, 0x99, 0xfc, 0x78, + 0x81, 0xd6, 0x65, 0xd5, 0xe1, 0xd5, 0xa9, 0xa7, 0x6b, 0xbb, 0xd9, 0xbc, 0x1f, 0xfd, 0x7f, 0xfa, + 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x15, 0xea, 0x93, 0xdb, 0x16, 0x00, 0x00, } diff --git a/go/internal/protocoldb/protocolmodel_test.go b/go/internal/protocoldb/protocolmodel_test.go index 320a0c3fef..de48d0a138 100644 --- a/go/internal/protocoldb/protocolmodel_test.go +++ b/go/internal/protocoldb/protocolmodel_test.go @@ -29,13 +29,13 @@ func TestUsage(t *testing.T) { GroupMemberPubKey: []byte("groupMemberA"), ContactAccountBindingProof: []byte("groupMemberABindingProof"), Devices: []*GroupMemberDevice{ - &GroupMemberDevice{ + { GroupMemberDevicePubKey: []byte("groupMemberDeviceA1"), DerivationState: []byte("groupMemberDeviceA1Derivation"), DerivationCounter: 110, DerivationNextHotp: []byte("groupMemberDeviceA1NextHOTP"), }, - &GroupMemberDevice{ + { GroupMemberDevicePubKey: []byte("groupMemberDeviceA2"), DerivationState: []byte("groupMemberDeviceA2Derivation"), DerivationCounter: 120, @@ -50,13 +50,13 @@ func TestUsage(t *testing.T) { ContactAccountBindingProof: []byte("groupMemberBBindingProof"), Metadata: nil, Devices: []*GroupMemberDevice{ - &GroupMemberDevice{ + { GroupMemberDevicePubKey: []byte("groupMemberDeviceB1"), DerivationState: []byte("groupMemberDeviceB1Derivation"), DerivationCounter: 210, DerivationNextHotp: []byte("groupMemberDeviceB1NextHOTP"), }, - &GroupMemberDevice{ + { GroupMemberDevicePubKey: []byte("groupMemberDeviceB2"), DerivationState: []byte("groupMemberDeviceB2Derivation"), DerivationCounter: 220, @@ -68,7 +68,7 @@ func TestUsage(t *testing.T) { } groupAB := &GroupInfo{ GroupPubKey: []byte("groupAB"), - SharedSecret: []byte("groupABSharedSecret"), + GroupSigningKey: []byte("groupABSigningKey"), Metadata: []byte("groupABMetadata"), Audience: GroupInfo_OneToOne, Version: 42, @@ -98,11 +98,11 @@ func TestUsage(t *testing.T) { PublicRendezvousPointEnabled: true, SigChain: []byte("accountASigChain"), Devices: []*MyselfDevice{ - &MyselfDevice{ + { DevicePubKey: []byte("accountADevice1PubKey"), DevicePrivKey: []byte("accountADevice1PrivateKey"), }, - &MyselfDevice{ + { DevicePubKey: []byte("accountADevice2PubKey"), }, }, diff --git a/go/pkg/errcode/errcode.pb.go b/go/pkg/errcode/errcode.pb.go index 107a003029..3491eb2c60 100644 --- a/go/pkg/errcode/errcode.pb.go +++ b/go/pkg/errcode/errcode.pb.go @@ -46,6 +46,11 @@ const ( ErrHandshakeSessionInvalid ErrCode = 2013 ErrHandshakeKeyNotInSigChain ErrCode = 2014 ErrHandshakeDecrypt ErrCode = 2015 + ErrGroupMemberLogEventOpen ErrCode = 2020 + ErrGroupMemberLogEventSignature ErrCode = 2021 + ErrGroupMemberLogWrongInviter ErrCode = 2022 + ErrGroupMemberUnknownGroupID ErrCode = 2023 + ErrGroupMemberMissingSecrets ErrCode = 2024 ErrBridgeInterrupted ErrCode = 3001 ErrBridgeNotRunning ErrCode = 3002 ) @@ -72,6 +77,11 @@ var ErrCode_name = map[int32]string{ 2013: "ErrHandshakeSessionInvalid", 2014: "ErrHandshakeKeyNotInSigChain", 2015: "ErrHandshakeDecrypt", + 2020: "ErrGroupMemberLogEventOpen", + 2021: "ErrGroupMemberLogEventSignature", + 2022: "ErrGroupMemberLogWrongInviter", + 2023: "ErrGroupMemberUnknownGroupID", + 2024: "ErrGroupMemberMissingSecrets", 3001: "ErrBridgeInterrupted", 3002: "ErrBridgeNotRunning", } @@ -98,6 +108,11 @@ var ErrCode_value = map[string]int32{ "ErrHandshakeSessionInvalid": 2013, "ErrHandshakeKeyNotInSigChain": 2014, "ErrHandshakeDecrypt": 2015, + "ErrGroupMemberLogEventOpen": 2020, + "ErrGroupMemberLogEventSignature": 2021, + "ErrGroupMemberLogWrongInviter": 2022, + "ErrGroupMemberUnknownGroupID": 2023, + "ErrGroupMemberMissingSecrets": 2024, "ErrBridgeInterrupted": 3001, "ErrBridgeNotRunning": 3002, } @@ -117,36 +132,40 @@ func init() { func init() { proto.RegisterFile("errcode.proto", fileDescriptor_4240057316120df7) } var fileDescriptor_4240057316120df7 = []byte{ - // 482 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0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 0xd7, 0xd9, 0xee, 0x7f, 0x80, 0x89, 0x0e, 0x8c, 0x74, 0x19, 0x21, 0x7c, 0x5f, 0xc9, - 0x98, 0x60, 0x39, 0xa1, 0x9a, 0x84, 0x1f, 0x2b, 0x19, 0x47, 0x98, 0x17, 0x2d, 0x30, 0xcb, 0xc9, - 0xc1, 0x4f, 0x2e, 0x2e, 0xb1, 0xed, 0x26, 0x32, 0xc0, 0x19, 0xe5, 0x89, 0x83, 0x5f, 0xbc, 0xfe, - 0xe2, 0x7d, 0xd2, 0x2a, 0xc0, 0xb2, 0x24, 0x94, 0x25, 0x45, 0x73, 0x5e, 0xb6, 0xeb, 0x43, 0x95, - 0xe5, 0x5b, 0x77, 0x9c, 0x19, 0xa3, 0x4d, 0x00, 0xaf, 0xda, 0xfb, 0xdd, 0xd7, 0xbf, 0xaf, 0xae, - 0x3d, 0xda, 0xa9, 0x5a, 0xed, 0x70, 0x16, 0xf6, 0x8b, 0x12, 0x2f, 0x82, 0x7e, 0xdd, 0xf0, 0xe9, - 0x46, 0xd9, 0xdc, 0x7b, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x57, 0xe8, 0x26, 0x08, 0x03, - 0x00, 0x00, + // 555 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xdb, 0x4e, 0x14, 0x4f, + 0x10, 0xc6, 0xb9, 0xf8, 0xff, 0x21, 0xb4, 0x21, 0x5d, 0x36, 0xea, 0x0a, 0xa2, 0x78, 0xba, 0x30, + 0x26, 0xb2, 0x17, 0x3e, 0x01, 0xb0, 0x8b, 0x6e, 0x90, 0x5d, 0xc2, 0x42, 0x4c, 0xbc, 0xeb, 0xdd, + 0x2e, 0x66, 0x3b, 0xcc, 0x54, 0x4f, 0x6a, 0x7a, 0x20, 0xe3, 0x1b, 0xf8, 0x0a, 0xbe, 0x89, 0x5e, + 0xf9, 0x08, 0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