Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #25605
Closed (moved) (moved)
Open
Created Mar 23, 2018 by Isis Lovecruft@isis

Add tests for Rust protover::compute_for_old_tor() and C functions it calls

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().

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking