Commit Graph

467 Commits

Author SHA1 Message Date
Nick Mathewson 6fa821238d Revise all XXXXs from fixup-features 2023-05-15 11:00:28 -04:00
Nick Mathewson 4b08ef76a0 Run fixup-features _with_ annotations.
This litters our Cargo.toml files with "XXX" entries that we should
fix.
2023-05-15 10:41:32 -04:00
Nick Mathewson e2e125fef7 Reformat Cargo.toml files. 2023-05-15 09:09:43 -04:00
Nick Mathewson 7a5373c110 Run fixup-features --no-annotate for initial Cargo.toml fixes.
This does the following:
  - Gives every crate a `full`.
  - Cause every `full` to depend on `full` from the lower-level
    crates.
  - Makes every feature listed _directly_ in `experimental` depend
    on `__is_experimental`.
2023-05-15 09:07:21 -04:00
Nick Mathewson 1442763f3d hspool: Accept any T:CircTarget.
Previously, we only accepted an OwnedCircTarget, which would have
kept us from getting a circuit that was aimed at a specialized
CircTarget that gave us LinkSpecs in a raw order.
2023-05-10 11:00:57 -04:00
Nick Mathewson e845a553f3 Upgrade tracing to 0.1.36.
This is the first version to impl Value for String.

With luck, this will get minimal_versions CI passing.
2023-05-03 11:09:21 -04:00
Nick Mathewson 1904cfc8b9 Increment crate versions.
Because of the errorkind bumps, we're calling this a breaking change
in everything lower-level than `arti`.

Generated with:
```
cargo set-version -p tor-basic-utils --bump minor
cargo set-version -p tor-async-utils --bump minor
cargo set-version -p caret --bump minor
cargo set-version -p fs-mistrust --bump minor
cargo set-version -p safelog --bump minor
cargo set-version -p retry-error --bump minor
cargo set-version -p tor-error --bump minor
cargo set-version -p tor-config --bump minor
cargo set-version -p tor-events --bump minor
cargo set-version -p tor-units --bump minor
cargo set-version -p tor-rtcompat --bump minor
cargo set-version -p tor-rtmock --bump minor
cargo set-version -p tor-rpcbase --bump minor
cargo set-version -p tor-llcrypto --bump minor
cargo set-version -p tor-protover --bump minor
cargo set-version -p tor-bytes --bump minor
cargo set-version -p tor-hscrypto --bump minor
cargo set-version -p tor-socksproto --bump minor
cargo set-version -p tor-checkable --bump minor
cargo set-version -p tor-cert --bump minor
cargo set-version -p tor-linkspec --bump minor
cargo set-version -p tor-cell --bump minor
cargo set-version -p tor-proto --bump minor
cargo set-version -p tor-netdoc --bump minor
cargo set-version -p tor-consdiff --bump minor
cargo set-version -p tor-netdir --bump minor
cargo set-version -p tor-congestion --bump minor
cargo set-version -p tor-persist --bump minor
cargo set-version -p tor-chanmgr --bump minor
cargo set-version -p tor-ptmgr --bump minor
cargo set-version -p tor-guardmgr --bump minor
cargo set-version -p tor-circmgr --bump minor
cargo set-version -p tor-dirclient --bump minor
cargo set-version -p tor-dirmgr --bump minor
cargo set-version -p tor-hsclient --bump minor
cargo set-version -p tor-hsservice --bump minor
cargo set-version -p arti-client --bump minor
cargo set-version -p arti-rpcserver --bump minor
cargo set-version -p arti-config --bump minor
cargo set-version -p arti-hyper --bump minor

cargo set-version -p arti --bump patch
cargo set-version -p arti-bench --bump patch
cargo set-version -p arti-testing --bump patch
```
2023-05-03 08:31:11 -04:00
Nick Mathewson 2efdcd38ff ExitPath: Add an explanation of WeightRole::Exit on non-exit circs
In one case, we use WeightRole::Exit on circuits that can't
actually be used to exit.  This commit adds a comment to explain
why, so that we don't wonder about it in the future, and we have
some indication of whether it's still appropriate.

Closes #785
2023-04-12 09:50:16 -04:00
Nick Mathewson 104d64589d Increment MSRV to 1.65 in every crate. 2023-04-11 15:31:12 -04:00
Nick Mathewson 2f231b2ea0 circmgr: make "testing" depend on guardmgr/testing 2023-04-06 10:24:32 -04:00
Nick Mathewson 43e1128cdf circmgr: Mark a number of internal APIs as hs-only.
This resolves a few dead-code warnings.

Closes #801.
2023-04-06 09:05:12 -04:00
Nick Mathewson c22cf483ff circmgr: Expand an incomplete comment in exitpath.rs 2023-04-06 08:59:41 -04:00
Ian Jackson c29cb6ac2b tor-circmgr: HsCircKind: derive Eq 2023-04-05 15:10:07 +01:00
Nick Mathewson 9ef115a7fb Patchlevel bumps for crates whose dependencies just changed.
These crates had no changes until just a moment ago. But since
we updated the versions on some of their dependents, they have now
changed themselves.  Thus they get patchlevel bumps.

```
tor-rtmock
tor-protover
tor-socksproto
tor-consdiff
tor-chanmgr
tor-dirclient
tor-hsservice
```
2023-03-31 08:30:14 -04:00
Nick Mathewson e208fb15ad Bump crate versions that have breaking changes
These crates have had breaking changes.  They are pre-1.0, so they get
a minor bump.

```
tor-basic-utils
tor-config
```
2023-03-31 08:28:06 -04:00
Nick Mathewson a81ab391ae Bump patchlevel on crates with non-breaking changes
For these crates, the changes are nontrivial, so we
_do_ bump the versions on which their dependent crates depend.

Fortunately, since they are all pre-1.0, we don't need to
distinguish semver-additions from other changes.  (Except for arti,
which _is_ post-1.0, but gets a patchlevel bump anyway.)

These are unstable crates with breaking changes:

```
tor-hscrypto
tor-hsclient
```

These have new or extended APIs:

```
safelog
tor-bytes
tor-cell
tor-linkspec
tor-llcrypto
tor-proto
tor-cert
arti-client
```

These have new unstable APIs or features:
```
tor-netdoc
tor-circmgr (also broke some unstable APIs)
arti (is post-1.0)
```

These have bugfixes only:
```
caret
tor-dirmgr
```
2023-03-31 08:24:39 -04:00
Ian Jackson dd493307f9 tor-circmgr: Make take_or_launch_stub_circuit future Send
thread_rng() isn't Send.  We can fix this by not holding it over an
await point.
2023-03-30 15:46:15 +01:00
Ian Jackson 00e522a91a Add some missing imports
Now
  nailing-cargo +stable clippy -p tor-hsclient --all-features --all-targets
actually works.

squash! Add some missing imports
2023-03-28 15:49:45 +01:00
Nick Mathewson dffaf60e4a hspool: simplify loop and add a maximum 2023-03-22 12:35:41 -04:00
Nick Mathewson bd80125d73 hspool: Clarify/document more TODO HS items. 2023-03-22 12:35:41 -04:00
Nick Mathewson 19a229155c circmgr: Make a separate SupportedCircUsage for HS stuff
This uncovered a bug: NoUsage wasn't correct for Hs circuits because
of its behavior with channel_usage().
2023-03-22 12:35:41 -04:00
Nick Mathewson 35967ca38d circmgr: Declare builder() unconditionally.
(Still, only expose it when experimental-api is enabled.)
2023-03-22 12:35:41 -04:00
Nick Mathewson 5b3c6b6bb3 hspool: Tweak comments and add more TODOs. 2023-03-22 12:35:41 -04:00
Nick Mathewson fcb4df8b5b circmgr: hspool now launches circuits in the background.
The prediction and scheduling logic here is quite primitive;
we should probably refactor it considerably.  This should be good
enough for now, though.
2023-03-22 12:35:41 -04:00
Nick Mathewson a14214fae6 circmgr: Add an actual pool to HsCircPool.
We now have support for a pool of pre-build circuits that we can use
for HS-related purposes, and we take circuits from this pool as
needed.

Nothing populates or cleans the circuit pool yet.
2023-03-22 12:35:41 -04:00
Nick Mathewson adafae8b3f circmgr: Begin an HS circuit pool structure
This is now enough to launch circuits on demand.  It still needs to
pre-build the first three hops, and to retry on failure.
2023-03-22 11:52:17 -04:00
Nick Mathewson dce4da55ae circmgr: Add a usage for building the beginning of an hs circ
This only builds the first 3 hops. It can be extended to a fourth
hop later -- or not, depending on the circuit kind.
2023-03-22 11:52:17 -04:00
Nick Mathewson ec8c7eec4e circmgr: Functions to launch an unmanaged circuit.
We'll use this to implement the circuits used by onion circuits.
2023-03-22 11:52:11 -04:00
trinity-1686a a2f2b31751 remove unused type parameter 2023-03-18 20:43:17 +01:00
Nick Mathewson 552acbf07f Fix a bunch of needless-conversion warnings.
Apparently 1.68 now warns when you call into_iter() on something
that's already an iterator.  Fair enough.  Let's stop doing that.
2023-03-10 07:09:50 -05:00
Nick Mathewson fe6e7e52e3 Fix an unrelated missing cfg_attr. 2023-03-08 14:21:33 -05:00
Ian Jackson bf2c0d6ff8 hsclient: Abolish knowledge of HS circuits in circmgr
Abolish CircMgr::get_or_launch_onion_client and everything to support
it.  We have decided that `.onion` diversion ccan't/shouldn't occur in
tor-circmgr.  Probably, it should occur much higher up - arti-client
maybe - since it will sometimes need ambient authority (KS_hsc_*).

Now all knowledge of HS connections is in tor-hsclient.  This
gets rid of a layering inversion and the trait needed for tor-circmgr
to do the upcall to tor-hsclient.
2023-03-01 18:12:29 +00:00
Ian Jackson 288b7b6ad1 Apply rustfmt 2023-03-01 16:27:19 +00:00
Ian Jackson feab6faa9e tor-circmgr: Provide testing feature and TestConfig
Like the similar thing in tor-guardmgr.
2023-03-01 16:20:16 +00:00
Ian Jackson a45acb3905 HS API: Remove HS client keys from circmgr API
*If* we're going to retain any HS knowledge in circmgr, it definitely
doesn't need to know about per-operation client secrets.

(Maybe there might be ambient secrets, used for .onion diversion, but
they don't need to be in this API.)
2023-03-01 16:18:09 +00:00
Ian Jackson feeb38c750 HS planning: Discuss whether to remove all HS code from circmgr 2023-03-01 16:18:09 +00:00
Ian Jackson 06e6e11886 HS planning: Intend for HS connector to do all lifecycle mgmt
Otherwise there has to be a state entry in the circmgr *and* a state
entry in the hs connector, for every HS.  This division of
responsibilit will be confusing.

The HS code will then be more completely just a layer on top of circmgr.
2023-03-01 16:17:47 +00:00
Nick Mathewson f41449d0bd Patchlevel bumps for remaining changed crates.
These crates have had small code changes, but no API additions:

tor-config
tor-socksproto
tor-cert
tor-chanmgr
tor-ptmgr
tor-guardmgr
tor-circmgr
tor-dirclient
tor-dirmgr
arti
tor-hsservice
tor-congestion

These crates have had API extensions:

fs-mistrust
tor-llcrypto
tor-bytes
tor-checkable
tor-linkspec
tor-netdoc
tor-persist
arti-client
2023-02-28 07:13:27 -05:00
Nick Mathewson 4479d52a88 Bump patch-versions for breaking changes in tor-hs{crypto,client}
These are API breaks, but the crates themselves are currently
100% experimental, so there's no need to bump the minor versions
according to our semver rules.
2023-02-28 07:06:15 -05:00
Nick Mathewson 3e257a7cb5 Bump minor versions for significant breaking changes.
This includes tor-cell, tor-proto, and tor-netdir.
2023-02-28 07:05:15 -05:00
Ian Jackson f63c7c48af Rename onion-* cargo features to hs-* in tor-* crates
Fixes #756
2023-02-28 11:10:17 +00:00
Nick Mathewson 99ec1c9818 tor-hscrypto: Rename key types to correspond to new spec names. 2023-02-08 12:27:36 -05:00
Nick Mathewson 8ee04ac203 Merge branch 'logs' into 'main'
Report causes of errors

Closes #680

See merge request tpo/core/arti!997
2023-02-01 18:19:33 +00:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
These crates had API or behavior changes that may affect downstream
crates. Fortunately, they're all version 0.x, and don't need minor
bumps for this.
2023-02-01 10:36:29 -05:00
Nick Mathewson 66f594a4b6 Bump the patch-level version of crates with _minor_ changes.
These changes influence behavior, but not effect compatibility.
(If I messed up, and any crate except for `arti` has non-breaking
API changes, that's still fine, since they are all version
0.x.)
2023-02-01 10:23:58 -05:00
Ian Jackson 37edcd688a Use ErrorReport - run rustfmt
Split off for ease of review and possible rebase.
2023-01-30 18:52:32 +00:00
Ian Jackson 3a8c36e9c6 Use ErrorReport for remaining errors in error! in tor-circmgr 2023-01-30 18:52:32 +00:00
Ian Jackson 25c41977ac Use ErrorReport for errors in warn! in tor-circmgr 2023-01-30 18:52:32 +00:00
Ian Jackson f657ef5b6c Use ErrorReport for errors in info! in tor-circmgr 2023-01-30 17:59:09 +00:00
Nick Mathewson b7c8646d7b circmgr: drop a receiver more explicitly.
Clippy now complains about `let _ = (expr_producing_a_future);`,
which is probably smart, since maybe you wanted to await that future
and ignore the result.  So it seems that the right way to get rid of
an unwanted Receiver is now to drop it explicitly.

Closes #749
2023-01-27 09:16:51 -05:00