summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/channel
Commit message (Collapse)AuthorAgeFilesLines
* Downgrade some messages to traceIan Jackson2023-11-291-1/+1
| | | | | These messages are very verbose and I doubt anyone will want them, usually, even when debugging.
* Change `CircId` to never be zeroJim Newsome2023-10-253-46/+81
| | | | | | | | | | This changes the internal representation to be `NonZeroU32` instead of just `u32`. Various places where a circuit ID is optional now use `Option<CircId>`. Fixes a bug in `CircIdRange::sample` that would previously return a circuit ID of 0, when the rng returned 0x8000_0000 for a low range.
* Upgrade to latest asynchronous_codec (0.7.0)Nick Mathewson2023-10-171-2/+2
|
* oneshot: Use veneer in tor-protoIan Jackson2023-10-112-5/+8
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-233-0/+3
|
* test: add a test for missing NETINFO cellsEmil Engler2023-08-121-0/+15
| | | | | | This commit adds a unit test to the `tor_proto::handshake` module, which tests the behavior when no NETINFO cell is present within a channel.
* proto: methods to wait until a channel/circuit is shut down.Nick Mathewson2023-08-041-0/+7
| | | | | | | | | | | | | | | | | | The implementation here is perhaps excessively simple: we put a `oneshot::Sender` in the `Reactor` object, and a `Shared<oneshot::Receiver>` in the circuit or channel. When the reactor is dropped, any copy of the `Shared<Receiver>` will yield `Err(Cancelled)`. I'm marking these methods as experimental because I'm not sure I've thought of all the implications here, and we might want to change things around. Down the road, these methods might want to yield a `Result<>` indicating why the reactor was shut down. This feature was inspired by a request from Saksham Mittal, and a felt need while working on !1472.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-103-0/+3
|
* tor-proto: Remove use of arrayref.Nick Mathewson2023-06-011-2/+5
|
* Replace usage of KeyUnknownCert::check_key.Nick Mathewson2023-05-161-2/+2
|
* async-utils: rename SinkExt to SinkPrepareExtNick Mathewson2023-04-191-1/+1
|
* Move functionality from tor_basic_utils to tor_async_utilsNick Mathewson2023-03-291-1/+1
| | | | | This commit is mostly code movement; I'd recommend reviewing it with git's `--color-moved` option.
* Fix a bunch of needless-conversion warnings.Nick Mathewson2023-03-101-1/+0
| | | | | Apparently 1.68 now warns when you call into_iter() on something that's already an iterator. Fair enough. Let's stop doing that.
* Rename OpenClientChan{Msg,Cell} => OpenChan{Msg,Cell}S2CNick Mathewson2023-02-091-20/+20
|
* tor-proto: Do not parse forbidden commands on inbound cells.Nick Mathewson2023-02-091-84/+28
| | | | | | | | | | Unlike C tor, we treat unrecognized commands as reason to kill off the connection entirely. That's fine; if we need to add an unrecognized command in the future, we can use VERSIONS to negotiate it. Also, if someday we want this code to support relay channels as well, we can use some type trickery to have that work too.
* tor-proto: only parse allowed ChanMsg types during handshake.Nick Mathewson2023-02-092-28/+97
|
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-073-42/+42
|
* tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass.Nick Mathewson2023-02-073-2/+3
|
* tor-cell: Use macro to generate ChanMsg too.Nick Mathewson2023-02-072-3/+3
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-273-0/+3
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* tor-proto: rustfmtIan Jackson2023-01-061-1/+2
| | | | Not sure why the tree didn't have this newline already. "Whatever".
* tor-proto: When relay IDs mismatch, the IDs are sensitive in errorsIan Jackson2023-01-061-2/+4
|
* Merge branch 'test-lints' into 'main'eta2023-01-062-0/+17
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-122-0/+17
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Use parse_rfc3339() in the tor-proto crateNeel Chauhan2022-12-161-1/+2
| |
* | Merge branch 'err-dyn-report' into 'main'Ian Jackson2022-12-151-1/+1
|\ \ | | | | | | | | | | | | Error logging (ErrorReport, .report()) POC See merge request tpo/core/arti!936
| * | tor-proto: reactor tests: Use debug fmt on an errorIan Jackson2022-12-121-1/+1
| |/ | | | | | | | | | | | | In tests, debug fmt is usually appropriate. Found while looking for a candidate for https://gitlab.torproject.org/tpo/core/arti/-/issues/680
* / Tackling issue #663 (Use humantime in tests)coral2022-12-121-1/+1
|/
* Merge branch 'rename_for_to_from' into 'main'Nick Mathewson2022-10-251-2/+2
|\ | | | | | | | | tor-cell: Rename for_client and for_relay See merge request tpo/core/arti!793
| * tor-cell: Rename for_client and for_relayEmil Engler2022-10-211-2/+2
| | | | | | | | | | | | | | This commit renames the for_client and for_relay functions to from_client and from_relay respectively, in order to indicate their origin, as the term "for" is more likely to indicate a destination, which is not true in that situation.
* | linkspec: Remove now-useless declared_peer_addrNick Mathewson2022-10-241-3/+4
|/ | | | The singleton variation here is almost never what we want.
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-121-0/+1
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-111-2/+2
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* Clarify limits on socket address from ChannelMethodNick Mathewson2022-10-061-2/+2
|
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-062-5/+15
| | | | These are now builders.
* tor-proto: Preserve the ChannelMethod, not the SocketAddrNick Mathewson2022-10-061-21/+42
|
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-241-0/+1
|
* channel padding: Only do anything with link protocol 5Ian Jackson2022-08-171-0/+7
| | | | | | | Or rather, if we *didn't* negotiate 4, which is too old. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
* channel padding: Properly advertise link protocol 5Ian Jackson2022-08-171-3/+2
| | | | | | | | | We already actually send and negotiate the padding, since !657, but we ought to negotiate a protocol version where that's not a violation! As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
* channel padding: Move initial config of ChannelPaddingInstructionsIan Jackson2022-08-171-6/+5
| | | | | | | | | | | | | Making ChannelPaddingInstructions::default() accurately reflect the initial state of the reactor's padding timer simplifies the code somewhat. (When padding is wanted, parameters are computed and inserted explicitly, so the only change is that if we start out dormant, we defer setting the timer parameters until necessary.) As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
* channel padding: Parameters: default_padding replaces Default implIan Jackson2022-08-172-1/+7
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
* channel reactor: Add some commented-out debug for paddingIan Jackson2022-08-171-1/+5
|
* channel padding: Correctly always send the timer parametersIan Jackson2022-08-171-1/+8
| | | | Fixes "chanmgr configuration: Avoid sending needless initial update(s)"
* channel padding: Abolish ARTI_EXPERIMENTAL_CHANNEL_PADDING env varIan Jackson2022-08-171-8/+0
| | | | This was for testing and is no longer needed.
* ChannelPaddingInstructions: Update and expand docsIan Jackson2022-08-172-11/+41
|
* ChannelPaddingInstructions: Rename `params` field to `insns`Ian Jackson2022-08-171-6/+6
|
* Rename ChannelsParams types to ChannelPaddingInstructions (fmt)Ian Jackson2022-08-171-1/+4
| | | | Run rustfmt; no other changes.
* Rename ChannelsParams types to ChannelPaddingInstructionsIan Jackson2022-08-172-38/+38
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826167 This makes some lines too long; I will run rustfmt in a separate commit for clarity.
* Rename PaddingParameters::all_zeroes constructor to disabledIan Jackson2022-08-171-4/+2
|
* tor-cell: PaddingNegotiate::default_reducedIan Jackson2022-08-171-10/+0
| | | | | | | | | | | Get rid of unneeded constructor. We never need to use hardcoded reduced padding parameters during negotiation cell construction. If we are using reduced padding parameters, the layers which decide this have netparams to use. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826092