Commit Graph

2646 Commits

Author SHA1 Message Date
eta 8511469009 Merge branch 'faster-ci' into 'main'
attempt at making CI faster

See merge request tpo/core/arti!361
2022-02-28 14:02:15 +00:00
Nick Mathewson cb6cd4aa5c Update to new arti-corpora 2022-02-28 08:44:55 -05: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
Ian Jackson 9a729aa2f8 arti-hyper: Disable clippy::clone_on_ref_ptr
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781816
disable this here for now, pending a decision on !352
2022-02-28 13:07:08 +00:00
Ian Jackson 23f8d33d4d Add a debug! log message for source cancellation 2022-02-28 12:52:38 +00:00
Ian Jackson 6d01c60925 Fix rustfmt 2022-02-28 12:36:48 +00:00
Ian Jackson 3e7c113233 Merge branch 'more-debug' into 'main'
impl Debug for various internal types

See merge request tpo/core/arti!360
2022-02-28 11:41:07 +00:00
Nick Mathewson 76d8338640 Fix two typos 2022-02-28 11:21:52 +00:00
trinity-1686a 5323825964 don't return already errored pending circuit when searching new circuit matching spec 2022-02-27 13:16:03 +01:00
Ian Jackson dbf019e426 tor-circmgr: take_action: Handle Cancelled from the oneshot
Fixes #365

Inspection of the code and logs shows that:
 * One of the plan futures' oneshots must be returning Cancelled
 * This means that the corresponding sender must have been dropped
 * The sender is owned by the task spawned by spawn_launch
Presumably that entire task gets dropped as part of executor shutdown,
or something.

The correct response in this situation is to declare that we are
shutting down, and stop trying to do stuff.

Unfortunately, despite trying quite hard by putting sleeps in various
strategic places, I have not been able to reproduce the problem.  So I
can't be 100% sure that the new behaviour is correct.

But I am reasonably confident that this ought not to be able to occur
unless either 1. the task from spawn_launch is dropped, or 2. that
task somehow panics despite its attempts to trap panics and report
them as errors through the oneshot.

So this "burn it all down" action ought only to occur in actually
serious situations.

I observe that
  3ff9b187ea
  Handle panics from circuit construction.
changed the EK for PendingCanceled to EK::ReactorShuttingDown,
and there's From impl.  I think, therefore, that it is right
to reuse this Error variant.

I don't quite understand why when take_action gets an actual error it
doesn't push it, but just logs it.  But I am not changing that for
now.

Arguably the two instances of retry_error.push are a sign of an
inferior flow control pattern - maybe the loop body including the code
I am adding ought to be an IEFE returning
`Result<Option<circ>, crate::Error>`.
2022-02-25 18:10:36 +00:00
Nick Mathewson 489da37fe4 Split "static" into sqlite and native-tls features.
Otherwise, it's impossible to get a static sqlite linkage without
also getting native-tls, even if you wanted rustls.

Closes #302.
2022-02-25 13:05:25 -05:00
Ian Jackson 6b615b4766 impl Debug for various internal types
I wanted this while debugging something.

The ad-hoc impl Debug with f.debug_struct is getting repetitive
and I've already perpetrated one copy-paste mistake.
We should consider using something like the `educe` crate's Clone.
2022-02-25 17:37:10 +00:00
eta 387ebda740 tor-rtcompat: refactor PreferredRuntime, clean up docs
`PreferredRuntime` is now an opaque wrapper struct that contains the
"actual" preferred runtime as a type alias. The `current_user_runtime`
and `create_runtime` functions become `PreferredRuntime::current` and
`PreferredRuntime::create`, respectively.

This removes the dependence on `impl Trait`, meaning we can now name the
returned runtime (yay!).

In addition, the documentation was cleaned up a bit to make it
(hopefully) flow better. Items that don't make sense to publicize, like
testing implementation details, have been marked #[doc(hidden)] and
semver warnings added.
2022-02-25 17:34:05 +00:00
trinity-1686a ee4ea74698 attempt at making CI faster
Move rust-nightly to stage test so it runs in parallel with coverage,
which are the two longest jobs, and currently run in sequence.
Don't document dependancies, should make the step about 50% faster
Use about 12M of cache to not recompile grcov each time
Don't compile grcov with coverage, we don't need it, it's probably
slower both to compile and execute
2022-02-25 18:08:14 +01:00
Nick Mathewson c98a2f6f62 Merge branch 'cargo_upgrade' into 'main'
Run "cargo upgrade" in preparation for 0.1.0.

See merge request tpo/core/arti!359
2022-02-25 17:02:09 +00:00
Nick Mathewson 4bd620b4ff Run "cargo upgrade" in preparation for 0.1.0.
(It's good to do this a couple of days in advance in case it turns
up any bugs.  That's how we caught the panic bug in simple_asn1
0.6.0)
2022-02-25 11:32:09 -05:00
Nick Mathewson 6755648f6b Merge branch 'upgrade-dependencies' into 'main'
Upgrade a few dependencies to newer versions

See merge request tpo/core/arti!357
2022-02-25 16:30:00 +00:00
Nick Mathewson 326e77c66c Update minimum backtrace version to 0.3.39
This is needed to make the backtrace test pass on Rust 1.53 with
minimum-version libraries.
2022-02-25 11:09:24 -05:00
Nick Mathewson 4becaa01b9 Bump minimum tokio to 1.7, since tokio-util now needs that. 2022-02-25 11:09:24 -05:00
Nick Mathewson d3661927da Remove lexical-core from downgrade_dependencies exceptions. 2022-02-25 10:56:34 -05:00
Nick Mathewson 3d7d609922 Make coarsetime dependency and traffic-timestamping non-optional.
Previously coarsetime and the traffic-timestamp feature were
enabled, since they were only required for a small corner of the
guardmgr algorithm.

But in 1.0 and beyond we'll be adding a bunch of other features (eg,
netflow padding, DoS prevention) that will need coarsetime all over
the place.

And since we're going to be doing coarsetime all over the place, the
previous justification for making traffic-timestamping optional (the
tiny performance hit) is no longer relevant.
2022-02-25 10:31:01 -05:00
Nick Mathewson a3bc59918d Upgrade to newer version of config crate. 2022-02-25 09:20:48 -05:00
eta 3d623f5a1f Merge branch 'tcp-hook-new-tls' into 'main'
use runtime TlsProvider in tcp-hook example

See merge request tpo/core/arti!356
2022-02-25 14:15:59 +00:00
eta d549844c1a Merge branch 'debug-datastream' into 'main'
tor-proto datastream: Fix typo in Debug impl

See merge request tpo/core/arti!354
2022-02-25 14:15:45 +00:00
eta c2f7b59772 Merge branch 'fuzz' into 'main'
add script for coverage of fuzzing

Closes #137

See merge request tpo/core/arti!339
2022-02-25 14:15:24 +00:00
Nick Mathewson 55416937cc Upgrade dependency to new version of tokio-util. 2022-02-25 08:48:00 -05:00
Nick Mathewson c627f50544 Upgrade dependency to new version of rlimit. 2022-02-25 08:45:24 -05:00
Ian Jackson 0ebab3df0b Merge branch 'get-runtime' into 'main'
TorClient: Add get_runtime() convenience method

See merge request tpo/core/arti!350
2022-02-25 13:36:34 +00:00
trinity-1686a f633276a91 use runtime TlsProvider in tcp-hook example 2022-02-25 13:42:14 +01:00
Ian Jackson 3903900461 tor-proto datastream: Fix typo in Debug impl
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/353#note_2781632
2022-02-25 12:23:49 +00:00
Ian Jackson 0ad45d437c Merge branch 'tls-trait' into 'main'
tor-rtcompat: Provide TLS wrapping for all streams

See merge request tpo/core/arti!349
2022-02-25 11:13:34 +00:00
Ian Jackson 310779c39d TorClient:runtime(): rename from get_runtime
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/350#note_2781368
2022-02-25 10:45:30 +00:00
eta 3e37d7e105 Merge branch 'debug-datastream' into 'main'
tor-proto datastream: Do not dump packet data in DataWriterImpl

See merge request tpo/core/arti!353
2022-02-24 21:30:52 +00:00
eta 3ac6ee71c8 Merge branch 'eta/335' into 'main'
arti-client: Unlock the state manager on failure to bootstrap

Closes #335

See merge request tpo/core/arti!334
2022-02-24 21:00:33 +00:00
eta 8f9831b219 Merge branch 'socks-version-is-http' into 'main'
make arti return a web page when receiving http request on socks port

See merge request tpo/core/arti!348
2022-02-24 20:48:28 +00:00
eta c6fdd7c003 arti-client: Unlock the state manager on failure to bootstrap
`StateMgr` got a new `unlock()` method that does what it says on the
tin. We now call it from `bootstrap()` using the new
`util::StateMgrUnlockGuard`, which works in a manner similar to the
`BoolResetter` from `tor_dirmgr`.

(A decent small little task in future might be to unify these types in
some sort of general arti utility crate?)

closes arti#335
2022-02-24 19:55:59 +00:00
eta d9df4d647d Merge branch 'http-layer' into 'main'
Initial cut of hyper bindings as a library crate

See merge request tpo/core/arti!342
2022-02-24 19:48:35 +00:00