summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src/impls
Commit message (Collapse)AuthorAgeFilesLines
* tor-rtcompat: Provide TLS wrapping for all streamsIan Jackson2022-02-242-17/+9
| | | | | | | | Now all of the runtime types we provide all impl<S> TlsProvider<S> where S: ... rather than merely TlsProvider<Self::TcpStream>. And we document and intent to perhaps require this in the future.
* tor-rtcompat: remove some unused code.Nick Mathewson2022-01-271-16/+0
| | | | | Nothing actually used these accessor functions, and it's not clear what would. We can add them later if they're needed.
* tor-rtcompat: Add some miscellaneous testsNick Mathewson2022-01-271-0/+1
| | | | | These probably aren't for things that will fail IRL, but it's nice to have coverage on the code, just in case.
* Rename `SpawnBlocking` trait to `BlockOn`.Nick Mathewson2022-01-262-2/+2
| | | | | This avoids a future confusion with the new `SpawnBlocking` trait in async_executors v0.5, and better describes what the trait provides.
* Make the native-tls crate optional.Nick Mathewson2022-01-261-0/+1
| | | | | | | | | | | This commit puts the native-tls crate behind a feature. The feature is off-by-default in the tor-rtcompat crate, but can be enabled either from arti or arti-client. There is an included script that I used to test that tor-rtcompat could build and run its tests with all subsets of its features. Closes #300
* Limit the inner types in tor-rtcompat that have to implement CloneNick Mathewson2022-01-262-32/+0
| | | | | If we implement our own clone on CompoundRuntime, we no longer need Clone implementations on our TlsProvider implementations.
* Remove no-longer-needed tokio runtime helper macroNick Mathewson2022-01-261-27/+18
|
* Unify TokioRuntime and TokioRuntimeHandleNick Mathewson2022-01-261-7/+25
| | | | | | | | | Having separate types here doesn't justify the (very limited) benefit of distinguishing between the case where we have created an executor that we own and the case where we have a handle to an already-running tokio executor. Part of #301.
* More comments on the limitations of tor-rtcompat's TLS APINick Mathewson2022-01-251-0/+3
| | | | | Also, more comments on why these limitations are safe within the context of Tor, but you wouldn't want to use them elsewhere.
* Refactor native_tls usage into its own moduleNick Mathewson2022-01-253-215/+115
| | | | | This change uses the async-native-tls crate for everything, and deletes some duplicated code.
* tor-rtcompat: Add support for rustls.Nick Mathewson2022-01-252-1/+291
| | | | | | | | | | | | | | | | | | | This is based on @janimo's approach in !74, but diverges in a few important ways. 1. It assumes that something like !251 will merge, so that we can have separate implementations for native_tls and rustls compiled at the same time. 2. It assumes that we can implement this for the futures::io traits only with no real penalty. 3. It uses the `x509-signature` crate to work around the pickiness of the `webpki` crate. If webpki eventually solves their [bug 219](https://github.com/briansmith/webpki/issues/219), we can remove a lot of that workaround. Closes #86.
* Refactor Runtimes to use separate TLS implementations internally.Nick Mathewson2022-01-192-24/+39
| | | | | This will make it easier to implement them using some other TLS provider as well, without having to duplicate all of our code.
* Make TlsConnector wrap TCP connections, not create its owneta2021-12-072-14/+27
| | | | | | | | | | | | | | | | | | | | `tor-rtcompat`'s `TlsConnector` trait previously included a method to create a TLS-over-TCP connection, which implied creating a TCP stream inside that method. This commit changes that, and makes the function wrap a TCP stream, as returned from the runtime's `TcpProvider` trait implementation, instead. This means you can actually override `TcpProvider` and have it apply to *all* connections Arti makes, which is useful for issues like arti#235 and other cases where you want to have a custom TCP stream implementation. This required updating the mock TCP/TLS types in `tor-rtmock` slightly; due to the change in API, we now store whether a `LocalStream` should actually be a TLS stream inside the stream itself, and check this property on reads/writes in order to detect misuse. The fake TLS wrapper checks this property and removes it in order to "wrap" the stream, making reads and writes work again.
* Resolve roughly half of the XXXXs.Nick Mathewson2021-12-061-1/+3
| | | | | | | | We want to only use TODO in the codebase for non-blockers, and open tickets for anything that is a bigger blocker than a TODO. These XXXXs seem like definite non-blockers to me. Part of arti#231.
* Document every macro.Nick Mathewson2021-09-071-0/+3
| | | | | (The nightly version of clippy now includes macros for its missing_docs_in_private_items lint.)
* Fix typosJani Monoses2021-09-071-1/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-272-0/+544
This will cause some pain for now, but now is really the best time to do this kind of thing.