[tor-bugs] #9309 [Tor]: broken canonical connection detection in channel_matches_target_addr_for_extend()

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jul 23 09:29:19 UTC 2013


#9309: broken canonical connection detection in
channel_matches_target_addr_for_extend()
--------------------------------+-------------------------------------------
 Reporter:  asn                 |          Owner:                    
     Type:  defect              |         Status:  new               
 Priority:  normal              |      Milestone:  Tor: 0.2.4.x-final
Component:  Tor                 |        Version:                    
 Keywords:  tor-client channel  |         Parent:                    
   Points:                      |   Actualpoints:                    
--------------------------------+-------------------------------------------
Changes (by nickm):

 * cc: andrea (added)
  * milestone:  Tor: 0.2.5.x-final => Tor: 0.2.4.x-final


Comment:

 I think that the name might be inverted for the behavior.  That could be
 leading to some confusion.
 Here's the current code:
 {{{
     if (!channel_is_canonical(chan) &&
          channel_is_canonical_is_reliable(chan) &&
         !channel_matches_target_addr_for_extend(chan, target_addr)) {
       ++n_noncanonical;
       continue;
     }
 }}}
 and the implementation it's calling:
 {{{
 static int
 channel_tls_matches_target_method(channel_t *chan,
                                   const tor_addr_t *target)
 {
   channel_tls_t *tlschan = BASE_CHAN_TO_TLS(chan);
   /* ... */
   return tor_addr_compare(&(tlschan->conn->real_addr),
                           target, CMP_EXACT);
 }
 }}}

 Here's the old code:
 {{{
     if (!conn->is_canonical && conn->link_proto >= 2 &&
         tor_addr_compare(&conn->real_addr, target_addr, CMP_EXACT)) {
       ++n_noncanonical;
       continue;
     }
 }}}

 I think that there should be a negation in
 channel_matches_target_addr_for_extend.

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


More information about the tor-bugs mailing list