aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src
Commit message (Collapse)AuthorAgeFilesLines
...
* netdoc: Introduce HsDescErrorNick Mathewson2023-06-223-37/+124
| | | | | | | | | | For higher-level HsDesc-related functions, this type indicates where exactly an error occurred. It lets us distinguish decryption errors from parsing errors, and attribute responsibility to the hsdir, the onion service, or the user's lack of encryption. This lets us remove some just-introduced complexity in tor-hsclient.
* Merge branch 'socks_errorkinds' into 'main'Nick Mathewson2023-06-222-1/+9
|\ | | | | | | | | | | | | Generate correct-ish socks5 errors for onion service errors. Closes #736 See merge request tpo/core/arti!1279
| * Generate correct ErrorKinds for hsdesc decryption failures.Nick Mathewson2023-06-212-1/+9
| | | | | | | | Part of #736
* | Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ \ | | | | | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * | lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
| |/
* | netdoc: downgrade two accessor-related TODOsNick Mathewson2023-06-201-4/+1
| |
* | netdoc: Use derive amplify::Getters for HsDesc accessors.Nick Mathewson2023-06-201-46/+8
|/ | | | Closes #909.
* hsdesc.rs: finally remove "allows".Nick Mathewson2023-06-162-13/+9
| | | | | | The last piece here is removing some needless keygen from the tests. This causes the test output (using the deterministic PRNG) to change.
* netdoc::doc::hsdesc changes to let us downgrade/remove allowsNick Mathewson2023-06-166-10/+9
|
* netdoc: unmark MAC_KEY_LEN as conjectural.Nick Mathewson2023-06-161-1/+1
| | | | | The value here is 32 bytes; I'm adding it to to the specification as torspec!141
* SharedRandVal: Note that it doesn't have to be Ct.Nick Mathewson2023-06-161-2/+1
|
* netdoc: remove a TODO about moving a module to where it already is.Nick Mathewson2023-06-161-2/+0
|
* netdoc: use ct_lookup for rend descriptor cookie lookupNick Mathewson2023-06-161-6/+3
| | | | | (I doubt that there is a viable side channel here, but still we might as well get in the habit of doing these things properly.)
* netdoc: Downgrade an HS todo wrt HS_DESC_AUTH_TYPENick Mathewson2023-06-161-2/+3
|
* netdoc: downgrade some TODO HS to TODO HSS.Nick Mathewson2023-06-162-7/+10
| | | | I'm using HSS for hs-service features.
* netdoc::build remove very broken example.Nick Mathewson2023-06-161-20/+3
| | | | | | | | | | | This could never be a full rustdoc test, since rustdoc never runs tests for private items. Even if it were a rustdoc test, it uses a bunch of types that aren't exposed in the right places, and it invokes nonexistent functions, and it assumes a `self` that isn't there. In lieu of writing a new untested test, I've added a note to refer the developer to where they can find working example code.
* netdoc: Remove a TODO that we already solved.Nick Mathewson2023-06-161-1/+0
|
* netdoc::build: remove or narrow `allow`s.Nick Mathewson2023-06-141-12/+4
|
* Merge branch 'ipt_to_circtarget' into 'main'Nick Mathewson2023-06-071-0/+32
|\ | | | | | | | | Construct a CircTarget from an IntroPointDesc. See merge request tpo/core/arti!1221
| * netdir, netdoc: Add accessors for protocol version status.Nick Mathewson2023-06-061-0/+32
| | | | | | | | | | | | | | | | | | | | | | The consensus includes a listing for clients and for relays, saying which protocol versions are _required_ for participation on the network, and which versions are _recommended_. We have been parsing this, but not yet exposing it. This commit adds accessors to expose it, since we'll need that in order to create CircTargets for introduction points and rendezvous points.
* | Merge branch 'access' into 'main'Alexander Færøy2023-06-061-4/+69
|\| | | | | | | | | hsdesc docs: Provide some accessors See merge request tpo/core/arti!1220
| * hsdesc: Add minimal set of accessors for HsDesc and IntroPointDescIan Jackson2023-06-051-0/+65
| |
| * hsdesc docs: Don't imply that a thing has been done, which hasn't yetIan Jackson2023-06-051-1/+1
| |
| * hsdesc docs: Use the definite articleIan Jackson2023-06-051-3/+3
| | | | | | | | | | These are (I hope) the only key matching the description. If they're not, the description needs to be expanded.
* | tor-netdoc: remove use of arrayref.Nick Mathewson2023-06-011-3/+7
|/
* netdoc, hsclient: Update remaining ed25519::SecretKey usersNick Mathewson2023-05-182-20/+17
| | | | | | Fortunately, these are all in experimental code. Closes #798
* Replace usage of KeyUnknownCert::check_key.Nick Mathewson2023-05-163-4/+4
|
* Use non-deprecated *Secret::random_from_rng.Nick Mathewson2023-05-132-6/+7
| | | | The `new` function is deprecated in x25519-dalek 2.0.0-rc.2
* netdoc: Use the RangeBoundsExt impl of TimerangeBound.Gabriela Moldovan2023-05-131-11/+24
| | | | | | We can now get rid of the standalone `intersect_bounds` function. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Do not consume EncryptedHsDesc when decrypting.Gabriela Moldovan2023-05-131-1/+1
| | | | | | | | | `parse_decrypt_validate` will need to "peek" inside an encrypted descriptor (before validating it) to extract the `TimerangeBound` of the inner layer. This is needed to compute the intersection of the `TimerangeBound`s of both layers. Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Compute HsDesc validity time from the TimerangeBounds of its layers.Gabriela Moldovan2023-05-131-13/+16
| | | | | | | This makes `descriptor_ensure` refetch the descriptor if either of its layers (inner or outer) expires. Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Build cached descriptor TimerangeBounds from descriptor lifetime.Gabriela Moldovan2023-05-131-0/+7
| | | | | | | This makes `descriptor_ensure` refetch the descriptor if it has been cached for longer than `descriptor-lifetime` minutes. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Rename parse_error_kind() to netdoc_error_kind().Gabriela Moldovan2023-05-113-5/+5
| | | | | | | `ParseErrorKind` was renamed to `NetdocErrorKind`, so we need to rename this acccessor too. Signed-off-by: Gabriela Moldovan <[email protected]>
* Merge branch 'hs-linkspec-work-v2' into 'main'Nick Mathewson2023-05-111-2/+2
|\ | | | | | | | | | | | | Second take on linkspec manipulation code needed by onion services Closes #794 See merge request tpo/core/arti!1177
| * Rename UnparsedLinkSpec => EncodedLinkSpecNick Mathewson2023-05-101-2/+2
| |
* | netdoc: Remove experimental-api gate from parse_decrypt_validate.Gabriela Moldovan2023-05-102-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | `parse_decrypt_validate` was marked as experimental because it was unclear if the newly added `BadTimeBound` error kind belongs in `ParseErrorKind`. However, we have since renamed `ParseErrorKind` to `NetdocErrorKind` and decided to keep the new variant, so this API doesn't need to be experimental anymore. Closes arti #852 Signed-off-by: Gabriela Moldovan <[email protected]>
* | netdoc: Rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.Gabriela Moldovan2023-05-1016-43/+41
|/ | | | | | | | | | | `ParseErrorSource` was originally meant to represent a parsing error, this enum has since gained some variants that aren't really parsing related (`Signature`, `CertSignature`, `UntimelyDescriptor`). Since this error type is now used for general-purpose netdoc errors, let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Mark parse_decrypt_validate as experimental.Gabriela Moldovan2023-05-022-0/+6
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Document how to extract an `HsDesc` out of an ↵Gabriela Moldovan2023-04-251-0/+32
| | | | | | | | | `UncheckedEncryptedHsDesc`. This adds an example to the `HsDesc::parse` docs. The constants from the example are lifted from the `parse_desc_good` test. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Add a convenience method for HS descriptor parsing.Gabriela Moldovan2023-04-252-1/+37
| | | | | | | | | This adds the `HsDesc::parse_decrypt_validate` method, which parses, decrypts, and validates HS descriptors. Closes #809 Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Document that particular bit values for flags are not part of our API.Nick Mathewson2023-04-171-1/+3
|
* netstatus: re-number routerstatus flags to go in order.Nick Mathewson2023-04-171-7/+7
| | | | | | | | Otherwise there is too much risk of accidentally adding in another 1<<12 when we meant to add a 1<<13. (It would be neat to have an alternative to bitflags here that would auto-number our bitflags for us.)
* netdir: more documentation on MIDDLE_ONLY flag.Nick Mathewson2023-04-172-0/+8
| | | | Clarify that it isn't anything that most users will need to check.
* netdoc: Add MiddleOnly flag to RelayFlagsjuga2023-04-172-0/+8
| | | | Closes #833
* Merge branch 'remove-hsdesc-todo' into 'main'Ian Jackson2023-04-121-3/+0
|\ | | | | | | | | Remove misleading TODO. See merge request tpo/core/arti!1130
| * Remove misleading TODO.Gabriela Moldovan2023-04-111-3/+0
| | | | | | | | | | | | | | | | | | | | The `superencrypted` blob is, in fact, followed by a newline. See [core/torspec!122]. [core/torspec!122]: https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/122 Signed-off-by: Gabriela Moldovan <[email protected]>
* | tor-netdoc: Tidy up and fix some broken intra-doc linksIan Jackson2023-04-112-3/+5
|/ | | | | | | | | | | | 1. Abbreviate the link text, and don't have it contain `crate` which is not really great in docs. 2. Use `super::` for the link target, to find the right thing. (`crate` doesn't seem to work in rustdoc, perhaps deliberately, although the error messages are ridiculous and claim the nonexistence of intermediate modules.) 3. Wrap the lines a bit more.
* tor-netdoc: Expose test data under new "testing" feature flagIan Jackson2023-04-055-23/+33
|
* tor-netdoc: Fix feature buildsIan Jackson2023-04-053-3/+6
| | | | | | | | | | | | Fixes cargo +stable test --locked --offline F -p tor-netdoc cargo +stable clippy -p tor-netdoc F --all-targets for values of F including --all-features --features=hs-client --features=hs-common --features=hs-service (nothing)
* Generate a new KP_hss_desc_enc keypair for each new descriptor.Gabriela Moldovan2023-03-312-33/+51
| | | | | | | | | | | | | | | | Previously, to build descriptors for hidden services with client auth enabled, in addition to the list of authorized clients, users of `HsDescBuilder` were required to also provide a descriptor encryption keypair and a descriptor cookie. This was potentially dangerous and/or error-prone, because the ephemeral encryption key and the descriptor cookie are expected to be randomly generated and unique for each descriptor. This change makes `ClientAuth` private to the `hsdesc::build` module and updates `HsDescBuilder` to build `ClientAuth`s internally. Users now only need to provide the list of authorized client public keys. Signed-off-by: Gabriela Moldovan <[email protected]>