summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Make the HS encoder randomness source injectable.Gabriela Moldovan2023-03-275-50/+46
| | | | | | | | | | | | | | | | | | | | | This makes it possible to plug in a deterministic randomness source for testing. Signed-off-by: Gabriela Moldovan <[email protected]>
* | | tor-netdir: Use `pos` not `idx` in test network constructorsIan Jackson2023-03-271-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are too many things called "index" here. `idx` could be read to mean the table index `RouterStatusIdx`, the hsdir hash `HsDirIndex`, or an entry in some other one of these tables. Here's, it's just the sequence number of the index in the test netdir. Use `pos` for that. (`seq` would have been another possibility.)
* | | tor-netdir: Use `hsdir_index` for hidden service directory hashval (fmt)Ian Jackson2023-03-271-1/+4
| | |
* | | tor-netdir: Use `hsdir_index` for hidden service directory hashvalIan Jackson2023-03-271-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hidden services directory hashring is a ring of hsdir relays, sorted by a hash that the spec calls the "index". That's `HsDirIndex`. This was a bad idea because the word "index" is seriously overused, but in Arti we must use the same terminology. At least, qualify it everywhere. Now one of these hsdir sort position hashes is always, in our code, an `hsdir_index`. I think this is necessary even inside modules called `hsdir_*`, because those can deal with other kind of "index" too.
* | | tor-netdir: eliminate ref to abolished MdEntryIan Jackson2023-03-271-2/+2
| | | | | | | | | | | | | | | This was removed in c3e74973b4201f71275d8cf4c0c954cfb8d0eba5 netdir: Use an even smaller rep for list of microdescs
* | | tor-netdir: Use `rsidx` consistent for `RouterStatusIdx`Ian Jackson2023-03-272-42/+42
|/ / | | | | | | | | | | | | | | | | This is an `IndexVec` key type. Some places used `idx`, some `rsi`, some `rs_idx`. Use `rsidx` for it everywhere, including in locals, function names, and fields. `rsidx` is a compromise. `rsi` might be a bit opaque, but we want a one-"word" name since it appears inside other names.
* / Use the type system to enforce use of blinded keys.Gabriela Moldovan2023-03-275-29/+79
|/ | | | | | | | | | | | | | | 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]>
* tor_client: Add some example code for BridgeConfig.Nick Mathewson2023-03-241-0/+49
| | | | Closes #791
* arti-client: Make TransportConfigListBuilder public.Nick Mathewson2023-03-241-1/+8
| | | | | | | Without this there's no convenient way to add a transport without messing with serde/toml. Found while working on #791
* Use transparent structs instead of builders.Gabriela Moldovan2023-03-244-100/+95
| | | | | | | | 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-246-66/+21
| | | | | | | | `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-243-130/+74
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* Create a new `IntroPointDesc` type.Gabriela Moldovan2023-03-242-21/+55
| | | | | | | | | | | | 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]>
* Use the less ambiguous inner/middle/outer terminology.Gabriela Moldovan2023-03-243-17/+19
|
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-2415-44/+1278
| | | | | | | | | | | | | | 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]>
* Define constants for `AuthClient` field lengths.Gabriela Moldovan2023-03-242-7/+19
| | | | | | | These are used in multiple places (and will also be used by the HS descriptor encoder later on), so let's make them named constants. Signed-off-by: Gabriela Moldovan <[email protected]>
* Implement `ItemArgument` for `String`.Gabriela Moldovan2023-03-241-0/+6
| | | | | | | This makes some code a bit more concise, as it allows us to make `Strings` into `ItemArgument`s without calling `.as_str()`. Signed-off-by: Gabriela Moldovan <[email protected]>
* Merge branch 'openssl_update' into 'main'Ian Jackson2023-03-241-1/+1
|\ | | | | | | | | Update required openssl version See merge request tpo/core/arti!1077
| * Update required openssl versionNick Mathewson2023-03-241-1/+1
| | | | | | | | cargo-audit is complaining about 0.10.45.
* | Fix typosDimitris Apostolou2023-03-241-1/+1
|/
* Merge branch 'paths' into 'main'Alexander Færøy2023-03-232-5/+64
|\ | | | | | | | | | | | | Do minimal $ and ~ handling even without expand-paths and fix build Closes #790 See merge request tpo/core/arti!1069
| * tor-config: Apply deferred rustfmt churnIan Jackson2023-03-211-4/+4
| |
| * tor-config: Do minimal $ and ~ handling even without expand-pathsIan Jackson2023-03-212-2/+58
| | | | | | | | Fixes #790
| * tor-config: Make CfgPathError PartialEq but only when testingIan Jackson2023-03-211-0/+1
| | | | | | | | So, this is not a semver addition.
| * tor-config: Fix build when expand-paths is disabledIan Jackson2023-03-211-2/+5
| |
| * tor-config: paths, unexpanded: use infallible conversionIan Jackson2023-03-211-2/+1
| | | | | | | | str can always be made into a PathBuf.
* | Merge branch 'upgrade_dirs' into 'main'Alexander Færøy2023-03-233-4/+4
|\ \ | | | | | | | | | | | | Bump to the lastest versions of dirs and directories. See merge request tpo/core/arti!1072
| * | Bump to the lastest versions of dirs and directories.Nick Mathewson2023-03-223-4/+4
| | |
* | | Add an experimental circuit accessor to DataStream.Nick Mathewson2023-03-232-2/+34
| | | | | | | | | | | | Closes #784.
* | | Apply deferred rustfmt churnIan Jackson2023-03-231-1/+4
| | |
* | | arti-client: Include redacted HsId in ObtainHsCircuit errorIan Jackson2023-03-233-5/+5
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1071/diffs?commit_id=580fe1118dbbbfa086d11b28e3e26d7c91afe21c#fbd7ab2d6d0a5b515697d4f9f99a42ebd508aa4b_153_165
* | | safelog: impl From<T> for Redacted<T>Ian Jackson2023-03-232-0/+2
| | | | | | | | | | | | I think this is uncontroversial; we already have it for Sensitive.
* | | arti-client: Fix wording of docs for TorClient::isolationIan Jackson2023-03-231-1/+1
| | |
* | | arti-client: Strengthen an HS todoNick Mathewson2023-03-231-1/+1
| | |
* | | tor-proto: Feature-conditionalise some enum variantsIan Jackson2023-03-231-0/+6
| | | | | | | | | | | | This avoids some dead code warnings when building without send-control-msg.
* | | tor-proto: Split off send-control-msg featureIan Jackson2023-03-234-7/+8
| | |
* | | arti: Provide onion-service-client featureIan Jackson2023-03-232-1/+4
| | | | | | | | | | | | Here I use the name I propose in !1039.
* | | arti-client: Call tor-hsclient to create HS connectionsIan Jackson2023-03-232-4/+27
| | | | | | | | | | | | | | | Obviously this still doesn't work because the actual impl in hsclient is just a todo!().
* | | arti-client: Create an HsClientConnectorIan Jackson2023-03-233-1/+24
| | |
* | | arti-client: Move client stream creation out of match, in connectIan Jackson2023-03-231-16/+17
| | | | | | | | | | | | We want this part for HS too.
* | | arti-client: Break out TorClient::isolation(prefs)Ian Jackson2023-03-231-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | We're going to want to reuse this. Also: rename StreamPrefs::isolation and update the docs, to better reflect its rather limited functionality. The new TorClient::isolation is the only call site.
* | | tor-hsclient: Have the public API take StreamIsolationIan Jackson2023-03-231-2/+7
| | |
* | | tor-hsclient: impl HasKind for errorsIan Jackson2023-03-231-1/+20
| | |
* | | tor-hsclient: Swap errors so Bug comes lastIan Jackson2023-03-231-4/+4
| | | | | | | | | | | | This seems more consistent with the way it's done elsewhere.
* | | tor-hsclient: Document clone-nature of HsClientConnectorIan Jackson2023-03-231-0/+3
|/ /
* | hspool: simplify loop and add a maximumNick Mathewson2023-03-221-41/+39
| |
* | hspool: Clarify/document more TODO HS items.Nick Mathewson2023-03-221-2/+8
| |
* | circmgr: Make a separate SupportedCircUsage for HS stuffNick Mathewson2023-03-221-3/+6
| | | | | | | | | | This uncovered a bug: NoUsage wasn't correct for Hs circuits because of its behavior with channel_usage().
* | tor-proto: document deep-copy in ClientCirc::path()Nick Mathewson2023-03-221-0/+4
| |