aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc
Commit message (Collapse)AuthorAgeFilesLines
...
| * tor-netdoc: Add to_rsa_id() helper functionClara Engler2026-04-081-0/+7
| | | | | | | | | | | | | | | | | | This commit adds a to_rsa_id() helper function to the authcert tests in order to convert a hex-encoded RSA identity to an RsaIdentity. It will be required later on for converting the test vector values to the inner representations and this function is helpful here because it avoids us to do repetitive unwrapping and RsaIdentity::from_hex calls, which overall increase the length/readability.
| * tor-netdoc: Add pem_to_rsa_pk helper functionClara Engler2026-04-081-0/+7
| | | | | | | | | | | | | | This commit adds the pem_to_rsa_pk helper function to the authcert tests in order to convert a PEM encoded RSA public key to the internal data structure. It will be required later on in order to convert the test vector strings to internal representations.
| * tor-netdoc: Add to_system_time helper functionClara Engler2026-04-081-0/+7
| | | | | | | | | | | | | | | | This commit adds a to_system_time helper function accepting an &str in the Iso8601TimeSp format and converting it to a SystemTime to the authcert test cases. It will be required later on in order to conveniently convert human readable timestamps to the test vectors expected from parsed data.
* | tor-netdoc: parse2/encode derive: Use unquoted attributes at call sitesIan Jackson2026-04-073-5/+5
| |
* | tor-netdoc: Constructor derive: Use meta_quoted rigorousIan Jackson2026-04-071-1/+1
|/
* tor-netdoc: Add TODO to test ignoringClara Engler2026-04-021-0/+1
|
* tor-netdoc: Disable broken test for nowClara Engler2026-04-021-0/+1
|
* tor-netdoc: Note on hardcoded test vectorsClara Engler2026-04-021-0/+5
|
* tor-netdoc: Remove onion_key accessorClara Engler2026-04-021-5/+0
|
* tor-netdoc: Use Curve25519Public for parsingClara Engler2026-04-022-7/+9
| | | | | | This commit removes the implementation of ItemArgumentParseable for curve25519::PublicKey in favor of using the already existing Curve25519Public, which also got beefed up slightly.
* tor-netdoc: Refactor Ed25519IdentityLineClara Engler2026-04-021-16/+17
| | | | | This commit refactors Ed25519IdentityLine by deriving as much as possible.
* tor-netdoc: Use proper PEM parser for testvecsClara Engler2026-04-021-21/+26
| | | | | | | | | This commit uses a proper PEM parser as a dev-dependency to tor-netdoc for parsing PEM entries, instead of hard-coding long DER byte strings. It is better to use an external crate for this here, rather than the existing somewhat accessible (only through traits) implementation of parse2, because it feels wrong testing parse2 with parse2.
* tor-netdoc: Reorder Microdesc according to specClara Engler2026-04-021-11/+11
|
* tor-netdoc: Properly parse mutliple family-idsClara Engler2026-04-022-16/+17
| | | | | | | | | | | | | This commit fixes a bug in the microdescriptor parser to properly parse multiple family-ids. Previously, we interpreted the spec to simply contain multiple `family-ids` lines. This is wrong however. Instead, there may only be a single such line with multiple values. To fix this issues, we itnroduce a `RelayFamilyIds` type, similar to `RelayFamily`, that stores multiple `RelayFamilyId` entires in a `Vec`. Then, we just derive `ItemValueParseable` on it and win.
* 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: Gate encode_sign on plain-consensus featureIan Jackson2026-04-011-1/+4
|
* tor-netdoc: Replace AuthCert::verify_selfcert implIan Jackson2026-04-011-1/+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: Provide `new` methods for CrossCert and AuthCertIan Jackson2026-04-011-0/+60
|
* tor-netdoc: Turn AuthCertSignature into RsaSignatureIan Jackson2026-04-011-24/+7
| | | | | | | | 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: Move raw_data_object to new container moduleIan Jackson2026-04-011-1/+1
| | | | 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: authcert: Debug CrossCertObject in hexIan Jackson2026-04-011-1/+3
|
* tor-netdoc: Constructor: Fix it so it actually worksIan Jackson2026-04-011-2/+2
| | | | | | The hidden __non_exhaustive field has to be pub. And, fix the use site, currently AuthCert.
* tor-netdoc: Rename `AuthCertUnverified::verify_self_signed`Ian Jackson2026-03-311-15/+15
| | | | | | | | | | | 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-313-5/+5
| | | | | | | | | | | 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
|
* Fix typosTobias Stoeckmann2026-03-242-2/+2
| | | | Typos found with codespell
* tor-netdoc: Apply deferred rustfmt churn to importsIan Jackson2026-03-191-1/+3
|
* tor-netdoc: parse2: Don't impl NetdocParseable for bodies of signed docsIan Jackson2026-03-191-3/+7
| | | | Such an impl is a footgun. Explain this in docs & comments.
* tor-netdoc: parse2: Don't impl NetdocParseable for bodies of signed docs ↵Ian Jackson2026-03-191-3/+7
| | | | (pre-fmt)
* tor-netdoc: authcert test: Avoid using NetdocParseable for AuthCertIan Jackson2026-03-191-3/+4
| | | | | | | | | We want to stop deriving NetdocParseable directly for body structs. This test case does in fact parse a signed authcert and extract just the body without verifying the signatures. That's fine in a test, but we're going to make it involve some hoop-jumping. So, jump those hoops.
* tor-netdoc: parse2: Unify top-level derive as NetdocUParseablenverifiedIan Jackson2026-03-191-1/+1
| | | | | | | | | | | | | | | | Replace the two separate NetdocParseable and NetdocUnverified derives, for toplevel signed documents, with a single derive. This makes the derive API simpler. It will also make it reasonably possible to avoid deriving NetdocParseable directly for body structs. Such impls are a security hazard! In detail: * Rename NetdocUnverified to NetdocParseableUnverified * Have it use $IMPL_NETDOC_PARSEABLE from the NetdocParseable deftly module so that it derives NetdocParseable for the body. (We'll change this later in the series.) * Adjust the docs and all call sites.
* tor-netdoc: parse2: Move hash out of signature itemsIan Jackson2026-03-191-7/+4
| | | | | | | | | | During encoding, including these hashes in the signature items makes no sense. The hashes are an *input* to the signature items, but not part of them. Move the hashes out of the items. Instead, provide each signatures section type with a hash accumulator type, in which the hash(es) are stored.
* tor-netdoc: parse2: Introduce SignatureData structIan Jackson2026-03-191-3/+3
| | | | This is going to contain body information, and the hashes, too.
* tor-netdoc: NetdocParseableSignatures: Make into its own macroIan Jackson2026-03-191-2/+1
| | | | | | This is going to be its own trait and it is usually best if macros are named after traits, rather than having the macro derive a different trait depending on meta attributes.
* Merge branch 'extra-info' into 'main'Clara Engler2026-03-181-0/+3
|\ | | | | | | | | tor-dirclient: Support for extra-info requests See merge request tpo/core/arti!3764
| * tor-netdoc: Add ExtraInfoDigest type aliasClara Engler2026-03-121-0/+3
| | | | | | | | Accidentally left out in the previous commit.
* | Fix word duplicate typosTobias Stoeckmann2026-03-153-4/+4
|/
* parse2: Add TODO for netstatus traitClara Engler2026-03-091-0/+5
| | | | | This commit adds a TODO to implement a trait combining the common fields in a network status documents.
* tor-netdoc: Apply rustfmt churnIan Jackson2026-03-031-7/+2
|
* tor-netdoc: Rename *Signed to *UnverifiedIan Jackson2026-03-032-11/+11
| | | | | | | | | | This was a weird name, and while working in this area it all seemed to make the docs strange. Rename it. This is quite invasive! In theory we could have the macros generate compatibility aliases, but that seems quite complex.
* tor-netdoc: Drop dir_auth_key_cert_signatures test caseIan Jackson2026-03-031-56/+1
| | | | | | | | | | | | | | This test case constructs a "netdoc" which consists of one dir-key-certification item, and parses it using `AuthCertSignatures as NetdocParseable`. But we're going to split out the parsing trait for signatures sections, so that's not going to work any more. This test tests only corner cases of the derived SignatureItemParseable implementation; but that's unit tested in the parse2 tests. (Once upon a time there was perhaps manual parsing code which needed a specific test.) Remove it.
* tor-netdoc: Remove remaining use of EP::OtherClara Engler2026-01-151-8/+16
| | | | | | This commit replaces the last remaining uses of `EP::Other` in `tor-netdoc`, which got removed in arti!3561 but was still made use of in arti!3592 without causing a merge conflict.
* Merge branch 'encoded-authcert' into 'main'Ian Jackson2026-01-152-0/+452
|\ | | | | | | | | Implement EncodedAuthCert and use it in poc for votes See merge request tpo/core/arti!3592
| * tor-netdoc: EncodedAuthCert: docs grammarIan Jackson2026-01-151-1/+1
| |
| * tor-netdoc: EncodedAuthCert: remove another bit of leftover debugIan Jackson2026-01-151-1/+0
| |