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

add the peer ID to SecureInbound #104

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Conversation

marten-seemann
Copy link
Contributor

@@ -243,7 +243,7 @@ func (s *secureSession) handleRemoteHandshakePayload(payload []byte, remoteStati
}

// if we know who we're trying to reach, make sure we have the right peer
if s.initiator && s.remoteID != id {
Copy link
Member

Choose a reason for hiding this comment

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

Don't we want to assert that we know the remote peer ID if we're the initiator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to get to the point where we can dial a multiaddr and learn the remote peer ID from the handshake, but this PR is probably not the place to work towards that. Will adjust the logic.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I agree. We just need to be careful about that to make sure we can't get tricked into dialing the wrong peer.

Although I guess we enforce this in the swarm so it's probably not an issue.

@marten-seemann marten-seemann merged commit c35ec2c into master Sep 8, 2021
@marten-seemann marten-seemann deleted the check-peer-id-on-inbound branch September 20, 2021 17:12
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
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.

2 participants