Make sure the C and Rust protovers can't get out of sync
There is a recurring bug, where we modify the C protover, but forget the Rust protover. (See legacy/trac#34248 (moved), legacy/trac#33285 (moved), legacy/trac#29631 (moved) for similar issues.)
We could fix the underlying issue by fetching the string from a common location, using C's #include
or Rust's include_str!()
.
Then we could test that C and Rust are the same by putting a copy of the protover string in the unit tests, and making sure that it matches the currently supported protocol versions.
This fix and test will be important for proposal 318, because it will modify both protocol version implementations: https://github.com/torproject/torspec/blob/master/proposals/318-limit-protovers.md