summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-242-0/+4
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* Merge branch 'smol-add-impl-in-tor-rtcompat' into 'main'opara2025-08-2110-14/+481
|\ | | | | | | | | smol: Implement smol in tor-rtcompat See merge request tpo/core/arti!2986
| * smol: Implement smol in tor-rtcompatNiel Duysters2025-08-2110-14/+481
| |
* | Document why we are using ring with rustlsNick Mathewson2025-08-191-3/+21
|/ | | | See #1977, #2122.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-075-8/+6
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Merge branch 'windows_warnings' into 'main'opara2025-08-053-0/+5
|\ | | | | | | | | Fix Windows compile warnings See merge request tpo/core/arti!3114
| * Fix Windows compile warningsTobias Stoeckmann2025-08-053-0/+5
| | | | | | | | | | Use unix-specific crates only if needed and suppress clippy warnings of unused variables if their usage is unix-specific.
* | Fix errors from rustdoc nightly.Nick Mathewson2025-08-051-1/+1
|/
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-091-2/+2
| | | | Made with https://crates.io/crates/typos-cli
* tor-rtcompat, tor-rtmock: Allow unused functions.Gabriela Moldovan2025-07-071-0/+1
| | | | These only serve as a compile-time check.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-rtmock: Blocking::blocking_io: add clarificationIan Jackson2025-06-231-0/+3
|
* tor-rtmock: Blocking::spawn_blocking: clarify drop behaviourIan Jackson2025-06-231-0/+6
| | | | | Explain that you don't need to .await the returned future, and say what happens when you drop it.
* tor-rtcompat: Remove rustls dependency in favor of futures-rustlsparazyd2025-06-061-1/+1
| | | | | | | | | | futures-rustls provides and re-exports rustls and thus the rustls dependency is redundant. Additionally, this removes `aws-lc-rs` and its inherent dependencies from `Cargo.lock` and the entire project since they've been included because the rustls dependency did not use `default-features = false` and rustls by default now depends on `aws-lc-rs` as its crypto engine.
* tor-proto: add optimization for `DynTimeProvider`Steven Engler2025-06-051-0/+27
|
* rtcompat: remove Letsencrypt/Rustls kludgeretort-dev2025-05-203-48/+13
|
* *: use std::io::Error::other in many placesNick Mathewson2025-05-153-9/+6
| | | | | | | The `IoError::other` function is an easier way to say `IoError::new(IoErrorKind::Other, ...)`. It's been around since 1.74, but clippy started warning about the more verbose version in 1.87.
* Merge branch 'fork' into 'main'David Goulet2025-04-141-0/+11
|\ | | | | | | | | | | | | Forbid fork, except very carefully before exec Closes #1897 See merge request tpo/core/arti!2925
| * tor-rtcompat: xref to fork policy from PreferredRuntimeIan Jackson2025-04-071-0/+11
| |
* | Merge branch 'rtmock-unsend' into 'main'David Goulet2025-04-143-3/+3
|\ \ | | | | | | | | | | | | | | | | | | Relax bounds on BlockOn::reenter_block_on Closes #1933 See merge request tpo/core/arti!2934
| * | tor-rtcompat: BlockOn: relax bounds on reenter_block_onIan Jackson2025-04-093-3/+3
| |/ | | | | | | The future no longer needs to be `Send + 'static`.
* / Allow StreamOps import to be unusedNick Mathewson2025-04-091-0/+1
|/ | | | | This comes up on OSX; I hadn't seen it before, so I assume it is new with Rust 1.86.
* AF_UNIX terminology: Rename two error structsIan Jackson2025-03-244-10/+14
| | | | | | We change `NoUnixAddressSupport` to `NoAfUnixSocketSupport` because it doesn't make much sense to talk about support for the addresses separately from support for the sockets.
* Fix AF_UNIX terminology in docs, comments, and error messagesIan Jackson2025-03-242-4/+4
|
* Merge branch 'x509-signature-yeet' into 'main'Nick Mathewson2025-03-054-117/+97
|\ | | | | | | | | | | | | Switch from x509-signature to rustls-webpki when using rustls. Closes #1824 and #1854 See merge request tpo/core/arti!2816
| * rustls: move provider-installer to its own function.Nick Mathewson2025-03-041-13/+21
| | | | | | | | | | We do this so that we can make sure there's a provider installed when we run the tests.
| * rustls.rs: Replace x509-signature with rustls-webpkiNick Mathewson2025-03-044-101/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The x509-signature crate is archived, and won't see any more releases. Using it is tying us to ring 0.16 internally, which means we depend on two ring versions. Fortunately, rustls-webpki relaxes some of the earlier restrictions from the vanilla webpki crate, which means that its certificate parser now accepts C tor's oddball x509 certificates as valid. With this change, we can delegate to rustls's built-in signature-checking code, and we only have to override its certificate validation. (We still override it with a pile of comments about how we don't validate link certificates much.) I've had to include a few certificates: two are for tests, but one is needed as a placeholder, since we can't construct a rustls certificate validator without a root cert, even if we'll never use it. Closes #1824. Closes #1854.
| * rtcompat: Un-rename CertificateDer type.Nick Mathewson2025-03-041-6/+8
| | | | | | | | (We had added this rename when rustls renamed it originally.)
* | tor-rtcompat: Fix grammar in docIan Jackson2025-03-041-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3168425
* | tor-rtcompat: Rename spawn_thread to spawn_blockingIan Jackson2025-03-045-34/+33
| | | | | | | | Let's use Tokio terminology here.
* | tor-rtcompat: Give a reason in blocking_io for not using for cpu workIan Jackson2025-03-041-1/+4
| | | | | | | | | | As requested https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167979
* | tor-rtcompat: Fix docs typoIan Jackson2025-03-041-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167978
* | tor-rtcompat: Change the title of RuntimeIan Jackson2025-03-041-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167977
* | tor-rtcompat: Clarify reentrancy restrictions on `block_on`Ian Jackson2025-03-041-2/+5
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167976
* | tor-rtcompat: Explain Sendness of reenter_block_on futureIan Jackson2025-03-041-0/+6
| | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167975 Also allow ourselves the option of changing this in the future.
* | tor-rtcompat: Clarify distinction between Runtime and ToplevelIan Jackson2025-03-041-2/+8
| | | | | | | | | | Prompted by and partially taken from https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167973
* | tor-rtcompat: Linkify a mention of spawn_threadIan Jackson2025-03-041-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167972
* | tor-rtcompat: Clarify docs (3)Ian Jackson2025-03-041-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167970
* | tor-rtcompat: Make a precise example for mpsc::channelIan Jackson2025-03-041-1/+1
| | | | | | | | | | See https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167969
* | tor-rtcompat: Blocking::spawn_thread semantics correctionIan Jackson2025-03-041-2/+11
| | | | | | | | | | | | | | | | | | The: table entry for `spawn_thread` was wrong. We use AsyncExecutors' spawn_blocking which uses tokio::task::spawn_blocking. This has implications for the semantics, as per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167967 https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167968
* | tor-rtcompat: Clarify docs (2)Ian Jackson2025-03-041-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167966
* | tor-rtcompat: Clarify docsIan Jackson2025-03-041-1/+1
| | | | | | | | | | As suggested https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167965
* | tor-rtmocK; Detect wrong-context blocking_io and spawn_threadIan Jackson2025-03-041-2/+0
| |
* | tor-rtmocK; Detect re-entry into MockExecutorIan Jackson2025-03-041-1/+0
| |
* | tor-rt*: Apply deferred formatting churnIan Jackson2025-03-043-5/+5
| | | | | | | | rustfmt.
* | tor-rtcompat: CompoundRuntime: Rename TaskR member from SpawnRIan Jackson2025-03-041-40/+39
| | | | | | | | | | | | This member is the principal one which implemnets Spawn, Blocking and perhaps ToplevelBlockOn. It doesn't appear that we actually need to split this into multiple members.
* | tor-rtcompat: Remove ToplevelBlockon from RuntimeIan Jackson2025-03-042-12/+12
| | | | | | | | | | | | | | | | Introduce ToplevelRuntime as an alias, and use it in the top-level programs. Now none of the principal protocol implementation code has access to the executor's toplevel entrypoint, and can't call it by mistake.
* | tor-rtcompat: Provide Blocking::blocking_ioIan Jackson2025-03-043-2/+70
| | | | | | | | | | | | | | | | | | This was referenced and explained from the docs, but didn't exist yet. Here it is. Everyone except the Tokio glue, and the CompoundRuntime, just use the default implementation in terms of spawn_thread. spawn_thread has a more relaxed contract, so this is correct.
* | tor-rtcompat: Provide a new function for executor re-entryIan Jackson2025-03-046-5/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Forbid re-entering the executor using ToplevelBlockOn::block_on. This was always forbidden in the case of MockExecutor, but that meant that tests using MockExecutor would malfunction if the code under test needed to re-enter the executor from sync code (since the code under test would have to use block_on, which wrong). See #1835. Provide a function which *can* do this, reenter_block_on. The MockExecutor needs to know the difference, and other runtimes may too. They are conceptually quite different operations. Introduce ToplevelRuntime as a convenience alias.