aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/hsdesc.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* netdoc: fill in some test dataNick Mathewson2023-06-231-1/+6
| | | | | This resolves some TODO HS items now that we are confident we want to have these actual examples in our tests.
* hsdescerror: Add paragraph breaks to docs.Nick Mathewson2023-06-221-3/+11
|
* netdoc: Use a dev-dependency on anyhow to fix a doc exampleNick Mathewson2023-06-221-1/+1
|
* netdoc: Introduce HsDescErrorNick Mathewson2023-06-221-26/+114
| | | | | | | | | | 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-221-1/+1
|\ | | | | | | | | | | | | 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-211-1/+1
| | | | | | | | Part of #736
* | 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-161-1/+1
| | | | | | 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-161-4/+4
|
* 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.
* 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]>
* 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-101-1/+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-101-1/+1
|/ | | | | | | | | | | `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-021-0/+1
| | | | 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-251-1/+30
| | | | | | | | | This adds the `HsDesc::parse_decrypt_validate` method, which parses, decrypts, and validates HS descriptors. Closes #809 Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-netdoc: Expose test data under new "testing" feature flagIan Jackson2023-04-051-19/+29
|
* tor-netdoc: Fix feature buildsIan Jackson2023-04-051-0/+1
| | | | | | | | | | | | 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)
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-241-21/+21
| | | | | | | | | | | | | | This introduces the `NetdocBuilder` trait described in `netdoc-builder.md` and a new `tor-netdoc::doc::hsdesc::build` module, which exports the `HsDescBuilder`. Hidden services will use `HsDescBuilder` to build and encode hidden service descriptors. There are several TODOs in the code that I'm planning to address separately. Partially addresses #745. Signed-off-by: Gabriela Moldovan <[email protected]>
* Fix typosDimitris Apostolou2023-03-031-1/+1
|
* tor-netdoc: Validate inner certs in HsDescNick Mathewson2023-03-011-16/+32
| | | | | | | | | | | | This makes our implementation behave the same as the C tor implementation, by validating all of the expiration and signatures on the certificates in the inner document. (It is still not semantically necessary to check these certs: the document in which they appear is already signed by the key with which they are allegedly signed.) Closes #744
* Apply a missing cfg_attr(docsrs...) in netdocNick Mathewson2023-02-211-0/+1
|
* tor-netdoc: Use UnparsedLinkSpec in IntroPointDesc.Nick Mathewson2023-02-171-9/+2
|
* netdoc: Add a feature to expose hsdesc inner doc parsersNick Mathewson2023-02-141-0/+3
| | | | | | | We want to fuzz these parsers, but there's no currently way to get at the parsers for inner documents without going through a lot of encryption. (Coverage-guided fuzzers are powerful, but they can't find SHA3 preimages.)
* netdoc: give hsdesc test info in its original form.Nick Mathewson2023-02-131-1/+5
|
* netdoc: Add a test for HSDesc decryption.Nick Mathewson2023-02-101-0/+63
|
* hsdesc: Use an IntegerMinutes<u16> to hold lifetime.Nick Mathewson2023-02-081-4/+13
|
* netdoc: Fix most "TODO HS rename" commentsNick Mathewson2023-02-081-6/+4
|
* netdoc::hsdesc: Distinguish layer from document.Nick Mathewson2023-02-081-36/+30
|
* netdoc::hsdesc: Rename "layer" modules.Nick Mathewson2023-02-081-12/+11
|
* netdoc::hsdesc: Excise reference to "password" authenticationNick Mathewson2023-02-081-2/+0
| | | | As far as we can tell, this never existed.
* tor-hscrypto: Rename key types to correspond to new spec names.Nick Mathewson2023-02-081-7/+8
|
* Rename key identifiers that have changed in the specNick Mathewson2023-02-081-3/+3
| | | | | | | | | Generated with perl: s/K([PS])_hs_intro_tid/K$1_hs_ipt_sid/g; s/K([PS])_onion_ntor/K$1_ntor/g; s/K([PS])_hs_intro_ntor/K$1_hss_ntor/g; s/K([PS])_hs_desc_ephem/K$1_hss_desc_enc/g;
* netdoc: Add a comment about renaming layer to document.Nick Mathewson2023-02-071-0/+9
|
* netdoc::hsdesc: rename Passwd to Password.Nick Mathewson2023-02-071-1/+1
|
* netdoc: Rename/comment objects from hsdesc.Nick Mathewson2023-02-071-9/+15
|
* netdoc: Rename/comment objects from inner_layer.Nick Mathewson2023-02-071-3/+9
|
* netdoc: Rename/comment objects from middle_layer.Nick Mathewson2023-02-071-1/+1
|
* netdoc: Try to add a bunch of clarifying documentation.Nick Mathewson2023-02-071-7/+16
| | | | | In the process I found a couple of keys without identifiers in the spec.
* netdoc: Clear up a few typos in hsdesc comments and strings.Nick Mathewson2023-02-071-4/+4
|
* netdoc: Implement onion service descriptor parsers.Nick Mathewson2023-02-071-31/+179
|
* netdoc: Parse the inner layer of an onion service descriptor.Nick Mathewson2023-02-071-0/+3
| | | | | | | | | There are some places where I note certificates which are not currently validated, because there is no cryptographic point in doing so. We should either document that this is okay, or validate the certificates anyway. This code might benefit from refactoring to make it prettier.