[tor-bugs] #18318 [Tor]: Make sure keys and IP:Ports are unique in a consensus

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Mar 19 23:56:32 UTC 2016


#18318: Make sure keys and IP:Ports are unique in a consensus
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:  nickm
     Type:  defect                               |         Status:
 Priority:  Very High                            |  needs_review
Component:  Tor                                  |      Milestone:  Tor:
 Severity:  Blocker                              |  0.2.8.x-final
 Keywords:  TorCoreTeam201602, must-fix-         |        Version:
  before-028-rc, 027-backport                    |     Resolution:
Parent ID:  #17668                               |  Actual Points:
 Reviewer:                                       |         Points:
                                                 |        Sponsor:  None
-------------------------------------------------+-------------------------

Comment (by teor):

 Can we do the tie-breaker the same we we did in #17688?
 Or is that not an issue for IP addresses and ports?
 (I haven't had a chance to review this code yet, but I'd like to.)

 From comments 38/44 in #17688, labelled T3 in that issue:
 > > This check preserves the existing digestmap entry if the published
 times are equal. But different authorities could choose different
 descriptors-with-identical-published-times, depending on the order they
 arrived at the authority.
 > > So let's find a consistent way of selecting a descriptor to omit if
 their published times are identical - how about comparing
 signed_descriptor_digest? (And if the digests are identical, it really
 doesn't matter which descriptor we omit, because they have the same
 content.)
 >
 > Good idea; Calling it `T3`.
 >
 > > We should do the same tie-breaking in the IP:Port checks too.
 > > {{{
 > > +    if ((ri2 = digest256map_get(by_ed_key, pk))) {
 > > +      /* Duplicate; must omit one.  Omit the earlier. */
 > > +      if (ri2->cache_info.published_on < ri->cache_info.published_on)
 {
 > > +        digest256map_set(by_ed_key, pk, ri);
 > > +        ri2->omit_from_vote = 1;
 > > +      } else {
 > > +        ri->omit_from_vote = 1;
 > > +      }
 > > }}}

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


More information about the tor-bugs mailing list