Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic for subgroup branching #151

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ go 1.16
require (
github.com/google/uuid v1.1.2
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.29.1
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 // indirect
google.golang.org/protobuf v1.30.0
)
40 changes: 40 additions & 0 deletions interop/configs/branch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"scripts": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other combinations: with extensions and external tree etc. (there are 8 combinations)? Probably doesn't matter much, just for completeness.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"base": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{"action": "branch", "actor": "alice", "members": ["bob", "charlie", "diana", "eliza"]}
],

"with_extensions": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{"action": "branch", "actor": "alice", "members": ["bob", "charlie", "diana", "eliza"],
"extensions": [{"extension_type": 3, "extension_data": "AAAA"}, {"extension_type": 5, "extension_data": "AA=="} ]}
Comment on lines +18 to +19
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a way to check that extensions have been injected? Maybe an RPC GetGCEs where the actor returns repeated Extension extensions? I'm worried that implementation 1 can't generate GCEs and creates a branch without them, which cant be noticed by other implementations

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

],

"external_tree": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{"action": "branch", "actor": "alice", "members": ["bob", "charlie", "diana", "eliza"], "externalTree": true}
],

"force_path": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{"action": "branch", "actor": "alice", "members": ["bob", "charlie", "diana", "eliza"], "forcePath": true}
]
}
}
104 changes: 104 additions & 0 deletions interop/configs/reinit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"scripts": {
"change_ciphersuite": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{
"action": "reinit",
"proposer": "alice",
"committer": "bob",
"welcomer": "charlie",
"members": ["diana", "eliza"],
"changeCiphersuite": true
}
],

"change_group_id": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{
"action": "reinit",
"proposer": "alice",
"committer": "bob",
"welcomer": "charlie",
"members": ["diana", "eliza"],
"changeGroupID": true
}
],

"change_extensions": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{
"action": "reinit",
"proposer": "alice",
"committer": "bob",
"welcomer": "charlie",
"members": ["diana", "eliza"],
"extensions": [
{"extension_type": 3, "extension_data": "AAAA"},
{"extension_type": 5, "extension_data": "AA=="}
]
}
],

"all_same_actor": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{
"action": "reinit",
"proposer": "alice",
"committer": "alice",
"welcomer": "alice",
"members": ["bob", "charlie", "diana", "eliza"],
"changeGroupID": true
}
],

"external_tree": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{
"action": "reinit",
"proposer": "alice",
"committer": "bob",
"welcomer": "charlie",
"members": ["diana", "eliza"],
"changeGroupID": true,
"externalTree": true
}
],

"force_path": [
{"action": "createGroup", "actor": "alice"},
{"action": "externalJoin", "actor": "alice", "joiner": "bob", "members": []},
{"action": "externalJoin", "actor": "alice", "joiner": "charlie", "members": ["bob"]},
{"action": "externalJoin", "actor": "alice", "joiner": "diana", "members": ["bob", "charlie"]},
{"action": "externalJoin", "actor": "alice", "joiner": "eliza", "members": ["bob", "charlie", "diana"]},
{
"action": "reinit",
"proposer": "alice",
"committer": "bob",
"welcomer": "charlie",
"members": ["diana", "eliza"],
"changeGroupID": true,
"forcePath": true
}
]
}
}
93 changes: 85 additions & 8 deletions interop/proto/mls_client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,23 @@ service MLSClient {
rpc RemoveProposal(RemoveProposalRequest) returns (ProposalResponse) {}
rpc ExternalPSKProposal(ExternalPSKProposalRequest) returns (ProposalResponse) {}
rpc ResumptionPSKProposal(ResumptionPSKProposalRequest) returns (ProposalResponse) {}
rpc ReInitProposal(ReInitProposalRequest) returns (ProposalResponse) {}
rpc GroupContextExtensionsProposal(GroupContextExtensionsProposalRequest) returns (ProposalResponse) {}

rpc Commit(CommitRequest) returns (CommitResponse) {}
rpc HandleCommit(HandleCommitRequest) returns (HandleCommitResponse) {}
rpc HandlePendingCommit(HandlePendingCommitRequest) returns (HandleCommitResponse) {}

// Reinitialization
rpc ReInitProposal(ReInitProposalRequest) returns (ProposalResponse) {}
rpc ReInitCommit(CommitRequest) returns (CommitResponse) {}
rpc HandlePendingReInitCommit(HandlePendingCommitRequest) returns (HandleReInitCommitResponse) {}
rpc HandleReInitCommit(HandleCommitRequest) returns (HandleReInitCommitResponse) {}
rpc ReInitWelcome(ReInitWelcomeRequest) returns (ReInitWelcomeResponse) {}
rpc HandleReInitWelcome(HandleReInitWelcomeRequest) returns (JoinGroupResponse) {}

// Subgroup Branching
rpc CreateBranch(CreateBranchRequest) returns (CreateBranchResponse) {}
rpc HandleBranch(HandleBranchRequest) returns (HandleBranchResponse) {}
}

// rpc Name
Expand Down Expand Up @@ -211,13 +222,6 @@ message ResumptionPSKProposalRequest {
uint64 epoch_id = 2;
}

// rpc ReInitProposal
message ReInitProposalRequest {
uint32 state_id = 1;
bytes group_id = 2;
uint32 cipher_suite = 3; // actually uint16
}

// rpc GroupContextExtensionsProposal
message Extension {
uint32 extension_type = 1;
Expand Down Expand Up @@ -270,3 +274,76 @@ message HandleCommitResponse {
message HandlePendingCommitRequest {
uint32 state_id = 1;
}

// rpc ReInitProposal
message ReInitProposalRequest {
uint32 state_id = 1;
uint32 cipher_suite = 2;
bytes group_id = 3;
repeated Extension extensions = 4;
}

// rpc ReInitCommit
// (uses CommitRequest / CommitResponse)

// rpc HandlePendingReInitCommit
// rpc HandleReInitCommit
// (uses HandleCommitRequest)
message HandleReInitCommitResponse {
uint32 reinit_id = 1;
bytes key_package = 2;
bytes epoch_authenticator = 3;
}

// rpc ReInitWelcome
message ReInitWelcomeRequest {
uint32 reinit_id = 1;
repeated bytes key_package = 2;
bool force_path = 3;
bool external_tree = 4;
}

message ReInitWelcomeResponse {
uint32 state_id = 1;
bytes welcome = 2;
bytes ratchet_tree = 3;
bytes epoch_authenticator = 4;
}

// rpc HandleReInitWelcome
message HandleReInitWelcomeRequest {
uint32 reinit_id = 1;
bytes welcome = 2;
bytes ratchet_tree = 3;
}


// rpc CreateBranch
message CreateBranchRequest {
uint32 state_id = 1;
bytes group_id = 2;
repeated Extension extensions = 3;
repeated bytes key_packages = 4;
bool force_path = 5;
bool external_tree = 6;
}

message CreateBranchResponse {
uint32 state_id = 1;
bytes welcome = 2;
bytes ratchet_tree = 3;
bytes epoch_authenticator = 4;
}

// rpc CreateBranch
message HandleBranchRequest {
uint32 state_id = 1;
uint32 transaction_id = 2;
bytes welcome = 3;
bytes ratchet_tree = 4;
}

message HandleBranchResponse {
uint32 state_id = 1;
bytes epoch_authenticator = 2;
}
Loading