aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | Temporarily disable some clippy lints on nightlyIan Jackson2022-02-021-0/+1
| |
* | Remove many needless borrows and slicesIan Jackson2022-02-023-6/+6
|/ | | | | | | Found via clippy::needless_borrow. In some cases I removed needless `[..]` too. See also: needless_borrow suggestion doesn't go far enough https://github.com/rust-lang/rust-clippy/issues/8389
* Bump the patch version of every crate that changed since 0.0.3Nick Mathewson2022-01-311-2/+2
|
* Use script to update README.md files.Nick Mathewson2022-01-281-3/+0
|
* Make the native-tls crate optional.Nick Mathewson2022-01-261-3/+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
* Remove a now-incorrect comment in tor-proto.Nick Mathewson2022-01-261-3/+0
|
* clippy: Rename a `decode_chanmsg` from `handle_`Ian Jackson2022-01-192-4/+4
| | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/249#note_2771025 It doens't really handle it.
* handshake: Use read_exact, not read and checking lenIan Jackson2022-01-191-3/+7
| | | | | | | | | read_exact has a loop in it, which we need. This means we end up separating the two sites that generate the "not a relay" error, so we need to fish out the error construction. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/249#note_2771023
* clippy: Rename a `from_foo` method that doesn't do conversionIan Jackson2022-01-193-5/+7
|
* Fix two bugs related to incomplete read/writeIan Jackson2022-01-191-3/+3
| | | | Discovered by clippy
* Merge branch 'channel-arc-rework-5' into 'main'eta2022-01-132-52/+73
|\ | | | | | | | | chanmgr: get rid of Arc around Channel See merge request tpo/core/arti!236
| * chanmgr: get rid of Arc around ChannelIan Jackson2022-01-132-52/+73
| |
* | Describe when we will need SendmeAcceptMinVersionNick Mathewson2022-01-121-0/+8
| | | | | | | | | | | | (spoiler: not until we have a relay implementation) Closes #53.
* | Change RequireSendmeAuth to an enum.Nick Mathewson2022-01-122-33/+69
| | | | | | | | | | | | | | | | This is a fine example of why booleans are risky: it's far to easy to pass "animate:bool" into "inanimate:bool" like we did here. This is a followup from our fix to #294.
* | Fix a boolean inversion in auth_sendme_optional.Nick Mathewson2022-01-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we were requiring authenticated sendme cells exactly when we should be permitting the old format, and vice versa. This bug was caused by using a boolean to represent one property, but with giving that boolean two different senses without inverting at the right time. The next commit will prevent a recurrence. Closes #294
* | Document SendmeEmitMinVersion statusNick Mathewson2022-01-121-0/+4
|/ | | | | (We don't need to look at SendmeEmitMinVersion since higher values are not yet defined.)
* Merge branch 'eta/182' into 'main'Nick Mathewson2022-01-112-6/+37
|\ | | | | | | | | Improve the layout of crate exports; add runtime convenience functions See merge request tpo/core/arti!235
| * Add a blank line between doc and comment.Ian Jackson2022-01-111-0/+1
| |
| * Improve the layout of crate exports; add runtime convenience functionseta2022-01-112-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit addresses multiple problems highlighted by arti#182: - `arti-client` had some types in its public API that weren't accessible without importing another crate (`CfgPath`, `DataReader`, `DataWriter`). This has been fixed. - In addition, the doc comments for `DataReader` and `DataWriter` were cleaned up to be of better quality, now that they're public. - It was impossible to use `arti-client` without also importing `tor-rtcompat`. This is now fixed by the addition of two convenience methods: `TorClient::bootstrap_with_tokio` and `TorClient::bootstrap_with_async_std`. - Potentially controversially: `tor-rtcompat` now returns *concrete* types from methods like `current_runtime`, instead of `impl Runtime`. - This was needed in order to actually be able to name the `TorClient` type that results from using these methods. - This does mean we lose API flexibility, but on balance I think this is a good thing, because the API we *do* have is actually usable...
* | Bump all crate versions to 0.0.3.Nick Mathewson2022-01-111-9/+9
|/
* Minimize the required version for each dependency.Nick Mathewson2022-01-071-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found these versions empirically, by using the following process: First, I used `cargo tree --depth 1 --kind all` to get a list of every immediate dependency we had. Then, I used `cargo upgrade --workspace package@version` to change each dependency to the earliest version with which (in theory) the current version is semver-compatible. IOW, if the current version was 3.2.3, I picked "3". If the current version was 0.12.8, I picked "0.12". Then, I used `cargo +nightly upgrade -Z minimal-versions` to downgrade Cargo.lock to the minimal listed version for each dependency. (I had to override a few packages; see .gitlab-ci.yml for details). Finally, I repeatedly increased the version of each of our dependencies until our code compiled and the tests passed. Here's what I found that we need: anyhow >= 1.0.5: Earlier versions break our hyper example. async-broadcast >= 0.3.2: Earlier versions fail our tests. async-compression 0.3.5: Earlier versions handled futures and tokio differently. async-trait >= 0.1.2: Earlier versions are too buggy to compile our code. clap 2.33.0: For Arg::default_value_os(). coarsetime >= 0.1.20: exposed as_ticks() function. curve25519-dalek >= 3.2: For is_identity(). generic-array 0.14.3: Earlier versions don't implement From<&[T; 32]> httparse >= 1.2: Earlier versions didn't implement Error. itertools at 0.10.1: For at_most_once. rusqlite >= 0.26.3: for backward compatibility with older rustc. serde 1.0.103: Older versions break our code. serde_json >= 1.0.50: Since we need its Value type to implement Eq. shellexpand >= 2.1: To avoid a broken dirs crate version. tokio >= 1.4: For Handle::block_on(). tracing >= 0.1.18: Previously, tracing_core and tracing had separate LevelFilter types. typenum >= 1.12: Compatibility with rust-crypto crates x25519-dalek >= 1.2.0: For was_contributory(). Closes #275.
* ClientCirc: change some methods to take &selfNick Mathewson2022-01-071-11/+6
| | | | | Previously they took Arc<Self>, and then Self, but &self is perfectly fine here.
* tor-circmgr: Remove Arc around ClientCircIan Jackson2022-01-071-8/+25
| | | | | | See the new commentary text on `ClientCirc` for the rationale. Signed-off-by: Ian Jackson <[email protected]>
* Merge branch 'refactor/unwrap-or-default' into 'main'eta2022-01-061-1/+1
|\ | | | | | | | | prefer 'unwrap_or_default' to manual constructor See merge request tpo/core/arti!215
| * prefer 'unwrap_or_default' to manual constructorDaniel Eades2022-01-011-1/+1
| |
* | Merge remote-tracking branch 'origin/mr/214'Nick Mathewson2022-01-061-0/+1
|\ \
| * | extend lints to include 'clippy::all'Daniel Eades2021-12-281-0/+1
| |/
* | Merge remote-tracking branch 'origin/mr/212'Nick Mathewson2022-01-062-3/+4
|\ \
| * | tor-circmgr: Don't clone parameters in create_chantarget()Neel Chauhan2021-12-252-3/+4
| |/
* / tor-proto: In begin_stream_impl(), if number of hops is zero, don't continueNeel Chauhan2021-12-251-1/+5
|/
* tor-proto: Replace XXXs with references to arti#269Nick Mathewson2021-12-201-9/+7
| | | | | These will require thought; should we ignore them, act on them, or continue to treat them as internal errors?
* tor-proto: Allow one meta-cell handler at a time.Nick Mathewson2021-12-161-10/+18
| | | | | Previously the code would let us try to install a meta-cell handler before the old one was done, leading to possible confusion.
* Merge branch 'ct_sendme_tags' into 'main'eta2021-12-162-13/+48
|\ | | | | | | | | tor-proto: use const-time eq on sendme tags. See merge request tpo/core/arti!201
| * tor-proto: use const-time eq on sendme tags.Nick Mathewson2021-12-162-13/+48
| | | | | | | | | | | | | | There's no known attack here, but it's best practice to always compare digests using a constant-time comparison operator. This resolves an XXXX comment.
* | tor-proto: set HalfStream::connected_ok right.Nick Mathewson2021-12-162-2/+15
| | | | | | | | | | | | | | | | Previously we'd always set it to true, allowing one CONNECTED per half-closed stream even if the stream had already received a CONNECTED cell. This resolves an XXXX.
* | tor-proto: replace a streammap XXXX with a ticket.Nick Mathewson2021-12-161-3/+4
|/
* tor-proto: document an infelicitous behavior.Nick Mathewson2021-12-161-3/+4
| | | | | This was an XXXX before. Now it explains why the behavior is safe for now, but maybe not forever.
* Extend trace messages for destroy/truncated reasons.Nick Mathewson2021-12-151-2/+17
| | | | | | | | | | | | It makes sense to put the method for human-readable strings onto the type itself, so that we can format these whenever they occur. I'm choosing the "human_str" method name here, since caret-generated types already have a to_str. I was thinking about using Display, but caret types already implement that. I've also moved the message from "warn!" to "debug!", since these aren't necessarily a problem condition.
* Merge remote-tracking branch 'origin/mr/191'Nick Mathewson2021-12-151-23/+24
|\
| * In reactor, use enums on whether to destroy circuitsNeel Chauhan2021-12-141-11/+20
| |
| * Methodize the destroy circuit reasonNeel Chauhan2021-12-141-19/+2
| |
| * Handle TRUNCATED cellsNeel Chauhan2021-12-131-12/+9
| |
| * Log on TRUNCATED cellNeel Chauhan2021-12-131-9/+21
| |
* | Merge branch 'check_put_return' into 'main'eta2021-12-153-25/+27
|\ \ | | | | | | | | | | | | | | | | | | Always check whether stream-level SENDMEs are expected. Closes #261 See merge request tpo/core/arti!192
| * | Always check whether stream-level SENDMEs are expected.Nick Mathewson2021-12-143-25/+27
| |/ | | | | | | | | | | | | | | | | | | (It's a protocol violation to get a SENDME when our send window is already full.) This patch makes SendWindow::put return a Result, so that it's easier to do the right thing with it. Closes #261.
* / Actually decrement the stream-level SENDME windoweta2021-12-142-0/+31
|/ | | | | | | | | | | | | arti!126 overhauled the `tor-proto` circuit reactor, but left out one very important thing: actually decrementing the SENDME window for streams (not circuits) when we send cells along them. Since the circuit-level SENDME window would often prevent us from running into a problem, this wasn't caught until my benchmarking efforts noticed it (in the form of Tor nodes aborting the circuit for a protocol violation). fixes arti#260
* fix nightly clippy errorsTrinity Pointard2021-12-092-3/+2
|
* Beautify some Vec->array code in tor-proto.Nick Mathewson2021-12-081-6/+7
| | | | | | | [T;N] supports TryFrom<Vec<T>>, and has since Rust 1.48: we can just use that. This resolves an XXXX comment.
* Merge remote-tracking branch 'origin/mr/180'Nick Mathewson2021-12-081-11/+10
|\
| * In CryptInit, return a Result in initialize()Neel Chauhan2021-12-081-11/+10
| |