[tor-bugs] #25605 [Core Tor/Tor]: Rust protover::compute_for_old_tor() always says the version is newer than 0.2.9.3-alpha

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Mar 23 02:29:50 UTC 2018


#25605: Rust protover::compute_for_old_tor() always says the version is newer than
0.2.9.3-alpha
------------------------------+--------------------------------
     Reporter:  isis          |      Owner:  isis
         Type:  defect        |     Status:  assigned
     Priority:  High          |  Milestone:  Tor: 0.3.3.x-final
    Component:  Core Tor/Tor  |    Version:  Tor: 0.3.3.1-alpha
     Severity:  Normal        |   Keywords:  033-must, fast-fix
Actual Points:                |  Parent ID:
       Points:  1             |   Reviewer:
      Sponsor:  Sponsor8-can  |
------------------------------+--------------------------------
 In https://trac.torproject.org/projects/tor/ticket/25386#comment:21, after
 changing/adding some tests, I noticed that
 `protover::compute_for_old_tor()` always returns an empty string, meaning
 that the version we parsed is new enough that the router should be
 reporting its own protocol versions. It's because the Rust code is calling
 the C version of `tor_version_as_new_as()`, which expects a ''platform
 string'', not a version, so it gets to `tor_version_parse_platform()`,
 decides this is a "non-standard tor" and returns true early. So, in the
 top of the Rust function `protover::compute_for_old_tor()`, when we call
 `tor_version_as_new_as(version, FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS)`
 it says true, and we never reach the rest of the function.

 The solution is to prepend `"Tor "` to each of the query strings in
 `protover::compute_for_old_tor()`.

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


More information about the tor-bugs mailing list