aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: Add a test for Microdesc with parse2Clara Engler2026-04-021-0/+94
|
* tor-netdoc: Derive NetdocParseable for MicrodescClara Engler2026-04-022-8/+58
| | | | | | | | | | | | This makes it possible to parse2 micro descriptors, which will be very useful later on. For this, it makes a few changes. Most notably, it introduces a (private) field called `onion_key`, which stores an optional RSA onion key, as it serves as the introduction line for this netdoc document type. Besides, it also changes the `ed25519_id` type to the `Ed25519IdentityLine` wrapper type, although the signature of the respective getter remains the same.
* tor-netdoc: Derive Default for PortPolicyClara Engler2026-04-021-1/+1
| | | | | | This is a sane default, because rejecting all ports is the default for relay configurations as well as the default of when this field is absent in netdocs.
* tor-netdoc: Ed25519IdentityLine parserClara Engler2026-04-021-1/+35
|
* tor-netdoc: ItemArgumentParseable for Arc<T>Clara Engler2026-04-021-0/+6
|
* tor-netdoc: NormalItemArgument for RelayFamilyIdClara Engler2026-04-021-1/+3
|
* tor-netdoc: ItemValueParseable for PortPolicyClara Engler2026-04-021-0/+18
| | | | | | | | | This commit implements ItemValueParseable for PortPolicy. Unfortunately we cannot use NormalItemArgument because it contains spaces, leading to multiple arguments. In a later commit, we may migrate this fully to parse2 because right now, it just wraps around its FromStr implementation.
* tor-netdoc: Make X25519 PKs parseable with parse2Clara Engler2026-04-021-0/+16
|
* tor-netdoc: parse2 for RelayFamilyClara Engler2026-04-021-9/+39
| | | | | | This commit replaces the inner value of RelayFamily to use a LongIdent instead, which it already uses for parsing, in order to derive ItemValueParseable on it, so we can use it within parse2 magic.
* tor-netdoc: Improve upon LongIdentClara Engler2026-04-021-1/+8
| | | | | | This commit makes LongIdent parseable by implementing NormalItemArgument as well as the required Display for it. Besides, it also derives Hash on it.
* tor-netdoc: Improve upon B64Clara Engler2026-04-021-1/+42
| | | | | | | | This commit improves upon B64 by implementing NormalItemArgument for it, as well as implementing a wrapper type for it, called FixedB64, that works just like B64 except that the resulted inner-value must be of a certain compile-time-specified fixed length, which is useful for things such as digests.
* tor-netdoc: Constructor: Fixes to generated docsIan Jackson2026-04-011-8/+8
| | | | | | | | | | Now some bugs have become visible. * Properly ``-quote the name in the heading. * Add a missing space before `{` * Adjust the fields to level-4 indent. * In `construct()`, ``-quote the name, and xref it in the body, not the title (which rustdoc makes a link to the fn itself)
* tor-netdoc: Constructor: Reformat $/// doc sectionIan Jackson2026-04-011-10/+6
| | | | | | This lines all the docs lines up, so we can see our indentation. No change to the generated docs.
* tor-netdoc: Constructor: Use $/// deftly featureIan Jackson2026-04-011-30/+27
| | | | No change to the generated docs.
* tor-netdoc: parse2 derive: Use $/// deftly feature in a few placesIan Jackson2026-04-011-4/+4
| | | | No change to the generated docs.
* tor-netdoc: RsaSha1Signature::new_sign_netdoc: rename argumentIan Jackson2026-04-011-3/+3
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3851#note_3388076
* tor-netdoc: Gate encode_sign on plain-consensus featureIan Jackson2026-04-011-1/+4
|
* tor-netdoc: encode: Move various ItemArgument impls to impls.rsIan Jackson2026-04-012-64/+68
|
* tor-netdoc: Abolish poc::authcertIan Jackson2026-04-015-10/+8
| | | | | | This was just some type aliases. Put them in the poc files that used them. (These type aliases are undesirable but we aren't cleaning them up because the whole of poc is destined for deletion.)
* tor-netdoc: Replace AuthCert::verify_selfcert implIan Jackson2026-04-012-47/+13
| | | | | Get rid of the version in poc. Instead, implement the same functionality in terms of AuthCert::verify, outside poc.
* tor-netdoc: authcert: Test encoding and signing methodIan Jackson2026-04-011-0/+43
|
* tor-netdoc: authcert: Provide encoding and signing methodIan Jackson2026-04-011-1/+26
|
* tor-netdoc: RsaSha1Signature: Provide signing methodIan Jackson2026-04-011-0/+82
|
* tor-netdoc: Provide `new` methods for CrossCert and AuthCertIan Jackson2026-04-011-0/+60
|
* tor-netdoc: Turn AuthCertSignature into RsaSignatureIan Jackson2026-04-013-26/+47
| | | | | | | | These are in fact just a completely normal RSA signature like in the spec! Move the type to the types module, and rename it. Leave a compatibility alias.
* tor-netdoc: derive enncoding for AuthCert, AuthCertSignature[s]Ian Jackson2026-04-011-2/+5
|
* tor-netdoc: implement encoding function for raw_data_objectIan Jackson2026-04-011-1/+10
|
* tor-netdoc: Move raw_data_object to new container moduleIan Jackson2026-04-015-12/+20
| | | | This will allow us to use it for encoding as well as parsing.
* tor-netdoc: impl encoding traits for authcert cross-cert typesIan Jackson2026-04-011-1/+19
|
* tor-netdoc: impl encoding traits for rsa::PublicKeyIan Jackson2026-04-012-0/+28
|
* tor-netdoc: Provide ItemEncoder::text_sofar()Ian Jackson2026-04-011-0/+5
|
* tor-netdoc: Provide ItemEncoder::object() taking an ItemObjectEncodableIan Jackson2026-04-012-0/+17
|
* tor-netdoc: impl From<RsaIdentity> for the fingerprint typesIan Jackson2026-04-011-4/+8
|
* tor-netdoc: encode derive: Fix handling of optionality.Ian Jackson2026-04-011-7/+3
| | | | | We mustn't use selector.selector() because that's for multiplicity, not optionality. In pracctice, it goes wrong with Vec<u8>.
* tor-netdoc: encode derive: Use paste_spanned to improve an error messageIan Jackson2026-04-011-1/+3
|
* tor-netdoc: Fix a wrong "what does this end" commentIan Jackson2026-04-011-1/+1
| | | | This was a c&p error, I think.
* tor-netdoc: authcert: Debug CrossCertObject in hexIan Jackson2026-04-011-1/+3
|
* tor-netdoc: Constructor: Fix it so it actually worksIan Jackson2026-04-012-5/+5
| | | | | | The hidden __non_exhaustive field has to be pub. And, fix the use site, currently AuthCert.
* tor-netdoc: encode: re-export netdoc_ordering_check for macrosIan Jackson2026-04-011-0/+1
| | | | Otherwise deriving NetdocEncodable doesn't work outside this crate.
* tor-netdoc: encode derive: Use $P for ResultIan Jackson2026-03-311-1/+1
|
* tor-netdoc: Fix typo in doc commentIan Jackson2026-03-311-1/+1
|
* tor-netdoc: Rename `AuthCertUnverified::verify_self_signed`Ian Jackson2026-03-312-15/+17
| | | | | | | | | | | This method verifies all the signatures, and checks that the signing authority is in the provided list. Anyway, authcerts aren't really self-signed: they're a signature by KS_auth_id_rsa on KP_auth_sign_rsa. Note that there is also a `verify_selfcert` method which does only some of the checks, and has some code duplication. That will be cleaned up later.
* tor-netdoc: encoder: Rename .object() method to .object_bytesIan Jackson2026-03-315-12/+12
| | | | | | | | | | | With the introduction of the derives for document encoding, we now have a trait ItemObjectEncodable. We will want a method on ItemEncoder that takes an ItemObjectEncodable, and that should be called `object` since it's a better approach than working ad-hoc with tor_bytes::Writeable. (For example, an ItemObjectEncodable knows its own label.) So, rename `object` to `object_bytes`.
* tor-netdoc: Port to web-time-compatNick Mathewson2026-03-263-5/+7
|
* Revert "parse2: Rename lno_for_error to lno"Clara Engler2026-03-252-3/+3
|
* parse2: Rename lno_for_error to lnoClara Engler2026-03-252-3/+3
| | | | | This commit lno_for_error in ItemStream to lno because its value may not always be used for error handling, such as in tor-consdiff.
* parse2: Implement `ParseError::new()`Clara Engler2026-03-251-0/+19
| | | | | | | | | This commit adds the ParseError::new() method, which allows external APIs to construct a ParseError, which is currently not possible due to non-exhaustiveness, despite the member fields being public. It is required for external applications using lower-level but public parse2 APIs, such as ItemStream's.
* Fix typosTobias Stoeckmann2026-03-2412-17/+17
| | | | Typos found with codespell
* tor-netdoc: signature orderliness: add some xrefsIan Jackson2026-03-192-1/+6
|
* tor-netdoc: signature ordering: discuss an alternative impl approachIan Jackson2026-03-191-0/+3
| | | | Suggested-by: Clara Engler <[email protected]>