Commit Graph

989 Commits

Author SHA1 Message Date
Ian Jackson 7fab912f00 tor-rtcompat: Debug dump type of contained inner runtime 2022-03-02 18:02:03 +00:00
Ian Jackson 42f9b3c186 Replace manual Default, and abolish new, in tor-rtcompat
The Default impl was the only call site for new()
2022-03-02 18:01:18 +00:00
Ian Jackson 89074a1326 Replace manual Default and new with std derive in tor-proto 2022-03-02 18:01:08 +00:00
Ian Jackson 535e4ff118 Replace manual Default and new with std derive in tor-netdoc 2022-03-02 18:01:08 +00:00
Ian Jackson 4dfd1ef9cd Replace manual Default and new with std derive in tor-dirclient 2022-03-02 18:01:08 +00:00
Ian Jackson e45a95f65a Replace manual Default impl with std derive in tor-config 2022-03-02 18:01:08 +00:00
Ian Jackson 2becfcf894 Replace manual Default impl with std derive in tor-cell 2022-03-02 18:01:08 +00:00
Ian Jackson 486c73b6b7 Replace manual Clone impl with std derive in retry-error
This just clones the fields.  It is not clear to me why it was
written this way in be86df631d
   Remove anyhow dependency from tor-retry, and rename it to retry-error

Previously, I think, RetryError wasn't Clone.
2022-03-02 17:04:07 +00:00
Ian Jackson 90f86b47e4 Replace manual Debug impl with std derive in tor-circmgr
When I wrote this, I arranged to skip dumping the field `pending`.
This must have been because I thought that either

(a) PendingEntry couldn't `#[derive(Debug)]` (but it can)

and/or

(b) Some of the fields of PendingEntry ought not to be dumped because
they might contain (eg) packet data.  But I think they don't: there's
just the spec, and the Result which is (basically) a Circ.

I tried preseving something closer to the original using educe, but
educe gets somehow tangled up with the generics, and the result fails
to compile.  I haven't investigated this further.
2022-03-02 17:04:07 +00:00
Ian Jackson d1e8aa1dbd tor-llcrypto: Replace a tiny bit of code duplication with a call
No functional change.
2022-03-02 17:04:07 +00:00
Ian Jackson 7a4369e240 tor-llcrypto: Add test case for RsaIdentity formatting
I'm going to change the code that does this, so add a test first
to check the output doesn't change.

At some point we should have more RSA tests.
2022-03-02 16:25:01 +00:00
Nick Mathewson 83c8b11c2c Merge branch 'clippy-allow-arc-clone' into 'main'
Disable clippy::clone_on_ref_ptr

See merge request tpo/core/arti!352
2022-03-01 20:38:05 +00:00
Nick Mathewson e8e9791a97 Bump all crates to 0.1.0 2022-03-01 08:59:34 -05:00
Nick Mathewson 5735222691 Update README.md files from rustdoc. 2022-03-01 08:30:53 -05:00
Nick Mathewson 57a8fe5f55 Fix rustdoc errors. 2022-03-01 08:16:02 -05:00
Nick Mathewson 224252f082 Run rustfmt. 2022-03-01 08:13:05 -05:00
Nick Mathewson f4a0aefae5 Merge remote-tracking branch 'origin/mr/371' 2022-03-01 08:12:51 -05:00
Nick Mathewson 132416275d Merge branch '010_docs' 2022-03-01 08:08:56 -05:00
Ian Jackson 4fa78e3f44 arti-hyper: Upgrade from an example to an "adaptation layer" 2022-03-01 11:53:15 +00:00
Ian Jackson b083ae661e arti-hyper: Expand docs 2022-03-01 11:53:13 +00:00
Ian Jackson 5533fef4f3 arti-hyper: Drop obsolete comment about not doing TLS 2022-03-01 11:53:12 +00:00
Ian Jackson d80f3198ea arti-client: Add stability warning to config module 2022-03-01 11:34:07 +00:00
Ian Jackson 5610cec095 Merge branch 'main' into hyper-docs 2022-03-01 11:02:46 +00:00
Ian Jackson 66f53b6a9a Merge branch 'main' into 364
Conflicts:
	crates/arti-hyper/examples/hyper.rs

Trivially resolved.  Hyper example still works.
2022-03-01 10:36:02 +00:00
Ian Jackson bda9f82c55 Merge branch 'main'
Fixed conflict in crates/arti-client/src/lib.rs as per tree
from
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/364/#note_2782166
ie 13e55b8d7c22c26e55ba75823409b477f1bce66b
2022-03-01 10:28:06 +00:00
Nick Mathewson 7d826e6da1 Merge branch 'tls' into 'main'
Implement TLS in arti-hyper

See merge request tpo/core/arti!355
2022-02-28 20:02:41 +00:00
Nick Mathewson d2eb2ede81 Merge branch 'retry-err-circmgr' into 'main'
add some error to retry_error instead of dropping it

See merge request tpo/core/arti!368
2022-02-28 19:47:01 +00:00
Nick Mathewson 9bf69f551e Update our stability warning on arti-client. 2022-02-28 14:29:50 -05:00
Nick Mathewson dd8cd08691 Add warnings about configuration stability. 2022-02-28 14:25:24 -05:00
trinity-1686a 0fc7f40575 resolve comment 2022-02-28 20:05:17 +01:00
trinity-1686a 2d430ea69e add some error to retry_error instead of dropping it 2022-02-28 19:30:40 +01:00
trinity-1686a 55a1433499 remove usage of dbg!(..)
it's making rust-nightly job fail
2022-02-28 18:20:34 +01:00
eta 13ba0ea005 arti-client: use PreferredRuntime by default, doc cleanups
This makes using the `PreferredRuntime` the first-class option inside
`arti-client`, freeing users who don't want to think about runtimes from
having to do so.

`TorClient::create_unbootstrapped` and `builder` now automatically
use this runtime, leaving only `builder_custom` for users who wish to
manually specify a runtime.

This lets us clean up the docs a lot: mentions of using custom runtimes
are now relegated to nearer the end of the crate-level documentation,
and we mostly just link to `tor_rtcompat`'s docs to explain more there.
Instead, we take some more time to explain how you use the builder API
to create clients synchronously.

Other doc cleanups included getting rid of the explanation of `TorAddr`
in the main crate-level doc; this is already well-documented elsewhere,
and is something users should discover organically later.

fixes arti#326
2022-02-28 16:41:13 +00:00
Nick Mathewson be288399ec Merge branch 'teardown' into 'main'
tor-circmgr: take_action: Handle Cancelled from the oneshot

Closes #365

See merge request tpo/core/arti!363
2022-02-28 15:16:03 +00:00
Nick Mathewson ec25f68b9b Fix typo in message 2022-02-28 14:47:25 +00:00
Ian Jackson cdbb904664 arti-hyper: Add vacuous doc comments as required by clippy 2022-02-28 14:39:43 +00:00
eta d3d34c6c2e Merge branch 'split-static' into 'main'
Split "static" into sqlite and native-tls features.

Closes #302

See merge request tpo/core/arti!362
2022-02-28 13:41:27 +00:00
eta 1276f71e9a Merge branch 'always-coarsetime' into 'main'
Make coarsetime dependency and traffic-timestamping non-optional.

See merge request tpo/core/arti!358
2022-02-28 13:39:10 +00:00
Ian Jackson 8898bbb421 EK::RemoteProtocolFailed replaces OtherRemote
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781816
2022-02-28 13:27:44 +00:00
Ian Jackson 4425171245 Fix rustfmt
I disagree with all these.  Whatever.
2022-02-28 13:17:41 +00:00
Nick Mathewson 12a83e9661 Merge branch 'fix/210' into 'main'
don't return already errored pending circuit when searching new circuit matching spec

Closes #210

See merge request tpo/core/arti!366
2022-02-28 13:16:31 +00:00
Ian Jackson 551bc69045 arti-hyper: Abolish a bool in favour of a custom private enum
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781820
2022-02-28 13:16:25 +00:00
Ian Jackson adfabe6cd1 arti-hyper: Box the http variant (bare DataStream)
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781819
2022-02-28 13:12:20 +00:00
Ian Jackson 4705234a49 arti-hyper: Fix duplicative doc comment not to be wrong 2022-02-28 13:07:44 +00:00
Ian Jackson 85e7d4b088 arti-hyper: Drop description of nonexistent error-detail feature 2022-02-28 13:07:44 +00:00
Ian Jackson 51c9cec1f1 arti-hyper: Clarify what the TLS features do. 2022-02-28 13:07:44 +00:00
Ian Jackson c24c3af81b arti-hyper: Actually support TLS 2022-02-28 13:07:44 +00:00
Ian Jackson c397c772e6 arti-hyper: Provide TLS connector and make space for TLS stream
Add tls_conn field to ArtiHttpConnector (and argument to constructor).
Introduce MaybeHttpsStream and use it in ArtiHttpConnection.
Have the example program pass the native TLS connector.

Currently the TLS connector and the HTTPS variant are not used, but
this commit is very noisy and fomrulaic, so I have split out the code
to use them into a separate commit for easier preparation and review.
2022-02-28 13:07:44 +00:00
Ian Jackson 148cd61f2b Manually implement Clone for ArtiHttpConnector
This will be needed in a moment and doing it now makes the next patch
smaller and hence easier to read.
2022-02-28 13:07:44 +00:00
Ian Jackson c08a317093 Introduce ErrorKind::OtherRemote
arti-hyper wants to be able to have a kind for TLS failure.

Given that arti-hyper is above arti-client, this shows that callers
above arti-client might need to invent kinds for their own errors.

Possibly this means we need other Other errors for other locations.
If we have pluggable components we might even want OtherTorError.
2022-02-28 13:07:44 +00:00