tor-netdoc: Sort out netstatus signatures

This MR gradually fixes the directory-signature code in netstatus poc to be suitable for use in production, and hoists it into the main netstatus.rs.

Branch is on top of !3923 (merged) so draft until that has merged.

The signature item parsing is a rewrite, using a totally different approach. The document hashing is largely moved and then fixed. (In the old code, item parsing and hashing are more mixed together.)

There's roughly the following phases:

  • Prep:

    • About 5 commits' worth of miscellaneous, general, bugfixes and cleanups.
    • Cleanup in the authcert tests, which help make room for a new test case that comes later.
  • New parsing code, parsing Signature (not the poc signature type):

    • DigestAlgoInSignature, a parsing/encoding type for the optional Algorithm field in directory-signature
    • Arrange to derive ItemValue traits for Signature
  • Hashing rework:

    • Note some things that are currently wrong with the code in poc.
    • Add some scaffolding to support code motion.
    • Move chunks from poc to prod.
    • Implement SignatureItemParseable (for Signature)
    • Abolish the poc signature type and have poc use Signature instead
    • Fix the remaining bugs, and tidy up

If you prefer to review the new parsing and hashing code, all together, de novo, review the diff from "Introduce DigestAlgoInSignature parsing/encoding type" to "tor-netdoc: re-privatise some methods" inclusive.

Edited by Ian Jackson

Merge request reports

Loading