Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

make the error check for not receiving a public key more explicit #34

Merged
merged 1 commit into from
Nov 12, 2019

Conversation

marten-seemann
Copy link
Collaborator

No description provided.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Also, we may want to really carefully test this code...

@@ -104,6 +104,7 @@ func (t *Transport) handshake(
select {
case remotePubKey = <-keyCh:
default:
return nil, errors.New("go-libp2p-tls BUG: expected remote pub key to be set")
Copy link
Member

Choose a reason for hiding this comment

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

This previously implicitly checked if the channel was closed before returning a key. We still need to check that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for catching this. Using a chan to return the key seems a bit error-prone...

@Stebalien Stebalien merged commit 8afeaef into master Nov 12, 2019
@Stebalien Stebalien deleted the no-key-error-check branch November 12, 2019 00:06
This was referenced Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants