summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc
Commit message (Collapse)AuthorAgeFilesLines
* netdoc: Add a test for routerdesc family parsing.Nick Mathewson2022-11-171-0/+9
|
* netdoc: Correct and test some tricky routerdesc errorsNick Mathewson2022-11-171-2/+31
| | | | These required hex-editing identity certificates :P
* netdoc: Add tests for routerdesc accessors.Nick Mathewson2022-11-171-1/+31
|
* Netdoc: use a different desc in tests.Nick Mathewson2022-11-171-4/+3
| | | | This is from Akka, which ahf runs.
* Remove a `TODO pt-client` in netdoc.Nick Mathewson2022-11-151-2/+0
| | | | This issue is now torspec!94.
* netdoc: Allow empty lines at the end of a router descriptor.Nick Mathewson2022-11-151-3/+10
|
* RouterDesc: Add an or_ports method.Nick Mathewson2022-11-101-0/+9
|
* Merge branch 'store-yak-misc' into 'main'eta2022-11-081-0/+5
|\ | | | | | | | | Small misc yaks for bridge descriptor persistence See merge request tpo/core/arti!828
| * tor-netdoc: RouterDesc: Add published accessorIan Jackson2022-11-041-0/+5
| | | | | | | | The bridge descriptor manager is going to want this.
* | Fix typosDimitris Apostolou2022-11-061-1/+1
|/
* netdoc: Add accessors for protocols and ntor key.Nick Mathewson2022-10-041-0/+11
| | | | | These are needed to actually be able to build circuits through a bridge.
* tor-netdoc: Add relay ID accessors for RouterDesc.Nick Mathewson2022-10-041-7/+26
| | | | | | | | | To implement a reasonable RsaIdentity accessor, we have to store the RsaIdentity in the RouterDesc, or else we'd have to recalculate it using SHA1 and DER every time. The Ed25519 identity is hidden inside the identity cert, but it's safe to get a reference to it.
* Work around a new nightly clippy warningNick Mathewson2022-09-303-17/+22
| | | | | | | | | | | | | | The warning `clippy::bool_to_int_with_if` is meant to shout at you when you say `if x { 1 } else { 0 }` and instead suggest that you say `inttype::from(x)`. I agreed with this for the case in tor-cert, where we are literally converting a boolean into a flag. I don't agree with this in tor-netdoc, where we are using a boolean to decide how many fields to skip in a given document format. So for this case, I decided to clean up the code a little by renaming "skip" to "n_skip", and changing the boolean to use an enum instead.
* Make RouterDesc implement Clone and Debug.Nick Mathewson2022-09-261-0/+1
| | | | Their omission was an oversight.
* add feature annotation to fields made visible through visible::StructFieldstrinity-1686a2022-08-245-0/+69
|
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-245-0/+6
|
* tor-netdoc: NetParams: impl FromIteratorIan Jackson2022-08-161-0/+8
| | | | | Otherwise a caller who has a set of parameters must open-code the loop.
* fix nighly clippytrinity-1686a2022-07-231-6/+1
|
* change usage of PublicKey to Ed25519 in tor-certtrinity-1686a2022-07-231-4/+8
| | | | and propagate to other affected crates
* change check_key to take a Option<&_> instead of &Option<_>trinity-1686a2022-07-231-2/+2
|
* tor-proto: split and elaborate tor_bytes::Error instancesNick Mathewson2022-06-231-5/+15
| | | | | | | | | Some of these were for decoding particular objects (we now say what kind of objects), and some were unrelated tor_cert errors that for some reason we had shoved into a tor_bytes::Error. There is now a separate tor_cert::CertError type, independent from tor_cert's use of `tor_bytes::Error` for parsing errors.
* microdesc: make sure we recover from an error in the final md.Nick Mathewson2022-06-071-1/+7
| | | | | | | | (This is slightly different from recovering from errors in the middle of a list of mds, since in this case we _can't_ advance to the next md.) Also, note that a given branch is probably not reachable.
* netdoc: test case for microdesc with no ed25519 id.Nick Mathewson2022-06-071-0/+1
| | | | | The "bad-id" microdescriptor is hand-edited based on one from a Chutney network.
* netdoc: test a couple of accessors for AuthCert.Nick Mathewson2022-06-071-1/+11
|
* Resolve the new `derive_partial_eq_without_eq` lint.Nick Mathewson2022-05-231-1/+1
| | | | It's a little overzealous sometimes, but it's mostly to the good.
* Fix typoDimitris Apostolou2022-05-141-1/+1
|
* tor-netdoc: Add a Lifetime::valid_at method.Nick Mathewson2022-05-111-0/+4
|
* netdoc: add a new type for NicknamesNick Mathewson2022-05-093-11/+8
| | | | | | | | | | Relay nicknames are always between 1 and 19 characters long, and they're always ASCII: That means that storing them in a [u8;19] will always be possible, and always use less resources than storing them in a String. Fortunately, the tinystr crate already helps us with this kind of thing.
* NetParams: Document its role as a validated config parameterIan Jackson2022-05-091-0/+3
|
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-252-3/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Re-order attributes so that we can build with Rust 1.53.Nick Mathewson2022-03-315-15/+15
|
* tor-netdoc: Conditionally expose document fields.Nick Mathewson2022-03-316-0/+83
| | | | | | | | This commit uses the `visibility` and `visible` crates to conditionally make certain structs and their fields public (respectively). This is incredibly dangerous to use for anything besides testing, and I've tried to write the documentation for the feature accordingly.
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-302-3/+0
|
* Merge branch 'no-system-time' into 'main'eta2022-03-302-0/+3
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * use wallclock where possible in teststrinity-1686a2022-02-262-0/+3
| |
* | Change type of TorClientConfig::override_net_paramsIan Jackson2022-03-161-1/+1
| | | | | | | | | | | | | | Now we use NetParams. That implies making its constructor public, which I think it fine. This is related to #413 but is far from completing that ticket.
* | Canonicalize and intern protover lines on descriptorsNick Mathewson2022-03-113-11/+17
| | | | | | | | | | | | | | | | This should save around 1MB per consensus, since every relay has a 'protocols' lines, but there are only a few distinct possibilities for such a line. Closes #385.
* | Canonicalize and intern family representations to save memory.Nick Mathewson2022-03-113-8/+24
| | | | | | | | | | | | This should save 1-3 MB of ram on each running arti client. Closes #384. See also tor#27359 and proposal 298.
* | Add a more generic implementation of intern-by-refNick Mathewson2022-03-111-1/+1
| |
* | netdoc: Call shrink_to_fit() when we're done parsing rs sectionsNick Mathewson2022-03-111-0/+1
| | | | | | | | | | (Once we're done parsing these, the vector will never get any longer.)
* | netdoc: allocate no extra space for RouterStatus addresses.Nick Mathewson2022-03-111-5/+6
| | | | | | | | This should save around 181K of heap on a current directory.
* | netdoc: Make versions smaller in GenericRouterStatusNick Mathewson2022-03-112-6/+45
| | | | | | | | | | | | When the version is a Tor version, we can just parse it; otherwise, we can intern it. This shrinks GenericRouterStatus and avoids a lot of extra help allocations.
* | tor-netdoc: Remove unused or_port field from RS.Nick Mathewson2022-03-112-6/+0
| | | | | | | | Part of #387
* | Add methods to `UnverifiedConsensus`Christian Grigis2022-03-101-0/+25
|/
* Refactor tor_netdoc::ErrorNick Mathewson2022-02-147-124/+199
| | | | | | | | | | | | | | | This error type doesn't impement HasKind, since the kind will depend on context. However, the existing implementation was pretty messy and inconsistent: Some errors had positions, some didn't. Some took messages as str, some as String. Some had internal errors that were somewhat orthogonal to their actual types. This commit refactors tor_netdoc::Error to use a ParseErrorKind, and adds a set of convenience functions to add positions and messages to the errors that need them.
* netdoc: Make doc-build errors a separate typeNick Mathewson2022-02-144-7/+7
| | | | | Every other case of tor_netdoc::Error means a parse failure. This one, though, means a failure to construct a document.
* Merge branch 'refactor/must-use-self' into 'main'eta2021-12-201-0/+1
|\ | | | | | | | | address clippy's latest lint See merge request tpo/core/arti!205
| * address clippy's latest lintDaniel Eades2021-12-201-0/+1
| |
* | tor-netdoc: Change an XXX to a TODO.Nick Mathewson2021-12-201-1/+4
| | | | | | | | | | | | Our behavior in handling not-yet-valid router descriptors doesn't match the C Tor implementation, but it's not a big deal: we don't currently use router descriptors at all.
* | tor-netdoc: Use a more correct error typeNick Mathewson2021-12-201-1/+1
| | | | | | | | | | | | If we fail to convert a curve25519 key to an ed25519 key for checking the onion-key crosscert, don't call that an internal error: it means that something is wrong with the provided ntor key.