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

Peer group feature #10

Merged
merged 96 commits into from
Nov 28, 2019
Merged

Peer group feature #10

merged 96 commits into from
Nov 28, 2019

Conversation

tok-kkk
Copy link
Member

@tok-kkk tok-kkk commented Nov 20, 2019

  • Introduce PeerGroup which is a group of PeerIDs. When sending messages, you can specify the target nodes by a PeerGroupID.
  • Add unit tests for each package and an integration tests in the Peer package
  • Set up circleCI and coverall so that we can't ignore fail CI anymore.
  • Fix some issues discovered by the tests.

@tok-kkk tok-kkk requested review from loongy and susruth and removed request for loongy November 20, 2019 22:46
broadcast/broadcast.go Outdated Show resolved Hide resolved
dht/dht.go Outdated Show resolved Hide resolved
dht/dht.go Outdated Show resolved Hide resolved
multicast/multicast.go Outdated Show resolved Hide resolved
peer/peer.go Outdated Show resolved Hide resolved
protocol/marshal.go Outdated Show resolved Hide resolved
protocol/message.go Outdated Show resolved Hide resolved
tcp/conn.go Outdated Show resolved Hide resolved
tcp/conn.go Outdated Show resolved Hide resolved
tcp/tcp.go Show resolved Hide resolved
@tok-kkk
Copy link
Member Author

tok-kkk commented Nov 28, 2019

Have made changes according to the comments above, please have a another review @loongy.

For the handshake process , I change the RSA key to ECDSA for encryption and decryption
Now the handshake process is:
1. Client generates a new ECDSA key and writes it to the server.
2. Server verifies the key -> generates a new ECDSA key -> writes it to the client
3. Client verifies the key -> generates a new session key -> encrypts it with Server's ECDSA key - > sends to server
4. Server decrypted the session key -> generates a new session key -> encrypts it with Client's ECDSA key - > sends to client
5. Client decrypted the session key and use the XOR result of both session keys to creating a session

Not sure if the client needs to respond to the server to confirm it gets the server's session key ?

@loongy
Copy link
Contributor

loongy commented Nov 28, 2019

@tok-kkk no need for explicit confirmation. The first non-handshake message to be sent on the wire is an implicit confirmation.

@loongy
Copy link
Contributor

loongy commented Nov 28, 2019

Server verifies the key

@tok-kkk what do you mean by this?

@tok-kkk
Copy link
Member Author

tok-kkk commented Nov 28, 2019

@loongy It sends the new ECDSA key along with a signature(signed by the key which generates his PeerID). So the server can extract the PeerID from the signature and verifies the sender is valid.

@tok-kkk tok-kkk removed the request for review from susruth November 28, 2019 03:48
@tok-kkk tok-kkk merged commit bc825e1 into master Nov 28, 2019
@tok-kkk tok-kkk deleted the feat/peergroup branch November 28, 2019 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants