summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src/impls
Commit message (Collapse)AuthorAgeFilesLines
* rtcompat: Expose FakeStream and friends; fix compilation in tor-rtmockNick Mathewson2024-09-241-76/+0
| | | | | It turns out that these types are generally useful, and that they are in fact needed for tor-rtmock to compile without a PreferredRuntime.
* rtcompat: Fix some rustdoc links.Nick Mathewson2024-09-241-2/+1
|
* rtcompat: remove async_trait from NetStreamListener.Nick Mathewson2024-09-242-2/+0
| | | | (The trait no longer has any async methods.)
* rtcompat: Require Sync and 'static for NetStreamListener::IncomingNick Mathewson2024-09-241-1/+1
|
* rtcompat: NetStreamProvider<unix::SocketAddr> for non-unix platformsNick Mathewson2024-09-243-0/+83
| | | | | | | Since there is no way to construct a unix::SocketAddr on these platforms, it's harmless to provide an implementation for NetStreamProvider. What's more, doing so greatly simplifies our AbstractAddr implementation.
* Implement NetStramProvider<Unix> for async_std.Nick Mathewson2024-09-241-0/+23
|
* async_std: Perpare macro for use with Unix streams.Nick Mathewson2024-09-241-33/+33
|
* async_std: start a macro to implement wrappers for stream typeNick Mathewson2024-09-241-71/+79
| | | | | As before, this commit does nothing interesting: it's a separate commit because it reindents a lot of code.
* rtcompat: Implement NetStreamProvider<Unix> for tokio.Nick Mathewson2024-09-241-4/+60
|
* tokio: Perpare macro for use with Unix streams.Nick Mathewson2024-09-241-24/+31
|
* tokio: start a macro to implement wrappers for stream typeNick Mathewson2024-09-241-67/+74
| | | | | This commit does nothing interesting yet: it's a separate commit because it reindents a lot of code.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-242-14/+14
| | | | | | | | | | | | | | (And similarly rename TcpListener to NetStreamListener, along with their TcpStream/TcpListener associated types.) These types are about to become generic over addresses, and therefore shouldn't be named after TCP. Renaming was done mostly with Rust Analyzer, except for some macros that needed to be hand-edited. (I'll revise the comments in the next commit; this one is all about renaming.)
* rtcompat: Remove accept() from TcpListenerNick Mathewson2024-09-242-7/+0
| | | | | | | | | | It's redundant with the incoming() method (which turns the TcpListener into a Stream of connections), and nothing actually used it outside of tests. Removing this method allows us to simplify our TcpListener code a good deal, as can be seen by some of the implementations we removed from our example and testing code.
* tls: Support export keying material (RFC 5705)David Goulet2024-06-182-0/+32
| | | | | | | | | | | | | Add a function to get the keying material as detailed by RFC 5705. Because native-tls doesn't have such support, there is a place holder panic!() for now. This means that for the forseable future, relay would only work with rustls until we figure out a solution for native-tls. Closes #1432 Signed-off-by: David Goulet <[email protected]>
* rtcompat: Set disable_built_in_roots With native_tls.Nick Mathewson2024-06-131-0/+4
| | | | | | | When using openssl on Linux, this saves us about 1.4 MB due to not loading the default CAs and CRLs (which Tor doesn't use.) Addresses part of #1027.
* Add a note about CryptoProvicder.Nick Mathewson2024-04-221-0/+4
|
* Upgrade to futures-rustls 0.26.0, rustls 0.23.5.Nick Mathewson2024-04-221-0/+14
| | | | | | | | | The rustls upgrade will solve #1377 and CVE-2024-32650. Note that we've had to patch our RustlsProvider impl a bit in order to keep the tests passing. See comments. Closes #1377.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* rtcompat: Fix a rustdoc link.Nick Mathewson2024-01-301-1/+1
|
* Upgrade to futures-rustls and rustls 0.22.Nick Mathewson2024-01-251-25/+32
| | | | | | | The futures-rustls crate has supplanted the async-rustls crate, and it requires/embeds rustls 0.22. Closes #1179.
* clippy: consequential rustfmtIan Jackson2024-01-021-3/+1
|
* clippy: Use infallible callsIan Jackson2024-01-021-2/+1
| | | | Resolves clippy complaints about needless fallible conversions.
* clippy: Replace many calls to .get(0) with .first()Ian Jackson2024-01-021-1/+1
| | | | | FTR I don't think agree with clippy on this question, but then I often don't.
* tor-rtcompat: use track-caller for thin wrappersJim Newsome2023-12-181-0/+2
| | | | | | | | | | | | | | In particular, when the (unstable) tokio tracing feature is enabled, every tracing line includes the name of where the current task was created. Without this change, that ends up being the name of intermediate trait methods like TokioRuntimeHandle::block_on, which is not very helpful. Adding the `track_caller` attribute causes the name of the caller of these methods to be used instead, which is typically more helpful. IIUC this change is not breaking in terms of semver https://rustc-dev-guide.rust-lang.org/backend/implicit-caller-location.html.
* Upgrade async_executors dependency to 0.7.0Nick Mathewson2023-09-281-4/+3
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* update rustls to 0.21trinity-1686a2023-05-081-16/+11
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+9
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* fix deprecation warnings from rustlstrinity-1686a2022-11-261-9/+7
|
* upgrade rustls to 0.20, ignoring all deprecation warningstrinity-1686a2022-11-261-36/+30
|
* fix doc-feature synchrotrinity-1686a2022-10-162-2/+8
|
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-242-0/+2
|
* tor-rtcompat: Require that TcpStream be SendIan Jackson2022-08-151-1/+1
| | | | The lack of this seems to have been an oversight.
* rt-compat: Make all the individual runtime traits Clone+Send etc.Ian Jackson2022-06-082-1/+2
| | | | | | | | This will make it much more convenient for code that only wants one of these traits (or a subset of them). This is a good thing to support because it will allow us to use a ZST in places that do not need an actual async runtime handle (typically, the runtime handle is needed only for spawn).
* UdpSocket: remove support for connect().Nick Mathewson2022-03-182-40/+6
| | | | | | | | Currently, Arti doesn't need this. But once it does, it will be way better to have a separate type for connected sockets, rather than having to error-check every time somebody gives us a socket. Part of #410
* add simple unit test on UDPtrinity-1686a2022-03-142-0/+8
|
* add skeleton for DNS handlingtrinity-1686a2022-03-142-4/+4
|
* add udp to runtimetrinity-1686a2022-03-142-2/+99
|
* Replace manual Default, and abolish new, in tor-rtcompatIan Jackson2022-03-021-13/+1
| | | | The Default impl was the only call site for new()
* 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.