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

protocols/kad: Do not attempt to store expired record in record store #1496

Merged
merged 4 commits into from
Mar 18, 2020

Commits on Mar 12, 2020

  1. protocols/kad: Do not attempt to store expired record in record store

    `Kademlia::record_received` calculates the expiration time of a record
    before inserting it into the record store. Instead of inserting the
    record into the record store in any case, with this patch the record is
    only inserted if it is not expired. If the record is expired a
    `KademliaHandlerIn::Reset` for the given (sub) stream is triggered.
    
    This would serve as a tiny defense mechanism against an attacker trying
    to fill a node's record store with expired records before the record
    store's clean up procedure removes the records.
    mxinden committed Mar 12, 2020
    Configuration menu
    Copy the full SHA
    d8e61ef View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2020

  1. protocols/kad: Send regular ack when record discarded due to expiration

    With this commit the remote receives a
    [`KademliaHandlerIn::PutRecordRes`] even in the case where the record is
    discarded due to being expired.  Given that the remote sent the local
    node a [`KademliaHandlerEvent::PutRecord`] request, the remote perceives
    the local node as one node among the k closest nodes to the target.
    Returning a [`KademliaHandlerIn::Reset`] instead of an
    [`KademliaHandlerIn::PutRecordRes`] to have the remote try another node
    would only result in the remote node to contact an even more distant
    node. In addition returning [`KademliaHandlerIn::PutRecordRes`] does not
    reveal any internal information to a possibly malicious remote node.
    mxinden committed Mar 13, 2020
    Configuration menu
    Copy the full SHA
    103cdd8 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2020

  1. Configuration menu
    Copy the full SHA
    960d3a3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bfc4707 View commit details
    Browse the repository at this point in the history