summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat
Commit message (Collapse)AuthorAgeFilesLines
* release: Bump all tor-/arti- crates to 0.31.0.Alexander Hansen Færøy2025-06-051-3/+3
| | | | | | | | This was done using: for crate in $(./maint/list_crates | grep -P '^tor-|^arti-'); do cargo set-version -p $crate 0.31.0 done
* ./maint/cargo_sort: Run cargo-sort on the entire workspace.Gabriela Moldovan2025-05-271-5/+18
| | | | | | | | | | | | | | | | | | | The [latest version] of `cargo-sort` is more opinionated than the previous one, and is now causing the `rust-checks` job to fail on `main`. This commit applies the fixes needed to satisfy the new `cargo-sort` rules. These changes were generated by running `cargo sort --workspace` several times, until `cargo sort --check --workspace` finally succeeded (it couldn't fix all the errors in one go, for some reason). I have omitted the changes `cargo-sort` made to the top-level `Cargo.toml`, to preserve the topological ordering of the workspace members. Closes #2014 [latest version]: https://github.com/DevinR528/cargo-sort/blob/f066ae80e5e6f5c1d8f0e2b8099461dcb97d9656/changelog.md#200
* 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.
* All crates: bump rust-version to 1.83.Nick Mathewson2025-05-131-1/+1
|
* release: Bump all unstable tor/arti crates to 0.30.0Wesley Aptekar-Cassels2025-05-012-6/+3
| | | | | | | | ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.30.0 done ```
* Merge branch 'fork' into 'main'David Goulet2025-04-142-0/+56
|\ | | | | | | | | | | | | 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
| |
| * tor-rtcompat: Add div anchor for policyIan Jackson2025-04-071-0/+4
| | | | | | | | | | | | We're going to want to make many xrefs to this. This trick with the <div> has worked well for us in derive-deftly.
| * tor-rtcompat: Write policy on fork without execIan Jackson2025-04-071-0/+41
| |
* | Merge branch 'rtmock-unsend' into 'main'David Goulet2025-04-144-3/+6
|\ \ | | | | | | | | | | | | | | | | | | 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-094-3/+6
| |/ | | | | | | 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.
* Remove semver.md files post-release.Gabriela Moldovan2025-04-011-11/+0
|
* tor-rtcompat: Avoid wildcard dependency requirements.Gabriela Moldovan2025-04-011-1/+1
| | | | | | | | | This is preventing us from publishing `tor-rtcompat`: > error: failed to publish to registry at https://crates.io > > Caused by: > the remote server responded with an error (status 400 Bad Request): wildcard (`*`) dependency constraints are not allowed on crates.io. Crate with this problem: `hex` See https://doc.rust-lang.org/cargo/faq.html#can-libraries-use--as-a-version-for-their-dependencies for more information
* Bump all the unstable tor- and arti- crates to 0.29.0.Gabriela Moldovan2025-03-311-3/+3
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.29.0 done ```
* Upgrade rustls-wekpki dependency to 0.103.1.Gabriela Moldovan2025-03-271-1/+1
| | | | | | We aren't affected by any of the breaking changes from [0.103.0]. [0.103.0]: https://github.com/rustls/webpki/releases/tag/v%2F0.103.0
* AF_UNIX terminology: Rename two error structsIan Jackson2025-03-245-10/+21
| | | | | | 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-055-120/+104
|\ | | | | | | | | | | | | 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.
| * Require rustls 0.23.20Nick Mathewson2025-03-041-1/+2
| | | | | | | | | | This is the version that introduces `root_hint_subjects()`, which we want our ServerCertVerifier to override.
| * Require rustls-pki-types 1.8 for CertificateDer::from_sliceNick Mathewson2025-03-041-1/+1
| |
| * rustls.rs: Replace x509-signature with rustls-webpkiNick Mathewson2025-03-045-103/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-rtcompat: Add a semver.md for changes to BlockOn etc.Ian Jackson2025-03-041-0/+4
| |
* | 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-rtmock: task: Remove Default impl for ThreadDescriptorIan Jackson2025-03-041-1/+1
| | | | | | | | | | | | | | | | | | This is going to become a hazard. Let's be explicit. This means using educe to derive the Default for Data. We also need to update our educe dependency to 0.4.22, since that's when Default(expression= "...") started working correctly.
* | 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.
* | tor-rtcompat: New plan for blocking interaction, Blocking traitIan Jackson2025-03-046-32/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Document the new plan for blocking interaction in the trait-level docs for the Blocking trait (used to be SpawnBlocking). Add cross-references (in some cases to not-yet-existing pieces). * Rename: spawn_blocking to spawn_thread. We're going to distinguish thread-creation (relatively expensive) from brief entry to sync code (relatively cheap, but more restricted). * Rename the SpawnBlocking trait to Blocking, and its ThreadHandle to ThreadHandle. This trait is going to gain more functionality. * Add the missing mention of `Blocking` to the docs for `Runtime`.
* | tor-rtcompat: Rename BlockOn to ToplevelBlockOnIan Jackson2025-03-049-16/+16
|/ | | | | | | | | | We're going to distinguish top-level runtime entry, from *re*-entry to an existing executor. It is most convenient to rename this trait first. Documentation of the distinction will come later. (We're going to retain the function name `block_on`, but we want the trait to be more obviously a top-level only thing, though, so we give it a name that will hopefully avoid it peroulating throughout the codebase..)