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

fix(identify): validate public key from remote peer #5707

Merged
merged 8 commits into from
Dec 13, 2024

Conversation

jameshiew
Copy link
Contributor

@jameshiew jameshiew commented Nov 30, 2024

Description

Related #5706

Discard Info messages received from a remote peer that contain a public key that doesn't match their peer ID, and log a warning. Don't emit identify::Received events to the swarm containing whatever public key they sent.

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

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

Thanks @jameshiew!

One comment, rest looks good to me!

protocols/identify/src/handler.rs Outdated Show resolved Hide resolved
@jameshiew jameshiew marked this pull request as ready for review December 4, 2024 19:09
Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks @jameshiew!

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this James. Only one minor thing left.

protocols/identify/tests/smoke.rs Show resolved Hide resolved
protocols/identify/src/handler.rs Show resolved Hide resolved
Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! ❤️

protocols/identify/tests/smoke.rs Show resolved Hide resolved
@jxs jxs added the send-it label Dec 13, 2024
@mergify mergify bot merged commit c8c1b80 into libp2p:master Dec 13, 2024
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants