summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | tor-consdiff: Use usize::try_fromClara Engler2026-03-251-2/+5
| | | |
* | | | tor-consdiff: Fix clippy warningsClara Engler2026-03-251-2/+2
| | | |
* | | | tor-consdiff: Test with CRLFClara Engler2026-03-251-0/+10
| | | | | | | | | | | | | | | | | | | | Now that we no longer use .lines(), everything should work fine with CRLF -- and it does. :-)
* | | | tor-consdiff: Remove manual line splitsClara Engler2026-03-252-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes all manual line splits in the consdiff generation. Instead, it now simply uses the primitives offered by imara-diff to access the lines in the input itself. Meanwhile, it also adds a check for missing newlines/assertions that all lines are actually terminated by \n.
* | | | tor-consdiff: Cut signature using byte offsetsClara Engler2026-03-251-30/+36
| | | | | | | | | | | | | | | | | | | | This commit replaces the use of lines with byte offsets for cutting of the signatures.
* | | | tor-consdiff: Use same rng in testClara Engler2026-03-251-2/+3
| | | |
* | | | tor-consdiff: Compile-time assertion for 32-bitClara Engler2026-03-252-0/+4
| | | | | | | | | | | | | | | | | | | | This commit adds a compile time assertion that a u32 can always be safely casted into a usize.
* | | | tor-consdiff: Return error for dotlineClara Engler2026-03-252-16/+47
| | | | | | | | | | | | | | | | | | | | This commit adds a check that prevents gen_cons_diff from computing a diff with a single dot line.
* | | | tor-consdiff: Refactor gen_ed_diffClara Engler2026-03-251-28/+63
| | | | | | | | | | | | | | | | | | | | | | | | This commit refactors gen_ed_diff to have less code duplication by not matching upon the hunk type once but by splitting it into two different matches for the header and the body.
* | | | tor-consdiff: Failed applies are a BugClara Engler2026-03-253-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | Mark a failed apply from a consensus diff we generate as a bug as this should not happen. We must obviously always accept the consensus diffs we produce.
* | | | tor-consdiff: Replace `+=` with `std::fmt`Clara Engler2026-03-251-20/+36
| | | | | | | | | | | | | | | | | | | | This commit replaces repeated `result += &format!(...)` cruft with `write!` calls and multi-line strings.
* | | | tor-consdiff: Constify directory-signature literalClara Engler2026-03-251-3/+10
| | | | | | | | | | | | | | | | | | | | This commit moves "directory-signature" and "directory-signature " into semantically meaningful constants.
* | | | tor-consdiff: Replace names with custom wordlistClara Engler2026-03-252-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the names crate with a simple hardcoded wordlist of length 20, obtained from my systems wordlist. Reason for that being that names triggers a cargo-audit failure.
* | | | tor-consdiff: Add consdiff generation algorithmClara Engler2026-03-255-3/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements support for the consensus diff generation. Unlike CTor, it does not use its own custom algorithm but rather uses an implementation of Myers' algorithm from the `imara-diff` crate, which is pretty performant and comparable to size and run time to CTor, while being much simpler in the interfacing code.
* | | | parse2: Rename lno_for_error to lnoClara Engler2026-03-253-3/+4
| | | | | | | | | | | | | | | | | | | | This commit lno_for_error in ItemStream to lno because its value may not always be used for error handling, such as in tor-consdiff.
* | | | parse2: Implement `ParseError::new()`Clara Engler2026-03-251-0/+19
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | This commit adds the ParseError::new() method, which allows external APIs to construct a ParseError, which is currently not possible due to non-exhaustiveness, despite the member fields being public. It is required for external applications using lower-level but public parse2 APIs, such as ItemStream's.
* | | Merge branch 'fix-docs' into 'main'David Goulet2026-03-251-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | docs: Fix config file path on windows Closes #2422 See merge request tpo/core/arti!3808
| * | | docs: fix config file path on windowsSteven Engler2026-03-241-1/+1
| | |/ | |/|
* | | Merge branch 'hsservice-readme' into 'main'Nick Mathewson2026-03-251-17/+0
|\ \ \ | | | | | | | | | | | | | | | | hsservice: Remove obsolete "Limitations" section See merge request tpo/core/arti!3812
| * | | hsservice: Remove obsolete "Limitations" sectionGabriela Moldovan2026-03-251-17/+0
| | |/ | |/| | | | | | | These have been implemented for a while now.
* | | Merge branch 'dont-warn-conn-failed' into 'main'Nick Mathewson2026-03-251-1/+0
|\ \ \ | |/ / |/| | | | | | | | tor-chanmgr: Don't `warn_report!` for failed connections See merge request tpo/core/arti!3807
| * | tor-chanmgr: don't `warn_report!` for failed connectionsSteven Engler2026-03-241-1/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `warn_report!` is useful when there's an error that we need to ignore and can't propagate up the call stack. But here we're using `warn_report!` while also returning the error in a `Error::ChannelBuild`. This is not great because: 1. The caller should warn if it wants to, since it will have the error message and the proper context. 2. This code is doing something like happy eyeballs, which means we only care that one connection succeeds, not if any fail. One instance where this is problematic is when running Arti on a machine without IPv6 support. If connecting to a relay with both an IPv4 and IPv6 address, the IPv6 attempt will always fail. We don't want to warn about every outgoing IPv6 connection failure when the IPv4 connection succeeds.
* | Merge branch 'log-formatting' into 'main'gabi-2502026-03-252-2/+2
|\ \ | | | | | | | | | | | | tor-guardmgr: Fix some duration string formatting See merge request tpo/core/arti!3804
| * | tor-guardmgr: fix some duration string formattingSteven Engler2026-03-242-2/+2
| |/ | | | | | | | | | | Old text would say something like: > Retrying in FormattedDuration(29.999861026s).
* | tor-proto: change `dyn ChannelProvider` to also be `Sync`Steven Engler2026-03-242-3/+3
| | | | | | | | | | An `Arc<T>` is only `Send` if `T` is `Send + Sync`, which is needed by the runtime.
* | tor-proto: change relay circ reactor `new()` to `pub(crate)`Steven Engler2026-03-241-1/+1
|/ | | | | I plan to call this from `crates/tor-proto/src/channel/reactor.rs`.
* Merge branch 'weak_table_explicit_hasher' into 'main'David Goulet2026-03-245-5/+28
|\ | | | | | | | | | | | | Force use of standard hasher with weak_tables. Closes #2418 See merge request tpo/core/arti!3801
| * Force use of standard hasher with weak_tables.Nick Mathewson2026-03-245-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Closes #2418. Fixes TROVE-2026-005, where we would use a less cryptographically secure (and probably less DoS resistant) hash function for these tables if: - We are built alongside another crate that uses `weak-table` - That crate enables the `weak-table/ahash` feature. - We are running on a system without hardware AES. Severity: Low
* | arti-relay: change a 'debug' log to 'info'Steven Engler2026-03-241-2/+2
| | | | | | | | | | I had intended for this to be 'info' in f287ec7910, but must have accidentally wrote 'debug'.
* | Fix typosTobias Stoeckmann2026-03-2449-74/+76
|/ | | | Typos found with codespell
* rpc: re-run cbindben.Nick Mathewson2026-03-231-3/+3
|
* typo fixes from @jnewsomeNick Mathewson2026-03-231-1/+1
|
* Run cbindgen to regenerate header file.Nick Mathewson2026-03-232-1/+230
|
* rpc: add ffi wrappers for nonblocking and event-loop functions.Nick Mathewson2026-03-232-6/+313
| | | | | This commit adds FFI wrappers for the "poll" API, which lets the user integrate with a poll(2)-style event loop.
* rpc: define FFI wrappers for nonblocking request APIsNick Mathewson2026-03-231-1/+137
| | | | | | This commit adds wrappers for the "submit/wait" methods on RpcConn (which are used to submit tagged requests, and then wait for responses to all tagged requests at once).
* Merge branch 'half-stream-expiry3' into 'main'gabi-2502026-03-233-53/+55
|\ | | | | | | | | | | | | proto: Replace TimeoutEstimator with opaque handler Closes #2410 See merge request tpo/core/arti!3794
| * proto: Remove now-unused TimeoutEstimator argumentGabriela Moldovan2026-03-191-2/+0
| |
| * proto: Replace TimeoutEstimator with opaque handlerGabriela Moldovan2026-03-193-50/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the client-specific half-stream expiry calculation from the stream reactor (which is meant to be implementation agnostic) with a call to the new `StreamHandler::halfstream_expiry()`, which abstracts away the implementation-specific half-stream expiry calculation (for example, on the client-side, the calculation takes into account the CBT, which we don't have on the relay side). Note that there is currently no `StreamHandler` implementation on the client-side (because we haven't ported the client circuit reactor to the new reactor yet). Closes #2410
| * proto: Implement StreamHandler for relaysGabriela Moldovan2026-03-191-1/+29
| |
| * proto: Add a trait for customizing StreamReactor behaviorGabriela Moldovan2026-03-191-0/+13
| | | | | | | | | | This will enable us to handle half-stream expiry differently on the client side vs the exit side.
* | Merge branch 'build_certs_refactor' into 'main'Nick Mathewson2026-03-237-23/+59
|\ \ | | | | | | | | | | | | cell, proto, cert: Simplify CERTS cell building. See merge request tpo/core/arti!3795
| * | cell: Feature-gate API using the possibly absent EncodedCert type.Nick Mathewson2026-03-233-1/+6
| | |
| * | cell, proto, cert: Simplify CERTS cell building.Nick Mathewson2026-03-195-22/+53
| | | | | | | | | | | | | | | | | | | | | | | | Formerly we required the caller for push_cert_body to specify the type of the cert that they were pushing. But in nearly every case, the certificate object that the caller is holding knows what its own type is! This makes the tor_proto build_certs_cell function a bit less error-prone, since we don't have to worry about mismatch.
* | | Merge branch 'gating-cleanup' into 'main'Ian Jackson2026-03-232-5/+1
|\ \ \ | | | | | | | | | | | | | | | | proto: Remove unnecessary test-gating See merge request tpo/core/arti!3796
| * | | proto: Remove unnecessary feature-gatingGabriela Moldovan2026-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | `test_utils` is not exposed outside of `tor-proto`, so the feature gating here isn't needed (we typically use the `testing` feature for exposing testing utilities outside the current crate, but that's not the case here).
| * | | proto: Remove unnecessary test-gatingGabriela Moldovan2026-03-191-4/+0
| | |/ | |/| | | | | | | | | | The `test_util` modules is already gated behind `#[cfg(any(test, feature = "testing"))]`.
* | | Merge branch 'retry_error_dedup' into 'main'gabi-2502026-03-231-23/+62
|\ \ \ | | | | | | | | | | | | | | | | retry-error: Allow dedup_by to merge ranges See merge request tpo/core/arti!3784
| * | | retry-error: Remove unused variableTobias Stoeckmann2026-03-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Spotted during review by gabi-250 in another test. Signed-off-by: Tobias Stoeckmann <[email protected]>
| * | | retry-error: Simplify extend_from_retry_errorTobias Stoeckmann2026-03-191-16/+7
| | | | | | | | | | | | | | | | | | | | With the newly introduced count function, extend_from_retry_error can be simplified by spliting n_errors calculation from new_attempt creation.
| * | | retry-error: Allow dedup_by to merge rangesTobias Stoeckmann2026-03-191-5/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dedup_by function grows the "last_attempt" always by one, even if a range is encountered. A mergeable range can be encountered if the RetryError has been extended by another RetryError already containing a range. Take this special case into account by using the actual amount of failures of the attempt when growing. Signed-off-by: Tobias Stoeckmann <[email protected]>