[tor-bugs] #14581 [Tor]: Looking up entry nodes by ID results in a collision when we use transports

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Jan 31 08:20:15 UTC 2015


#14581: Looking up entry nodes by ID results in a collision when we use transports
--------------------+------------------------------------
 Reporter:  sysrqb  |          Owner:
     Type:  defect  |         Status:  new
 Priority:  normal  |      Milestone:  Tor: 0.2.7.x-final
Component:  Tor     |        Version:
 Keywords:          |  Actual Points:
Parent ID:          |         Points:
--------------------+------------------------------------
 As mentioned by arma in #14216
 [https://trac.torproject.org/projects/tor/ticket/14216#comment:3 comment
 3].

 Basically, whenever we try to look up a bridge by ID we may not choose the
 one we want. If we configured multiple pluggable transports for the same
 bridge, each PT will be associated with the same ID. We usually stop
 searching when we find a matching ID in the list, but the first match may
 not be the transport we wanted.

 As an example, node_is_a_configured_bridge():
 {{{
 int
 node_is_a_configured_bridge(const node_t *node)
 {
   int retval = 0;
   smartlist_t *orports = node_get_all_orports(node);
   retval = get_configured_bridge_by_orports_digest(node->identity,
                                                    orports) != NULL;
 }}}

 calls get_configured_bridge_by_orports_digest()
 {{{
 static bridge_info_t *
 get_configured_bridge_by_orports_digest(const char *digest,
                                         const smartlist_t *orports)
 {
   if (!bridge_list)
     return NULL;
   SMARTLIST_FOREACH_BEGIN(bridge_list, bridge_info_t *, bridge)
     {
       if (tor_digest_is_zero(bridge->identity)) {
         SMARTLIST_FOREACH_BEGIN(orports, tor_addr_port_t *, ap)
           {
             if (tor_addr_compare(&bridge->addr, &ap->addr, CMP_EXACT) == 0
 &&
                 bridge->port == ap->port)
               return bridge;
           }
         SMARTLIST_FOREACH_END(ap);
       }
       if (digest && tor_memeq(bridge->identity, digest, DIGEST_LEN))
         return bridge;
     }
 }}}

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


More information about the tor-bugs mailing list