aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/hsdesc/build/outer.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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-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`.
* Apply deferred rustfmt churnIan Jackson2025-11-101-1/+1
|
* tor-netdoc: Rename the `build` module to `encode`Ian Jackson2025-11-101-1/+1
| | | | | 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-1/+1
| | | | | | | | | | | | | | 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.
* Wrap ed25519-dalek types.Nick Mathewson2025-03-181-1/+0
| | | | | | | | | | | With this change, we'll no longer need to expose the types from dalek-cryptography as part of our API, and we'll have more freedom to switch ed25519 implementations, or to upgrade to a newer `rand` ahead of their schedule. Unlike with x25519-dalek, I had to tweak the API a bit: There's no way to get a &PublicKey out of a Keypair now, and implementing the old ed25519-dalek traits seemed unnecessary.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* llcrypto: Remove redundant re-exports in keymanip.Nick Mathewson2023-11-291-1/+1
| | | | (These types were all already re-exported from pk::ed25519.)
* Remove RngCompatExt.Nick Mathewson2023-11-291-2/+1
| | | | | | | | | | 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-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove a broken rustdoc link and fix a typo.Nick Mathewson2023-10-271-3/+0
|
* tor-cert, tor-netdoc: Use EncodedEd25519Cert instead of Vec<u8>.Gabriela Moldovan2023-10-251-4/+3
|
* tor-netdoc: Remove now-unused blinded_id field.Gabriela Moldovan2023-10-251-6/+0
|
* tor-netdoc: Update HsDesc, HsDescOuter to accept the hs_desc_sign cert as an ↵Gabriela Moldovan2023-10-251-15/+16
| | | | | | | | | | argument. This will enable us to (eventually) the load the descriptor signing key cert from the keystore (as opposed to always recomputing it when building the `HsDesc`). Part of #1048
* tor-netdoc: Add helper function for computing the descriptor signing key cert.Gabriela Moldovan2023-10-251-12/+4
|
* tor-dirclient, tor-netdoc: Add TODO SPECs.Gabriela Moldovan2023-10-241-0/+3
|
* tor-netdoc: Use an unpadded base64 encoding for the signature.Gabriela Moldovan2023-10-241-3/+3
| | | | This is what the C Tor HsDirs want.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* netdoc::doc::hsdesc changes to let us downgrade/remove allowsNick Mathewson2023-06-161-1/+1
|
* netdoc, hsclient: Update remaining ed25519::SecretKey usersNick Mathewson2023-05-181-6/+5
| | | | | | Fortunately, these are all in experimental code. Closes #798
* 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-111-1/+2
|/ | | | | | | | | | | | 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.
* Merge branch 'fix-broken-doc-links' into 'main'Nick Mathewson2023-03-301-3/+3
|\ | | | | | | | | Fix broken doc link. See merge request tpo/core/arti!1082
| * Fix broken doc link.Gabriela Moldovan2023-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a broken doc link I introduced in !1070: ``` error: unresolved link to `crate::doc::hsdesc::build::inner::HsDescInnerBuilder` --> crates/tor-netdoc/src/doc/hsdesc/build/middle.rs:34:11 | 34 | /// [`crate::doc::hsdesc::build::inner::HsDescInnerBuilder`] as described in sections | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `HsDescInnerBuilder` in module `inner` | = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings` error: could not document `tor-netdoc` ``` Signed-off-by: Gabriela Moldovan <[email protected]>
* | Remove hard-coded test certs.Gabriela Moldovan2023-03-271-7/+8
| | | | | | | | | | | | 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/+4
| | | | | | | | | | | | | | This makes it possible to plug in a deterministic randomness source for testing. Signed-off-by: Gabriela Moldovan <[email protected]>
* | Use the type system to enforce use of blinded keys.Gabriela Moldovan2023-03-271-8/+23
|/ | | | | | | | | | | | | | | Hidden services use blinded singing keys derived from the identity key to sign descriptor signing keys. Before this patch, the hidden descriptor builder represented its blinded signing keys (`blinded_id`) as plain `ed25519::Keypair`s. This was not ideal, as there was nothing preventing the caller from accidentally initializing `blinded_id` with an unblinded keypair. This introduces a new `HsBlindKeypair` type to represent blinded keypairs. 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]>
* Remove `NetdocText` and replace its uses with `String`.Gabriela Moldovan2023-03-241-4/+3
| | | | | | | | `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-51/+33
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* Use the less ambiguous inner/middle/outer terminology.Gabriela Moldovan2023-03-241-1/+1
|
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-241-0/+183
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]>