Commit Graph

326 Commits

Author SHA1 Message Date
Ian Jackson 42df88d6bf Run maint/add_warning to add lint block everywhere 2023-08-23 10:34:00 +01:00
Gabriela Moldovan b1c54adae7
tor-netdir: Use an owned HsBlindId instead of a reference.
`HsBlindId` is `Copy`.
2023-08-22 15:48:07 +01:00
Gabriela Moldovan b0c3fc73ca
tor-hsclient: Use hs_dirs_download instead of the deprecated hs_dirs. 2023-08-22 15:47:51 +01:00
Nick Mathewson 3e34cb6d33 Lower linkspec list parsing into new tor-linkspec method. 2023-08-22 08:04:12 -04:00
Gabriela Moldovan 9a08f04a76
tor-dirclient: Rename download() to send_request().
`download()` is actually a general-purpose function for sending HTTP
requests on a stream. We will soon repurpose it for `POST`-ing
descriptors, so let's rename it to `send_request`.
2023-08-16 16:13:20 +01:00
gabi-250 36056906ad Merge branch 'future_proof_lints' into 'main'
add_warning: Change missing_docs,unreachable_pub to warn

Closes #951

See merge request tpo/core/arti!1470
2023-08-04 14:20:54 +00:00
Gabriela Moldovan ed5a051ebe
tor-proto: Add ClientCirc::start_conversation().
This will enable hidden services to send `RENDEZVOUS1` messages to the
`N`th hop of the circuit rather than the `N + 1`th virtual one (which
can only used after the client and service have completed the
introduction handshake).

This also deprecates `start_conversation_last_hop`.

Closes #959
2023-08-04 13:08:31 +01:00
Nick Mathewson cec6d0ce33 Run add_warnings on all files. 2023-08-04 07:45:04 -04:00
Nick Mathewson 1e96d1b95a Remove semver.md files now that 1.1.7 is out. 2023-08-01 12:55:52 -04:00
Nick Mathewson 3acdf102c7 Increment patchlevel versions of crates with minor changes
These crates are at version 0.x.y, so we don't need to distinguish
new-feature changes from other changes:

```
tor-basic-utils
fs-mistrust
tor-error
tor-geoip
tor-checkable
tor-linkspec
tor-netdoc
tor-netdir
tor-persist
tor-ptmgr
tor-hsservice
```

This crate has a breaking change, but only when the semver-breaking
feature `experimental-api` is enabled:

```
tor-config
```

This crate is at version 1.x.y, but has no new public APIs, and
therefore does not need a minor version bump:

```
arti
```
2023-08-01 10:57:55 -04:00
Nick Mathewson 6f2ae59603 Update minor versions on crates that have had breaking changes
These crates had first-order breaking changes:

```
retry-error
tor-keymgr
tor-proto
tor-hsclient
tor-rtmock
```

Additionally, these broke because they re-exposed RetryError:

```
tor-circmgr
```

Additionally, these broke because they may re-expose something from
tor-proto:

```
    arti-client
    tor-chanmgr
    tor-dirclient
    tor-dirmgr
    tor-guardmgr
```

Additionally, these broke for other fiddly reasons:

`tor-ptmgr` implements traits from tor-chanmgr, which has a breaking
change above.

`arti-hyper` exposes types from arti-client in its API.
2023-08-01 10:51:25 -04:00
Ian Jackson 3e2a909707 Run cargo +nightly fmt to format many let ... else ...
rustfmt has grown opinions about how let ... else ... ought to be
formatted.  They don't always agree with our previous manual
decisions.

I think our policy is to always insist on rustfmt.  When that version
of rustfmt hits stable, our CI will start to fail for everyone.
(Right now this discrepancy just causes trouble for contributors who
are using nightly by default.)
2023-07-24 13:46:05 +01:00
Dimitris Apostolou 947ddfff0c
Fix typos 2023-07-22 10:10:34 +03:00
Ian Jackson ad48335b91 tor-hsclient: Document API break.
This would be a break in higher-layer crates which incorproate this
error but:

 1. That's just arti-client which hides it behind the detailed errors
    cargo feature
 2. I'm hoping cargo-semver-checks would spot it, anyway.
2023-07-19 14:16:13 +01:00
Ian Jackson 36b9d11ecb retry-error: Attempts must be AsRef<dyn Error>; print their sources
The effect is that everywhere a RetryError is used, the error sources
for the contained errors will be Display'd.

In tor-hsclient we no longer need to explicitly wrap things up in
tor_error::Report.
2023-07-19 14:16:13 +01:00
Ian Jackson 3acc2af4f3 Merge branch 'clippy-allow' into 'main'
clippy: Allow some of our existing code patterns

See merge request tpo/core/arti!1396
2023-07-11 09:37:42 +00:00
Alexander Færøy 6be6352b98 Merge branch 'conversation' into 'main'
Overhaul send_control_message

See merge request tpo/core/arti!1367
2023-07-10 13:14:11 +00:00
Alexander Færøy 943c12739d Merge branch 'recurse' into 'main'
tor-hsclient: Mock traits: Work around an async boobytrap

See merge request tpo/core/arti!1365
2023-07-10 13:13:31 +00:00
Ian Jackson 473447a82e Run maint/add_warning to actually apply new lint allows 2023-07-10 13:49:51 +01:00
Nick Mathewson 0b6cc7ba5e Add exceptions for some cases of diverging_sub_expression
See here for documentation on the lint:
https://rust-lang.github.io/rust-clippy/master/index.html#/diverging_sub_expression

The issue here, from what I can tell, is that the lint triggers
whenever you use a diverging expression as a function body within an
2023-07-10 12:33:21 +01:00
Nick Mathewson 25c6fe61e4 Throughout: Use *_report!() macros for reporting Errors.
I identified the cases to replace by searching for the string
`.report()`.  There are a few that I didn't change:

  * A couple of cases that used anyhow::Error,
  * One case that reported two Errors.
  * Two cases in `tor_hsclient::err` that just did
    `error!("Bug: {}")`.

I have also not audited the cases in `tor-hsclient` where we're using
`tor_error::Report` manually.

Nonetheless, closes #949.
2023-07-07 13:00:21 -04:00
Nick Mathewson 03f9f9987a Run add_warning to remove `missing_panics_doc` deny.
Closes #950.
2023-07-06 14:32:23 -04:00
Ian Jackson bc63fdb34c tor-hsclient: Abolish ad-hoc real-world-time sleeps
Now we can reliably wait precisely for the tasks to be all waiting.

This test case no longer involves any real executor.
2023-07-06 15:14:40 +01:00
Ian Jackson 27ad9ca249 tor-proto: run rustfmt 2023-06-30 18:43:20 +01:00
Ian Jackson 226bca984b tor-proto conversation API: Provide ConversationInHandler 2023-06-30 18:43:20 +01:00
Ian Jackson 20f1e065b3 tor-proto conversation API: Return a Conversation
This is just a placeholder for now, but it'll be a thing you can send
more messages with.
2023-06-30 18:03:17 +01:00
Ian Jackson 2882e3a93e tor-proto conversation API: Rename to start_conversation_last_hop
Was send_control_message.
2023-06-30 18:02:56 +01:00
Ian Jackson 3812e3ccdd tor-proto conversation API: Make starting message optional
We're going to let people start a conversation and either expect to
receive first, or send messages ad-hoc later.
2023-06-30 18:02:15 +01:00
Ian Jackson b162d005a7 tor-proto conversation API: Rename to ConversationFinished
Was UninstallHandler.  We are going to talk more about conversations
and less about handlers (although, the fact of there being a handler
will still be visible).
2023-06-30 18:02:04 +01:00
Ian Jackson 21c564fa01 tor-hsclient: Mock traits: Work around an async boobytrap 2023-06-30 17:34:01 +01:00
Nick Mathewson 27bd990a79 Remove semver.md files for 1.1.6 2023-06-30 10:28:53 -04:00
Nick Mathewson de13a7319b Bump patchlevel versions on crates with smaller changes
Done with the commands below.

The following crates have had various changes, and should get a
patchlevel bump. Since they are pre-1.0, we do not need to
distinguish new APIs from other changes.

```
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-circmgr
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p tor-linkspec
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-netdoc
cargo set-version --bump patch -p tor-proto
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-socksproto
```

This crate has new features, but no new non-experimental Rust APIs.
So even though it is post-1.0, it gets a patchlevel bump.

```
cargo set-version --bump patch -p arti
```
2023-06-30 08:42:21 -04:00
Nick Mathewson 65e81bf0ca Bump minor versions on crates with breaking changes
Done with:
```
cargo set-version --bump minor -p tor-hsclient
cargo set-version --bump minor -p arti-rpcserver
cargo set-version --bump minor -p tor-hscrypto
cargo set-version --bump minor -p tor-cell
```
2023-06-30 08:38:16 -04:00
Nick Mathewson a88fa71f25 Resolve XXXs from fixup-features.
Some of these seem spurious: it looks like fixup-features resolved
an issue and then complained about it too.  I'll investigate further.
2023-06-29 17:14:00 -04:00
Nick Mathewson 23c67d92e6 Run "fixup-features". 2023-06-29 17:09:52 -04:00
Gabriela Moldovan b8b8a0d3ac hsclient: Make HsClientSpecifier a newtype instead of a type alias. 2023-06-29 19:28:22 +01:00
Gabriela Moldovan 20713b24bf arti-client, hsclient: Typealias HsClientSpecifier to ArtiPathComponent.
`ArtiPathComponent` is a more generic version of `HsClientSpecifier`.
2023-06-29 19:28:22 +01:00
Ian Jackson c90f9308c5 Merge branch 'timeouts' into 'main'
tor-hsclient: Use estimated timeouts

See merge request tpo/core/arti!1342
2023-06-29 17:19:53 +00:00
Ian Jackson 729bff6ff9 Merge branch 'maxintro3' into 'main'
tor-netdoc: Handle anomalous numbers of introduction points

See merge request tpo/core/arti!1332
2023-06-29 17:09:46 +00:00
Ian Jackson 9f3ec25a08 tor-hsclient: Add some notes about timeouts and hops 2023-06-29 17:41:49 +01:00
Ian Jackson a604989ba7 tor-hsclient: Use estimated timeouts for introduction and rendezvous (fmt) 2023-06-29 17:41:49 +01:00
Ian Jackson 202104d05c tor-hsclient: Use estimated timeouts for introduction and rendezvous
Replacing RPT_IPT_TIMEOUT is not entirely straightforward.
2023-06-29 17:41:49 +01:00
Ian Jackson d48215a961 tor-hsclient: Use estimated timeout for hsdir fetches (fmt) 2023-06-29 17:41:49 +01:00
Ian Jackson 2563256f42 tor-hsclient: Use estimated timeout for hsdir fetches 2023-06-29 17:41:49 +01:00
Ian Jackson a84460426f tor-hsclient: Provide bodge constant for circuit length 2023-06-29 17:41:49 +01:00
Ian Jackson fe2935d7c5 tor-hsclient: Plumb timeout estimation machinery 2023-06-29 17:41:49 +01:00
Ian Jackson 8133f8e456 Merge branch 'debug' into 'main'
tor-hsclient: Reimplement Debug for MockCirc

See merge request tpo/core/arti!1324
2023-06-29 15:46:25 +00:00
Ian Jackson 2b2ecfbb39 tor-hsclient: Reimplement Debug for MockCirc
This is less code.  Also it now dumps the connect_called field which
was introduced in the meantime.
2023-06-29 16:11:03 +01:00
Ian Jackson 799480d885 Merge branch 'circparams' into 'main'
tor-hsclient: Use proper CircParameters

Closes #935

See merge request tpo/core/arti!1340
2023-06-29 15:03:40 +00:00
Nick Mathewson 930ecc9eda Merge branch 'handshake-error' into 'main'
tor-hsclient: Handle handshake completion error correctly

See merge request tpo/core/arti!1336
2023-06-29 13:44:48 +00:00