[tor-bugs] #6031 [Tor Hidden Services]: Distinguish when a Tor HS is "not found" vs "not reachable" (exists / does not exists)

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sat Jun 16 11:15:13 UTC 2012


#6031: Distinguish when a Tor HS is "not found" vs "not reachable" (exists / does
not exists)
---------------------------------+------------------------------------------
 Reporter:  naif                 |          Owner:                
     Type:  enhancement          |         Status:  needs_revision
 Priority:  normal               |      Milestone:                
Component:  Tor Hidden Services  |        Version:                
 Keywords:                       |         Parent:                
   Points:                       |   Actualpoints:                
---------------------------------+------------------------------------------
Changes (by rransom):

  * status:  new => needs_revision


Comment:

 Replying to [comment:7 hellais]:
 > I wrote a patch for this, you can find it inside of the feature-6031
 branch here:
 https://gitweb.torproject.org/user/art/tor.git/shortlog/refs/heads/feature-6031
 >
 > The behavior I ended up choosing was REP code 0x23 for HS_NOT_FOUND and
 0x24 for HS_UNREACHABLE.
 >
 > I have a few questions though:
 > Is it sufficient to have reached to the end of
 rend_client_refetch_v2_renddesc() to determine that the HS does not exist?

 Probably.

 > For passing to rend_client_desc_trynow (that from what I understand,
 must be called to close also the pending connections) the fact that I am
 failing because the HS does not exist I replace the query with the string
 "hostnotfound". This is kind of hackish and may create problems when
 invoking rend_cmp_service_ids in rend_client_desc_trynow, what is the
 better way to do this?

 `s/kind of hackish/completely and utterly broken/`

  * Throw away that patch entirely.
  * In `rend_client_desc_trynow`, replace “`if (rend_cache_`” through “`{`”
 with:
 {{{
     rend_cache_lookup_entry(rend_data->onion_address, -1, &entry);
     if (entry != NULL &&
         rend_client_any_intro_points_usable(entry)) {
 }}}
  * Before the corresponding “`} else {`”, add:
 {{{
     } else if (entry == NULL) {
       /* We couldn't get a descriptor for this HS at all; maybe it doesn't
 exist. */
       /* FIXME CLOSE STREAMS WITH APPROPRIATE REASON */
 }}}
  * After the “`} else {`”, add:
 {{{
       /* We got a descriptor, but either (a) the HS published no intro
 points (i.e. it was shut down cleanly) or (b) we tried all the intro
 points it listed, and they failed. */
 }}}
  * Fix the `FIXME` comment.
  * Wrap comments to 79 columns or less, so that `make check-spaces` won't
 complain.
  * Actually test your patch at least once or twice.
  * Remember to mark the ticket as `needs_review` once you've pushed a new
 branch.

 > Is overall the strategy for determining if a HS exists or is unreachable
 valid?

 Probably.

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


More information about the tor-bugs mailing list