summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | netdoc: Put all ProtoStatuses into a single Arc<>d objectNick Mathewson2025-04-162-19/+55
| | | | | | | | | | | | | | | We'll want this so that we can expose them before we expose the rest of the consensus (which we need to do for spec conformance).
| * | netdoc: functionality for detecting missing subprotos.Nick Mathewson2025-04-162-2/+100
| | | | | | | | | | | | Also, add a new ErrorKind for this sort of error.
| * | New functions to report supported subprotocolsNick Mathewson2025-04-1611-0/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of #1849. Note that these functions are distributed across crates, so that if (in the future) we stop doing API breaks with every release, we will get the right outputs. Note also that these functions build the list of protocols out of specific symbolic features, rather than numbers: this makes it easier to avoid errors about "which feature was Relay=4 again", and easier to avoid accidentally referring to a protocol that doesn't exist, like "Consensus" (should be "Cons") or "HsDir" (case is wrong).
| * | Fix another miscapitalized "MicroDesc"Nick Mathewson2025-04-161-1/+1
| | |
| * | protover: Correct capitalization of Micro[Dd]escNick Mathewson2025-04-163-10/+12
| | | | | | | | | | | | Closes #1923
| * | protover: Add an implementation for FromIteratorNick Mathewson2025-04-161-0/+37
| | |
| * | protover: document and enforce more invariantsNick Mathewson2025-04-161-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | We have places where, if we were to create certain ProtoKinds or NamedProtos with invalid values, we could cause a panic. This isn't remotely triggerable, or even triggerable from outside the protover crate, but it's best to avoid the possibility of future mistakes.
| * | protover: add names for members of the Link protocol group.Nick Mathewson2025-04-161-0/+27
| | |
| * | protover: New function to intersect Protocols sets.Nick Mathewson2025-04-161-0/+53
| | | | | | | | | | | | | | | This will be helpful in building a list of protocols from several crates.
| * | protover: New function to combine (union) Protocols sets.Nick Mathewson2025-04-161-1/+57
| | | | | | | | | | | | | | | This will be helpful in building a list of protocols from several crates.
| * | protover: New function to subtract to Protocols sets.Nick Mathewson2025-04-161-0/+54
| |/ | | | | | | | | This will be helpful in checking whether a list of protocols has any unsupported members.
* | tor-netdoc: Joined OnceLock import with other std::sync importshashcatHitman2025-04-171-2/+1
| | | | | | | | Whoops! Missed that.
* | tor-circmgr: Added TODO about replacing OnceCellhashcatHitman2025-04-171-0/+8
| | | | | | | | | | - [`once_cell::sync::OnceCell`] should be replaced by [`std::sync::OnceLock`] once the blocking methods are stabilized and within our MSRV.
* | arti-client: Added TODO about replacing OnceCellhashcatHitman2025-04-171-0/+7
| | | | | | | | | | - [`once_cell::sync::OnceCell`] should be replaced by [`std::sync::OnceLock`] once the blocking methods are stabilized and within our MSRV.
* | tor-events: Removed once_cell dependencyhashcatHitman2025-04-172-7/+5
| | | | | | | | | | - [`once_cell::sync::OnceCell`] has been replaced by [`std::sync::OnceLock`], removing the need for the once_cell dependency.
* | tor-log-ratelim: Replace OnceCell with OnceLockhashcatHitman2025-04-171-3/+2
| | | | | | | | | | - [`once_cell::sync::OnceCell`] has been replaced by [`std::sync::OnceLock`], resolving a TODO.
* | tor-netdoc: Replace OnceCell with OnceLockhashcatHitman2025-04-171-3/+3
| | | | | | | | - [`once_cell::sync::OnceCell`] has been replaced by [`std::sync::OnceLock`].
* | tor-geoip: Removed once_cell dependencyhashcatHitman2025-04-172-4/+2
| | | | | | | | | | - [`once_cell::sync::OnceCell`] has been replaced by [`std::sync::OnceLock`], removing the need for the `once_cell` dependency.
* | hashx, tor-persist: fix intra-doc link backtickshashcatHitman2025-04-162-2/+2
|/ | | | | | | | | | - Replaced single quotes in [`hashx::rand`] documentation link to [`hashx::rand::RngBuffer`] with backticks so it actually works. - Added a missing backtick to the link to [`tor_persist::state_dir::StateDirectory::instance_peek_storage`] in the documentation of [`tor_persist::state_dir::StateDirectory::with_instance_path_pieces`].
* cell: simpler (?) approach to StreamIdReqNick Mathewson2025-04-161-22/+43
| | | | | | Instead of having a StreamIdReq that indicates "None in V1, Any in V0", take an optional RelayCellFormat as an argument.
* cell: simpler approach to assert-checking offsetsNick Mathewson2025-04-162-11/+13
|
* proto: Create StreamTargets with the right RelayCellFormat.Nick Mathewson2025-04-164-8/+27
|
* cell, proto: Use correct Data sizes for v1 relay cellsNick Mathewson2025-04-167-24/+74
| | | | | | | | | | | | Since v1 cells have a longer tag, they can fit less data into a single cell. Ah well, that's the cost of improved security. The code in data.rs is a little wonky, in that it currently requires its buffer to be exactly the maximum size for a data cell. We have a TODO about fixing that in the future, but for now I've moved it to use a boxed slice rather than a boxed array. Part of #1944.
* cell: Remove the deprecated Data::split_from().Nick Mathewson2025-04-162-14/+1
|
* cell: Implement parsing and encoding for V1 relay cellsNick Mathewson2025-04-163-21/+221
| | | | This is the main part of #1944, and will be needed for CGO.
* cell: Add a debugging-only method to simplify debug_asserts.Nick Mathewson2025-04-162-12/+12
|
* cell: Refine StreamIdReq for V1 relay cells, with minimal changesNick Mathewson2025-04-161-8/+14
| | | | | | | | | | Fortunately, the type is crate-internal, so this is not a breaking change. The key insight with this change is that, from the _caller's_ POV, the set of cells that are allowed to have StreamIDs has not changed. The only difference is that the V1 relay cell code needs to distinguish unrecognized commands from the SENDME case.
* cell: Create an unimplemented RelayCellFormat::V1Nick Mathewson2025-04-161-10/+30
|
* proto: Use selected format when encoding messagesNick Mathewson2025-04-161-6/+11
|
* Add a RelayCellFormat argument to encode().Nick Mathewson2025-04-168-19/+35
| | | | | | | | | This will let us actually _send_ messages in the right format. This approach is not ideal for packed/fragmented messages; they will need a separate RelayCellEncoder. part of #1944.
* Note some places where we need updates for #1944.Nick Mathewson2025-04-167-2/+32
| | | | (Also note a couple of other CGO-related issues)
* Merge branch 'ticket1950' into 'main'Nick Mathewson2025-04-161-1/+1
|\ | | | | | | | | | | | | proto: Avoid panic on non-existent hop number Closes #1950 See merge request tpo/core/arti!2938
| * proto: Avoid panic on non-existent hop numberNick Mathewson2025-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In `send_relay_cell()` in `tunnel/reactor/circuit.rs`, replace an unconditional array access (which would cause a panic if `hop_num` were out-of-range) with a checked `get_mut()` call. It's not totally clear whether this can happen in practice, but in either case, an error is probably better than a panic. All of our other lookups in this vector are either checked, or more obviously infallible. Closes #1950.
* | Merge branch 'todo-errordetail' into 'main'David Goulet2025-04-142-2/+8
|\ \ | | | | | | | | | | | | arti-client: Add ErrorDetail::OnionServiceSetup See merge request tpo/core/arti!2923
| * | arti-client: Add ErrorDetail::OnionServiceSetuphjrgrn2025-04-142-2/+8
| | |
* | | Merge branch 'fork' into 'main'David Goulet2025-04-144-0/+73
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Forbid fork, except very carefully before exec Closes #1897 See merge request tpo/core/arti!2925
| * | | arti-client: xref to fork policyIan Jackson2025-04-072-0/+17
| | | |
| * | | 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-147-105/+174
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relax bounds on BlockOn::reenter_block_on Closes #1933 See merge request tpo/core/arti!2934
| * | | | tor-rtcompat: task tests: Allow a clippy lintIan Jackson2025-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This doesn't seem to happen with my local compiler. Anyway, suppress it. I don't think we want to split up this function.
| * | | | tor-rtcompat: task: Break out subthread_yieldIan Jackson2025-04-101-30/+36
| | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of a clippy complaint about subthread_block_on_future being too complicated.
| * | | | tor-rtcompat: task tests: Allow a clippy lintIan Jackson2025-04-101-0/+1
| | | | |
| * | | | tor-rtcompat: BlockOn: relax bounds on reenter_block_onIan Jackson2025-04-096-5/+8
| | | | | | | | | | | | | | | | | | | | The future no longer needs to be `Send + 'static`.
| * | | | tor-rtmock: task: subthread_block_on_future; Yield a bit moreIan Jackson2025-04-091-2/+18
| | | | |
| * | | | tor-rtmock: task tests: New subhtread_pingpong testIan Jackson2025-04-091-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test demonstrates that the intended use pattern compiles and works. It couldn't exist until now because we couldn't conveniently make a `Send + 'static` future out of `rx.next()`.
| * | | | tor-rtmock: task: Redo subthread_block_on_future; poll on the subthread (fmt)Ian Jackson2025-04-091-14/+3
| | | | |
| * | | | tor-rtmock: task: Redo subthread_block_on_future; poll on the subthreadIan Jackson2025-04-092-68/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we put the future into the data structure, had the exeuctor poll it there, and only woke up the subthread when the future was ready. Now, instead, we put a new TaskFutureInfo variant into the data structure, and the executor context switches to the subthread every time. Then we poll the future on the subthread. Moving the future into the data structure meant we had to do use a proxy future to store the return value. Now that's not needed any more. Now the future doesn't need to be Send + 'static. Fixes #1933.
| * | | | tor-rtmock: task: Minor refactoringIan Jackson2025-04-091-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate the data_ variable and instead use a block scope. This seems a bit nicer, and will align slightly better with forthcoming changes.