aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'more_netdoc_tests' into 'main'Ian Jackson2022-11-291-6/+73
|\ | | | | | | | | tor-netdoc: More tests for routerdesc accessors and parsing. See merge request tpo/core/arti!870
| * 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.
* | Fix a couple of rustdoc issues.Nick Mathewson2022-11-181-2/+2
| | | | | | | | These slipped in while nightly was broken.
* | Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-1/+1
|/ | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* Merge branch 'real_netdoc_pos' into 'main'Ian Jackson2022-11-162-21/+15
|\ | | | | | | | | | | | | Replace `Option<Pos>` with `Pos` in `ParseError`. Closes #640 See merge request tpo/core/arti!859
| * Replace `Option<Pos>` with `Pos` in `ParseError`.Nick Mathewson2022-11-152-21/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have `Pos::Unknown` for an error at an unknown location and `Pos::None` for an error where no location is sensible. There's no reason to have an additional `Option` here. Additionally, the use of `Option` gave us a bug where our old `ParseError::at_pos()` method didn't actually set the position unless the position was already set. That's not what we want! Fixes #640. Finally, we have to fix a test that was a bit broken because it was working around #640.
* | Remove a `TODO pt-client` in netdoc.Nick Mathewson2022-11-151-2/+0
|/ | | | This issue is now torspec!94.
* Resolve a dead-code warning.Nick Mathewson2022-11-151-0/+1
|
* netdoc: Allow empty lines at the end of a router descriptor.Nick Mathewson2022-11-152-3/+34
|
* tor-netdoc: Add a new ErrorKind for EmptyLine.Nick Mathewson2022-11-152-1/+7
| | | | | Empty lines were previously reported as BadKeyword, which is confusing.
* 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-062-2/+2
|/
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Fix some rustdoc errors.Nick Mathewson2022-10-131-2/+2
| | | | | | In addition to the usual "You named that method wrong!" errors, we have a new rustdoc error that complains about bogus "HTML tags" that are actually unquoted usage of types like `Result<Foo>`.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-51/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* 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-246-1/+7
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* 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-232-6/+2
|
* change usage of PublicKey to Ed25519 in tor-certtrinity-1686a2022-07-232-9/+11
| | | | and propagate to other affected crates
* change check_key to take a Option<&_> instead of &Option<_>trinity-1686a2022-07-231-2/+2
|
* Fix clippy needless derefIan Jackson2022-07-061-3/+3
|
* tor-netdoc: b64 tests: add exhaustive roundtrip testIan Jackson2022-07-061-0/+42
|
* Bump `base64ct` crate `1.5.0` -> `1.5.1`Arturo Marquez2022-06-271-18/+6
| | | | | | This new release checks for invalid symbols in non-padded inputs for decoding. Therefore, we can get rid of the logic implemented in `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600`
* Merge branch 'clippy' into 'main'Ian Jackson2022-06-241-0/+3
|\ | | | | | | | | Fix clippy nightly again See merge request tpo/core/arti!603
| * Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | | | | | Update all lint blocks
* | Merge branch 'error_cleanup_2' into 'main'eta2022-06-242-5/+18
|\ \ | | | | | | | | | | | | Error refactoring: bytes, cert, proto. See merge request tpo/core/arti!604
| * | tor-proto: split and elaborate tor_bytes::Error instancesNick Mathewson2022-06-232-5/+18
| |/ | | | | | | | | | | | | | | | | 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.
* | base64: Move some tests into a separate function, placating clippyIan Jackson2022-06-231-11/+15
| |
* | base64: Add yet more test casesIan Jackson2022-06-231-0/+17
| |
* | Add some more test cases for base64Arturo Marquez2022-06-221-0/+17
| | | | | | | | | | These tests are borrowed from other parts of the `tor-netdoc` crate.
* | Improve base64 testsArturo Marquez2022-06-221-1/+13
| | | | | | | | Request for changes: `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600#note_2816252`
* | Add link to upstream issueArturo Marquez2022-06-221-1/+3
| | | | | | | | As per request, here: `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600#note_2816252`
* | Replace `base64` crate with `base64ct` crateArturo Marquez2022-06-212-7/+24
|/ | | | | | | Note: the `base64ct` crate rejects invalid characters when the decoding is done on padded strings. However, the `FromStr` impl for `B64` can have both padded **and** unpadded inputs, so all inputs are now padded first, before decoding.
* Add a configuration option for reachable_addrsNick Mathewson2022-06-171-0/+8
| | | | (This doesn't do anything yet.)
* NetDoc: Make AddrPortPattern implement serde traitsNick Mathewson2022-06-171-1/+29
| | | | | | I'm using serde_with here to just re-use the Display and FromStr implementations, since those are what has proven easier to type in the past.
* Make AddrPortPattern and friends implement Eq and PartialEqNick Mathewson2022-06-171-2/+2
|
* Add one more "allow" to tor_netdoc::parse::macros.Nick Mathewson2022-06-151-0/+1
| | | | | Without this, clippy is error-free, but `cargo test` somehow gives a warning.
* Netdoc tests: extract decode-base64-ignore-ws code.Nick Mathewson2022-06-071-10/+13
|