Skip to content

Commit

Permalink
feat: network flow for handshake + removed testify
Browse files Browse the repository at this point in the history
  • Loading branch information
glouvigny committed Oct 14, 2019
1 parent 60af36f commit 3767e3b
Show file tree
Hide file tree
Showing 26 changed files with 2,263 additions and 1,418 deletions.
24 changes: 22 additions & 2 deletions api/entity.proto
Expand Up @@ -3,14 +3,34 @@ syntax = "proto3";

option go_package = "berty.tech/go/pkg/bertyprotocol";

import "google/protobuf/timestamp.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";

message Device {
bytes device_pub_key = 1;
bytes account_pub_key = 2;
}

message SigChainEntry {}
message SigChainEntry {
enum SigChainEntryType {
SigChainEntryTypeUndefined = 0;
SigChainEntryTypeInitChain = 1;
SigChainEntryTypeAddKey = 2;
SigChainEntryTypeRemoveKey = 3;
}

bytes entry_hash = 1;
SigChainEntryType entry_type_code = 2;
bytes parent_entry_hash = 3;
google.protobuf.Timestamp created_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp expiring_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
bytes signer_public_key_bytes = 6;
bytes subject_public_key_bytes = 7;
bytes signature = 8;
}
message SigChain {
repeated SigChainEntry entries = 1;
bytes id = 1 [(gogoproto.customname) = "ID"];
repeated SigChainEntry entries = 2;
}

message Contact {
Expand Down
13 changes: 0 additions & 13 deletions api/internal/crypto_sigchain.proto

This file was deleted.

26 changes: 0 additions & 26 deletions api/internal/crypto_sigchain_entry.proto

This file was deleted.

37 changes: 37 additions & 0 deletions api/internal/handshake.proto
@@ -0,0 +1,37 @@
syntax = "proto3";

package handshake;

option go_package = "berty.tech/go/internal/handshake";

import "entity.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";

message HandshakeFrame {
enum HandshakeStep {
STEP_1_KEY_AGREEMENT = 0;
STEP_2_KEY_AGREEMENT = 1;

STEP_3_DISPATCH = 10; // Should not be used directly

STEP_3A_KNOWN_IDENTITY_PROOF = 20;
STEP_4A_KNOWN_IDENTITY_DISCLOSURE = 21;
STEP_5A_KNOWN_IDENTITY_DISCLOSURE = 22;

STEP_3B_KNOWN_DEVICE_PROOF = 30;
STEP_4B_KNOWN_DEVICE_DISCLOSURE = 31;

STEP_9_DONE = 999; // Should not be used directly
}

HandshakeStep step = 1;
bytes signatureKey = 2;
bytes encryptionKey = 3;
bytes encryptedPayload = 4;
}

message HandshakePayload {
bytes signature = 1;
SigChain sigChain = 2;
bytes deviceKey = 3;
}
5 changes: 2 additions & 3 deletions docs/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions go/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion go/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3767e3b

Please sign in to comment.