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

BEP-42: DHT security extension #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charlescharles
Copy link

http://www.bittorrent.org/beps/bep_0042.html. this PR is just for review; it's definitely not complete.

some stuff to sort out:

  • setting the DHT node ID: it seems like socket.createSocket happens async and calling socket.address() in the constructor causes an exception. setting the node ID in socket.on 'listening' is problematic because other stuff like _debug also uses nodeId. is there another way to get the address?
  • what to do when we think our node ID may be incorrect -- e.g., you receive messages with ip field different from you think yours is -- libtorrent doesn't seem to do anything about this
  • what else to do if we see nodes with invalid node ids -- right now it just refrains from adding the node to the routing table.

@feross

@@ -266,14 +276,17 @@ DHT.prototype.destroy = function (cb) {
}

/**
* Add a DHT node to the routing table.
* Add a DHT node to the routing table unless the nodeID doesn't match
* their address and we're enforcing nodeID security.
Copy link

Choose a reason for hiding this comment

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

If you read the enforcement section of BEP42 you will notice that it only mentions lookups, not routing table maintenance.

I.e. as written it does not to exclude nodes from the overlay itself, only ignores them as store-targets to avoid eclipse attacks.

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.

2 participants