aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/hsdesc/build/inner.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-checkable: TimeBound: Make dangerously_into_parts return TimeRangeIan Jackson2026-07-231-1/+2
| | | | | It is better to return a more cooked type. `TimeRange` aka `TimeRangeBound<()>` is perfect for this.
* Use new TimeRangeBound name throughout the treeIan Jackson2026-07-161-2/+2
|
* netdoc: Add new capability negotiation pieces to hsdesc.Nick Mathewson2026-07-021-0/+93
| | | | | | | | The "flow-control" item is documented in proposal 324 section 9.1; there's a ticket (torspec#418) to document it. The "proto" item is documented at https://spec.torproject.org/rend-spec/hsdesc-encrypt.html#item:proto
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-2/+2
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* tor-cert: Ed25519CertBuilder: do builder fn renameIan Jackson2026-04-291-2/+2
| | | | | | Change all call sites. This completes the rename.
* tor-netdoc: encoder: Rename .object() method to .object_bytesIan Jackson2026-03-311-2/+2
| | | | | | | | | | | With the introduction of the derives for document encoding, we now have a trait ItemObjectEncodable. We will want a method on ItemEncoder that takes an ItemObjectEncodable, and that should be called `object` since it's a better approach than working ad-hoc with tor_bytes::Writeable. (For example, an ItemObjectEncodable knows its own label.) So, rename `object` to `object_bytes`.
* netdoc: Add missing docs for encode_pow_params()Gabriela Moldovan2025-12-011-0/+1
|
* tor-netdoc: Rename ItemArgument method to write_arg_ontoIan Jackson2025-11-261-3/+3
| | | | | | | tor_bytes also has a write_onto method. And types (especially utility types like `Ignored`) might conceivably implement both! No need for semver update since this was pub(crate) in the previous release.
* Apply deferred rustfmt churnIan Jackson2025-11-101-2/+2
|
* tor-netdoc: Rename the `build` module to `encode`Ian Jackson2025-11-101-2/+2
| | | | | The word "build" so often in Rust means builder pattern. This module contains functions for encoding.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-6/+6
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Resolve clippy warnings from 1.83Nick Mathewson2025-05-131-3/+2
| | | | | Now that our MSRV is 1.83, clippy is happy to make more recommendations for us.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* Always use full path to rand::thread_rng().Nick Mathewson2025-03-181-2/+1
| | | | | This is partly for consistency, and partly to facilitate a global search-and-replace.
* PoW: Consolidate feature flags into a single flag.Wesley Aptekar-Cassels2024-11-251-9/+9
| | | | | | | | | | | | | | | | | This replaces the hs-pow, hs-pow-full, hs-pow-v1, pow-v1, and pow-full features with a single hs-pow-full feature. It's possible that in the future we will want to split different schemes into different features, but we can do that when it comes up. For now, having this as a single flag makes it clearer what's going on, since the previous thing was not actually expressive enough to capture some things we care about (like "at least one pow scheme is enabled" that works in a future-compatible way). This change is not semver breaking since it's a experimental feature. Related: #1751
* tor-netdoc: Error on PowParams::V1 when hs-pow-v1 is disabled.Wesley Aptekar-Cassels2024-11-251-2/+11
|
* tor-netdoc: Don't include pow_params in HsDesc when feature is disabled.Wesley Aptekar-Cassels2024-11-251-7/+6
|
* tor-netdoc: Support writing pow-params line.Wesley Aptekar-Cassels2024-11-251-0/+86
| | | | | | | I'm not particularly happy with the code that does the actual writing out of the pow-params line, in particular the error handling there seems very verbose. However, I don't know of a better way to structure it given that APIs I'm working with.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Fix typos in commentsTobias Stoeckmann2024-03-061-1/+1
|
* hsdesc: Document why enc_key_cert signbit is always zero.Nick Mathewson2024-01-161-5/+8
| | | | | | Closes #1221. See torspec!240 for a corresponding spec change.
* tor-netdoc: Turn a TODO HSS into #1221.Gabriela Moldovan2024-01-111-1/+2
|
* tor-netdoc: Downgrade some TODO HSS to TODO.Gabriela Moldovan2024-01-111-1/+1
|
* Remove RngCompatExt.Nick Mathewson2023-11-291-4/+2
| | | | | | | | | | This code was needed with the old version of dalek-cryptography, which wasn't compatible with up-to-date versions of the `rand` crate(s). But now that we've upgraded, we can drop this. (We could have left it around and deprecated it, but we are already making a breaking change to tor-llcrypto by upgrading dalek-cryptography.)
* Convert to the latest versions of dalek-cryptographyNick Mathewson2023-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes that we have to adjust for are as follows: * In x25519-dalek: * `StaticSecret` is now behind a feature. * `StaticSecret::new` is deprecated in favor of `StaticSecret::random_from_rng`. * StaticSecret no longer does its own clamping. * In ed25519-dalek: * `SecretKey` has (in effect) been renamed to `SigningKey`. The name `SecretKey` is now an alias for `[u8; 32]`. * `SigningKey` is effectively a keypair, since it contains a public key as well. * `PublicKey` has been renamed to `VerifyingKey`. * The functions to extract a signing key and verifying key have been renamed as you might expect. * `ExpandedSecretKey` has been moved to `hasmat` and no longer implements `sign`. * `ExpanededSecretKey` now has as its elements a scalar and a hash prefix. * Various functions that took `&[u8]` now take `&[u8; N]`. * We no longer need a wrapper for older versions of rand. There is a single test in tor-keymgr that does not pass. I've marked it as ignore for now, in hopes that @gabi-250 can help me figure it out. This closes #808. There are several changes I want to make before we merge, however. They are marked with TODO DALEK.
* tor-netdoc: Use the new HandshakeType enum to represent CREATE2 HTYPEs (fmt).Gabriela Moldovan2023-10-301-17/+21
|
* tor-netdoc: Use the new HandshakeType enum to represent CREATE2 HTYPEs.Gabriela Moldovan2023-10-301-12/+13
| | | | | | | | | | | Representing the supported HTYPEs as `HandshakeType`s instead of `u32`s makes it more difficult to pass in wrong/invalid values to `HsDescBuilder::create2_formats`. This also fixes a descriptor publisher bug spotted by @jnewsome, where the advertised CREATE2 HTYPEs included HTYPE `1`, which is actually supposed to be a reserved value. The publisher now only advertises the `NTOR` HTYPE (just like C Tor).
* tor-cert, tor-netdoc: Use EncodedEd25519Cert instead of Vec<u8>.Gabriela Moldovan2023-10-251-2/+2
|
* Explain why we are sorting intro points.Nick Mathewson2023-10-161-0/+7
|
* Sort introduction point lists by ntor public key.Neel Chauhan2023-10-161-16/+18
| | | | Closes #1039
* Merge branch 'clippy' into 'main'Ian Jackson2023-08-231-0/+1
|\ | | | | | | | | clippy: Suppress needless_pass_by_value in tests See merge request tpo/core/arti!1535
| * Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
| |
* | tor-netdoc: Fix clippy lints.Gabriela Moldovan2023-08-231-5/+5
| |
* | tor-netdoc: Remove redundant `IntroPointDesc` struct.Gabriela Moldovan2023-08-231-30/+2
|/ | | | | | | | | | | | This commit replaces `tor_netdoc::hsdesc::inner::IntroPointDesc` with the (almost identical) `tor_netdoc::hsdesc::IntroPointDesc`. The only difference between the two structs is that `inner::IntroPointDesc` wraps a `Vec<LinkSpec>` instead of a `Vec<EncodedLinkSpec>`. Since `EncodedLinkSpec` can be derived from `LinkSpec` (and vice-versa), and since `hsdesc::inner::IntroPointDesc` never made it in our public API, this commit also removes `hsdesc::inner::IntroPointDesc` in favour of `hsdesc::IntroPointDesc`.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* hsdesc.rs: finally remove "allows".Nick Mathewson2023-06-161-12/+8
| | | | | | The last piece here is removing some needless keygen from the tests. This causes the test output (using the deterministic PRNG) to change.
* netdoc: downgrade some TODO HS to TODO HSS.Nick Mathewson2023-06-161-4/+4
| | | | I'm using HSS for hs-service features.
* Remove hard-coded test certs.Gabriela Moldovan2023-03-271-43/+51
| | | | | | We can use a deterministic rng to generate predictable keypairs instead. Signed-off-by: Gabriela Moldovan <[email protected]>
* Make the HS encoder randomness source injectable.Gabriela Moldovan2023-03-271-2/+5
| | | | | | | This makes it possible to plug in a deterministic randomness source for testing. Signed-off-by: Gabriela Moldovan <[email protected]>
* Use transparent structs instead of builders.Gabriela Moldovan2023-03-241-24/+21
| | | | | | | | The consensus seems to be the builders don't add much value, see [this comment]. [this comment]: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1070#note_2889488 Signed-off-by: Gabriela Moldovan <[email protected]>
* Refactor the inner doc tests to be more DRY.Gabriela Moldovan2023-03-241-53/+55
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* Remove `NetdocText` and replace its uses with `String`.Gabriela Moldovan2023-03-241-6/+6
| | | | | | | | `NetdocText` is a wrapper around a `String` and a type marker. The type annotation proved of limited use, and made the netdoc builder API somewhat awkward to use. Signed-off-by: Gabriela Moldovan <[email protected]>
* Remove some unnecessary visibility restrictions.Gabriela Moldovan2023-03-241-45/+25
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* Create a new `IntroPointDesc` type.Gabriela Moldovan2023-03-241-13/+46
| | | | | | | | | | | | Unlike `hsdesc::IntroPointDesc`, `hsdesc::build::IntroPointDesc` represents link specifiers as `LinkSpec`s rather than `UnparsedLinkSpec`s. Since this is a general-purpose representation of an introduction point and not merely an intermediate representation for decoding/encoding, it will probably need to be factored out of `tor-netdoc` at some point. Signed-off-by: Gabriela Moldovan <[email protected]>
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-241-0/+384
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]>