aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-cell/src/relaycell/hs
Commit message (Collapse)AuthorAgeFilesLines
* hsclient: Support protocol negotiation for CGO and flowctrl-ccNick Mathewson2026-07-021-0/+5
|
* cell: Accessors for more intro extensions.Nick Mathewson2026-07-021-7/+16
|
* tor-llcrypto: Stop deriving Deref in CtByteArrayNeel Chauhan2025-11-241-1/+1
|
* tor-hsservice: Change capping of PoW effort.Wesley Aptekar-Cassels2025-08-131-10/+0
| | | | | | | | This caps the PoW effort during sorting, rather than at intake. This allows us to record efforts that are capped in our metrics histogram while only recording metrics after the PoW solve has actually been verified.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-3/+3
| | | | | | | | | | | | | | 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.
* tor-cell: Add ProofOfWorkV1::cap_effort function.Wesley Aptekar-Cassels2025-08-051-0/+10
|
* Add methods for getting proof-of-work extension from intro request.Wesley Aptekar-Cassels2025-05-271-0/+9
|
* cell: Unify HS-ntor and ntor-v3 extensions.Nick Mathewson2025-05-074-28/+9
| | | | | | Implements proposal 358. Closes #1946.
* cell: Make decl_extension_group macro more self-contained.Nick Mathewson2025-05-072-2/+2
| | | | Previously it required the caller to import a whole bunch of stuff.
* cell: move ExtList module out of hs module.Nick Mathewson2025-05-074-223/+3
| | | | We're going to use it for ntorv3 extensions as well.
* 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.
* fix: fix typosDimitris Apostolou2025-01-061-1/+1
|
* PoW: Consolidate feature flags into a single flag.Wesley Aptekar-Cassels2024-11-251-1/+1
| | | | | | | | | | | | | | | | | 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-cell: add clippy allowsSteven Engler2024-11-201-0/+1
|
* hs-pow: Clarify a confusing comment in ProofOfWorkV1.Wesley Aptekar-Cassels2024-10-091-1/+1
| | | | Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Rename seed to seed_head.Wesley Aptekar-Cassels2024-10-091-3/+3
| | | | | | Feedback from the hs-pow code review, the internal seed heading member should be seed_head instead of seed, for consistency. Very low impact change since the field name is not public.
* hs-pow: Refactor to prefer stub types rather than cfg sprawl.Wesley Aptekar-Cassels2024-10-094-29/+90
| | | | | | | | | | | | | | | | | | | | | | In this design, the thin multiplexing layer between PoW types is always available when onion services are in use, but the specific pow schemes (and their dependency libraries) are gated by crate features everywhere. There are now no new cfg() gates. When the pow-v1 scheme is disabled, we can parse `pow-params v1` lines into an empty type (so clients know a PoW scheme exists that might be supported if they were configured differently). We currently don't save the contents of unknown hsdesc items. On the relaycell side, the hs ext module already sets a strong precedent for keeping unrecognized data as a byte vec, and it doesn't provide a good way to signal soft parse errors like unrecognized optional extensions. There, the `v1` type is completely optional, and services lacking a pow scheme suggested by a client would see one of these 'unrecognized' blobs. This isn't necessarily helpful but it fits the rest of the design. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* tor-hspow: Big refactor, dissolve this crateWesley Aptekar-Cassels2024-10-093-48/+61
| | | | | | | | | | | | | | | | | My previous strategy here was to try and centralize hspow in one crate, writing it like a self-contained feature. That introduced friction in the data types, prompting the use of simplistic types at the netdoc/cell layers and full-featured types in the optional modules. This changes tactics, dissolving the low-level parts of tor-hspow into tor-hscrypto and the high-level parts into hsclient/hsservice. Full featured types are used everywhere now, but the tradeoff is that compile-time configurability is a lot more pervasive. Anything that knows about PoW types at all needs to be fully configured out. I took this opportunity to try a more complete set of crate features, allowing users to configure individual PoW schemes. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* tor-cell: Support encoding proofs-of-work in intro_payloadWesley Aptekar-Cassels2024-10-092-4/+110
| | | | | | | | | Like parameters, PoW solutions are versioned to account for multiple algorithms over time. A single solution of a specific version may accompany an INTRO1/2 as part of the encrypted extensions section. Its encoding may depend on the version. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* tor-memquota: Explain choice of boundsIan Jackson2024-10-021-0/+2
| | | | | Properted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2459#note_3086841
* Revert "tor-cell: Use HasMemoryCostStructural, rather than Copy"Ian Jackson2024-10-021-1/+2
| | | | This reverts commit def8810156f8c2bf8f18ef9ad75a61601f6fea78.
* tor-cell: Use HasMemoryCostStructural, rather than CopyIan Jackson2024-10-021-2/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2459#note_3086839
* Some HasMemoryCost impls in tor-cellIan Jackson2024-10-022-6/+19
|
* tor-cell: impl Eq, PartialEq, Hash for est_intro::DosParamsIan Jackson2024-02-211-1/+1
| | | | | | We only need Eq and PartialEq but given those we should have Hash too. (We're going to want to be able to compare parameters for equality.)
* Convert to the latest versions of dalek-cryptographyNick Mathewson2023-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add more reference links.Nick Mathewson2023-11-201-1/+5
|
* Improve documentation in/around DosParams extensionNick Mathewson2023-11-201-1/+11
| | | | | | It does not help that C tor has a set of parameters and a set of configuration options with exactly the same names which configure the same thing in two slightly different ways.
* tor-cell: Remove unused by_type() functionNeel Chauhan2023-10-131-10/+0
|
* cell: Add accessors to IntroduceHandshakePayloadNick Mathewson2023-08-161-0/+15
|
* cell, docs: Clarify what we mean by "Unrecognized".Nick Mathewson2023-08-151-2/+3
|
* cell: make establish_intro accept impl<Into<HsMacKey>>Nick Mathewson2023-08-141-15/+14
| | | | | | | | | | | This allows us to allow passing in opaque HsMacKey objects, rather than untyped byte slices. Additionally, we now check both MAC and signature unconditionally, to avoid the large timing side-channel. The small timing side-channel of combining booleans with `&` is considered safe. Part of #993.
* Fix typosDimitris Apostolou2023-07-221-1/+1
|
* tor-cell: Downgrade 2 TODO-HS to TODO-HSSNick Mathewson2023-06-161-1/+1
|
* cell: Downgrade a couple more TODO HS comments.Nick Mathewson2023-06-131-2/+2
|
* cell: Remove some TODOsNick Mathewson2023-06-132-8/+2
| | | | | Yes, we still will need more accessors for onion services, but we can add them as we find the need.
* cell: remove/localize "allow(dead-code)"Nick Mathewson2023-06-132-3/+3
|
* Rename UnparsedLinkSpec => EncodedLinkSpecNick Mathewson2023-05-101-3/+3
|
* Serval rustdoc link fixes.Nick Mathewson2023-03-081-2/+2
|
* intro_payload: various doc fixes and TODOs from review.Nick Mathewson2023-03-081-4/+16
|
* tor-cell: Be a little more pedantic about INTRODUCE cell types.Nick Mathewson2023-03-081-3/+3
|
* tor-cell: Better describe the parts of intro payload.Nick Mathewson2023-03-081-3/+23
|
* tor-cell: Add code for the payload of an hs-ntor handshake.Nick Mathewson2023-03-061-0/+142
| | | | | | (This is the encrypted information inside the INTRODUCE2 cell; it's used by the client to tell the service where to find its rendezvous point.)
* tor-cell: Use a match when checking auth_key_typeNick Mathewson2023-03-011-6/+8
|
* tor_cell: Use nested readers and writers for EstablishIntroNick Mathewson2023-03-011-18/+12
|
* tor-cell: tweak comments on EstablishIntro members.Nick Mathewson2023-03-011-2/+2
|
* Introduce a constant for the length of the output of hs_mac()Nick Mathewson2023-03-011-3/+3
|
* tor-cell: Rename EstablishIntro{Body => Details}Nick Mathewson2023-03-011-8/+8
|
* tor-cell: Make EstablishIntro do signaturesNick Mathewson2023-03-011-38/+229
| | | | | | | | | | | | | | | | The old code parsed and encoded a signature and a mac... but there was no way to actually set them properly. Now EstablishIntro is built around an EstablishIntroBody, and has the ability to check signatures and macs. Because there is no way to handle one of these messages if we can't check the signature, we no longer accept unrecognized `auth_key` types in this message. I've added a test to make sure that we can validate a message from the C tor implementation, and a test to make sure we can validate our own cells. I also had to modify the previous tests so that their keys were well-formed.
* Mark a quoted block as text, so doctest ignores it.Nick Mathewson2023-02-161-1/+1
|
* Add a TODO about combining several macros and patternsNick Mathewson2023-02-161-0/+4
|