[tor-bugs] #16389 [Tor]: Redesign the HS client descriptor cache

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jun 22 20:34:57 UTC 2015


#16389: Redesign the HS client descriptor cache
-------------------------+--------------------------------
     Reporter:  dgoulet  |      Owner:
         Type:  defect   |     Status:  needs_revision
     Priority:  major    |  Milestone:  Tor: 0.2.7.x-final
    Component:  Tor      |    Version:
   Resolution:           |   Keywords:  SponsorR, tor-hs
Actual Points:           |  Parent ID:  #16381
       Points:           |
-------------------------+--------------------------------
Changes (by nickm):

 * status:  needs_review => needs_revision


Comment:

 Suggestions:

   * I would be more cormfortable if cache_failure_intro_lookup set *entry
 to NULL on lookup failure.  Leaving it unset seems error-prone to me.
   * use uint8_t* for pointers to bytes, and char* for pointers to text.
 So, if you're going to pass it as a key for a strmap, have it be char*; if
 you're going to pass it as a key for a digestmap, have it be uint8_t.  And
 document what format each argument is in in the documentation, how long it
 should be, etc.
   * Make a rend_cache_failure_entry_new() and
 rend_cache_failure_entry_free(), even if they're just wrappers around
 tor_malloc and tor_free.  This will make the structure easier to maintain
 if you add anything else to it.
   * As above but for rend_cache_failure_intro_t
   * In cache_failure_intro_add, maybe only add fail_entry to
 rend_cache_failure if it's new?
   * should "unsigned int failure" be an enum?
   * Does the new "goto_err" in rend_cache_store_v2_desc_as_client()
 correctly make us close all the pending connections?

 Bigger issues:
   * Should "signal NEWNYM" affect this cache?  Guessing yes.
   * Should the entries in this cache ever expire?  I think probably yes.
   * Removing the timestamp check in rend_cache_store_v2_desc_as_client()
 makes me worry about replacing a newer descriptor with an older one.
 Should I be worried about that?

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


More information about the tor-bugs mailing list