[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #1090 [Tor Client]: Warning about using an excluded node for exit



#1090: Warning about using an excluded node for exit
---------------------------+------------------------------------------------
    Reporter:  Sebastian   |       Owner:  nickm             
        Type:  defect      |      Status:  needs_review      
    Priority:  major       |   Milestone:  Tor: 0.2.2.x-final
   Component:  Tor Client  |     Version:  0.2.1.19          
  Resolution:  None        |    Keywords:                    
      Parent:              |      Points:                    
Actualpoints:              |  
---------------------------+------------------------------------------------

Comment(by arma):

 c45819dc98 is tricky, because there are some places in the code that
 check if intro_nodes is empty to decide if the rend descriptor isn't
 worth trying to connect to. I think these are the three:

 rend_cache_lookup_entry() checks
 {{{
   /* XXX023 hack for now, to return "not found" if there are no intro
    * points remaining. See bug 997. */
   if (smartlist_len((*e)->parsed->intro_nodes) == 0)
     return 0;
 }}}

 and rend_client_remove_intro_point() checks
 {{{
   if (smartlist_len(ent->parsed->intro_nodes) == 0) {
     log_info(LD_REND,
              "No more intro points remain for %s. Re-fetching
 descriptor.",
              escaped_safe_str_client(rend_query->onion_address));
     rend_client_refetch_v2_renddesc(rend_query);
 [...]
 }}}

 and rend_client_desc_trynow() which checks
 {{{
     if (rend_cache_lookup_entry(conn->rend_data->onion_address, -1,
                                 &entry) == 1 &&
         smartlist_len(entry->parsed->intro_nodes) > 0) {
       /* either this fetch worked, or it failed but there was a
        * valid entry from before which we should reuse */
       log_info(LD_REND,"Rend desc is usable. Launching circuits.");
       conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT;
 [...]
 }}}

 (Note how the first and third examples here are actually redundant,
 i.e. the third case checks something that will always be true based on
 the first.)

 I think we can replace these "> 0" checks with a call to something that
 tries to pick one and returns failure if it wouldn't pick any. Maybe
 rend_client_get_random_intro_impl() then wants to get handed
 {{{
 rend_cache_entry_t *entry
 }}}
 instead of
 {{{
 const rend_data_t *rend_query
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1090#comment:52>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs