[tor-bugs] #20509 [Core Tor/Tor]: Directory authorities should take away Guard flag from relays with #20499 bug

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Nov 9 16:42:01 UTC 2016


#20509: Directory authorities should take away Guard flag from relays with #20499
bug
-------------------------------------------------+-------------------------
 Reporter:  arma                                 |          Owner:
     Type:  defect                               |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.2.9.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.2.9.1-alpha
 Severity:  Normal                               |     Resolution:
 Keywords:  028-backport, easy,                  |  Actual Points:
  TorCoreTeam201611                              |
Parent ID:                                       |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by rubiate):

 Here's the updated function:

 {{{
 +/** Check if the Tor version provided in the platform string
 <b>platform</b> is
 + * known to be broken in a way that means it should not be used as a
 Guard.
 + *
 + * Return 0 if it should be good, or 1 if it is known to be broken.
 + */
 +STATIC int
 +is_broken_guard_version(const char *platform)
 +{
 +  tor_version_t parsed_platform, parsed_0300_alpha_dev;
 +
 +  /* assume it's good if we don't know the platform/version */
 +  if (platform == NULL)
 +    return 0;
 +
 +  /* assume it's good if we can't parse the version */
 +  if (tor_version_parse(platform, &parsed_platform) == -1)
 +    return 0;
 +
 +  /* this version string should always be able to be parsed */
 +  if (BUG(tor_version_parse("Tor 0.3.0.0-alpha-dev",
 +                            &parsed_0300_alpha_dev) == -1)) {
 +    return 0;
 +  }
 +
 +  /* bug #20499 affects versions from 0.2.9.1-alpha-dev
 +   * to 0.2.9.4-alpha-dev and version 0.3.0.0-alpha-dev
 +   */
 +  if (tor_version_compare(&parsed_platform, &parsed_0300_alpha_dev) == 0)
 +    return 1;
 +
 +  if (!tor_version_as_new_as(platform, "Tor 0.2.9.1-alpha-dev"))
 +    return 0;
 +
 +  if (tor_version_as_new_as(platform, "Tor 0.2.9.5-alpha"))
 +    return 0;
 +
 +  return 1;
 +}
 }}}

 Replying to [comment:16 arma]:
 > Also, rubiate, have you gotten to the point where you should make a Tor
 git repo somewhere and point us to those branches? :)

 I guess so, since you asked!

 I've set up a repo at `https://viennan.net/git/tor.git` and there's a
 branch called `ticket20509` with the complete patch.

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


More information about the tor-bugs mailing list