aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/routerdesc.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* RouterDesc: Add an or_ports method.Nick Mathewson2022-11-101-0/+9
|
* tor-netdoc: RouterDesc: Add published accessorIan Jackson2022-11-041-0/+5
| | | | The bridge descriptor manager is going to want this.
* 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.
* 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-241-0/+18
|
* 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.
* 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.
* netdoc: add a new type for NicknamesNick Mathewson2022-05-091-6/+3
| | | | | | | | | | 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.
* tor-netdoc: Conditionally expose document fields.Nick Mathewson2022-03-311-0/+5
| | | | | | | | 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.
* Canonicalize and intern protover lines on descriptorsNick Mathewson2022-03-111-6/+8
| | | | | | | | 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-111-4/+16
| | | | | | This should save 1-3 MB of ram on each running arti client. Closes #384. See also tor#27359 and proposal 298.
* Refactor tor_netdoc::ErrorNick Mathewson2022-02-141-32/+50
| | | | | | | | | | | | | | | 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.
* 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.
* Remove an XXXX about ed25519 signatures.Nick Mathewson2021-12-201-2/+0
| | | | | As of tor-spec commit 01122c5bd7d2f0f, the spec is no longer ambiguous on this point.
* Run "cargo update" to get latest versions.Nick Mathewson2021-11-291-0/+1
| | | | | | | Also fix a couple of warnings introduced by now-unneeded imports with new ed25519 crate. This is part of the process for releasing our next version.
* tor-netdoc: Put the "routerdesc" document type behind a feature.Nick Mathewson2021-11-121-0/+5
| | | | | | | | | | Nothing in arti currently uses this document type. Eventually it will be useful for relays and for bridge clients. I've left the "SHA1 digest of a router descriptor" type available unconditinoally, however, since it does get used in a few places. Part of #125.
* derive 'Default' where possibleDaniel Eades2021-09-111-10/+1
|
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-9/+10
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+888
This will cause some pain for now, but now is really the best time to do this kind of thing.