aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Rename RemoteIdMismatch to RelayIdMismatch.Nick Mathewson2022-02-221-1/+1
| | |
| * | Fold AlreadyClosed into BadApiUsageNick Mathewson2022-02-221-1/+1
| |/
* / Remove clippy::needless_borrow exception in CI.Nick Mathewson2022-02-201-1/+0
|/ | | | | This exception is no longer necessary now that the underlying CI bug is fixed.
* Replace as_mut with deref impl for MutCircEntYuan Lyu2022-02-162-26/+34
|
* Make CircMap open_ent_count O(1)Yuan Lyu2022-02-162-26/+76
|
* tor_proto::Error: Fix an incomplete sentence.Nick Mathewson2022-02-161-1/+2
|
* Update tor-proto errors to latest API.Nick Mathewson2022-02-1511-43/+41
|
* Make tor-proto::Error implement HasKind.Nick Mathewson2022-02-153-26/+54
| | | | | | This took some refactoring, and gave an opportunity to notice a few error variants that weren't being used, or didn't mean what they said on the tin.
* tor-proto: use InternalError for internal errors.Nick Mathewson2022-02-1512-45/+83
|
* tor-cell: provide HasKind.Nick Mathewson2022-02-154-17/+49
| | | | | | | | | Additionally, refactor the IoError out of tor_cell::Error: nothing in TorCell created this; it was only used by tor_proto. This required refactoring in tor_proto to use a new error type. Here I decided to use a new CodecError for now, though we may refactor that away soon too.
* Merge branch 'warn_not_deny' into 'main'eta2022-02-141-1/+1
|\ | | | | | | | | | | | | Change deny(clippy::all) to warn(clippy::all). Closes #338 See merge request tpo/core/arti!306
| * Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | | | | | Closes #338.
* | Use atomic set-and-check to update OptTimestamps if none.Nick Mathewson2022-02-092-4/+38
|/ | | | | | | This fixes a tiny race condition in the previous code, where we checked whether an OptTimestamp is None a bit before we set it. Since std::atomic gives us compare_exchange, we might as well use it.
* Remove the use of Mutex in channel unused_since timestampYuan Lyu2022-02-084-58/+67
|
* Expire channels that have been unused for too longYuan Lyu2022-02-043-14/+97
|
* Merge branch 'eta/reactor-2.5' into 'main'eta2022-02-031-33/+60
|\ | | | | | | | | Fix severe reactor ordering problems See merge request tpo/core/arti!282
| * Fix severe reactor ordering problemseta2022-02-031-33/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of severe problems with the circuit reactor were fixed which could cause reordering of cells (which causes relays to terminate the circuit with a protocol violation, as they become unable to decrypt them). These mostly revolve around improper usage of queues: - The code assumed that a failure to place cells onto the channel would persist for the duration of a reactor cycle run. However, under high contention, this wouldn't always be the case. - This leads to some cells getting enqueued while others go straight through, before the enqueued cells. - To fix this, we block sending cells out of the channel while there are still some enqueued. - The hop-specific queues queued after encryption, not before. This was very brittle, and led to frequent mis-ordering. - This was fixed by making them not do that. This is arti!264 / 5bce9db5628126be2b736f228211174fe4132918 without the refactor part.
* | Merge branch 'typos' into 'main'eta2022-02-032-2/+2
|\ \ | | | | | | | | | | | | Fix typos See merge request tpo/core/arti!285
| * | Fix typosDimitris Apostolou2022-02-022-2/+2
| |/
* | 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
* 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.)
* 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...
* 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.