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

2018-03-22 Thread Tor Bug Tracker & Wiki
#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:  Medium  |  Milestone:  Tor: 0.3.3.x-final
Component:  Core Tor/Tor|Version:  Tor: 0.3.3.1-alpha
 Severity:  Normal  | Resolution:
 Keywords:  033-must, fast-fix  |  Actual Points:
Parent ID:  | Points:  1
 Reviewer:  |Sponsor:  Sponsor8-can
+
Changes (by isis):

 * priority:  High => Medium


Comment:

 O, actually this is just a problem in the test code, this function is
 behaving as we expect it to in C. So the fix is to have the tests call it
 like this `protover::compute_for_old_tor("Tor 0.2.4.20")` instead. I wrote
 some tests for the C in the process.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

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

2018-03-22 Thread Tor Bug Tracker & Wiki
#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: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs