[tor-bugs] #20657 [Core Tor/Tor]: prop224: Implement service support.

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Jan 21 10:10:57 UTC 2017


#20657: prop224: Implement service support.
-----------------------------+------------------------------------
 Reporter:  dgoulet          |          Owner:
     Type:  enhancement      |         Status:  new
 Priority:  Medium           |      Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor     |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:  tor-hs, prop224  |  Actual Points:
Parent ID:  #12424           |         Points:  parent
 Reviewer:                   |        Sponsor:  SponsorR-must
-----------------------------+------------------------------------

Comment (by asn):

 Hey David, I noticed what you said on IRC about the hash function only
 taking `token` as input and not the `token_type`. I think you are right on
 this. However, I think this does not influence the correctness of the hash
 table, since the hashing function is not collision resistant anyway (its
 output is only 4 bytes), so collisions are hanlded by putting the
 colliding elements in the same bucket and then running the equality
 function on the whole bucket. This means that if an HS is also a relay and
 it receives a double token, the hash table code will put both tokens in
 the same bucket and then it will filter the right one using
 `hs_circuits_have_same_token()`. I expanded the unittests as well to check
 this case.

 BTW, if we want to fix this in a deeper manner, we could expand
 `hs_circuit_hash_token()` by making it hash the token_type as well. I
 decided to not do this because I would have to do it with malloc and
 memcpy, and I thought it's too much of a hassle since the function is not
 really collision resistant in the first place.

 Let me know if you think the above is wrong. I don't mind doing the
 changes to `hs_circuit_hash_token()` if you prefer that approach.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20657#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list