aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-proto: only parse allowed ChanMsg types during handshake.Nick Mathewson2023-02-093-29/+100
|
* tor-cell: Make RelayEarly a separate type.Nick Mathewson2023-02-092-4/+4
| | | | This allows us to remove a shenanigan from `restricted_msg!{}`.
* tor-cell: Have restrict_msg add conversion functions.Nick Mathewson2023-02-091-2/+2
| | | | | | | | | | | | | | | | Every FooMsg type now implements Into<AnyFooMsg>, and TryFrom<FooMsg>. Additionally, it now implements From<X> for every distinct type that it supports. This last part lets us discard a bunch of code. Unfortunately, I needed some downright hackish trickery in order to get these macros to avoid generating `From<AnyFooMsg> for AnyFooMsg` and conflicting with the blanket implementation. The trickery to deal with RelayEarly and Relay being the same type was not necessarily worth it; I will be separating them and removing said trickery in the next commit.
* tor-cell: Rename RelayMsg and RelayCell-related types.Nick Mathewson2023-02-078-85/+94
| | | | Thanks to rust-analyzer for making this simple.
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-077-100/+100
|
* tor-cell: Remove RelayMsg methods that are duplicated in RelayMsgClass.Nick Mathewson2023-02-074-2/+4
|
* tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass.Nick Mathewson2023-02-076-4/+9
|
* tor-cell: Use macro to generate ChanMsg too.Nick Mathewson2023-02-073-4/+4
|
* tor-cell: Change all variants of RelayMsg to have a body.Nick Mathewson2023-02-071-4/+5
| | | | | Previously, there were some unit variants, but that makes things quite awkward for #525.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-2716-0/+16
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Merge branch 'sensitive' into 'main'eta2023-01-261-3/+4
|\ | | | | | | | | tor-proto: Mark stream ids in errors as sensitive See merge request tpo/core/arti!986
| * tor-proto: Mark stream ids in errors as sensitiveIan Jackson2023-01-241-3/+4
| | | | | | | | Pursuant to #556
* | tor-proto: comment fixes and more TODO hsNick Mathewson2023-01-242-2/+18
| |
* | tor-proto: Draft API to handle incoming BEGIN requests.Nick Mathewson2023-01-173-0/+98
| | | | | | | | Onion services (and later, exits and caches) will need this.
* | tor-proto: Expose support for doing onion service handshakesNick Mathewson2023-01-174-17/+79
| | | | | | | | | | | | This is a little tricky, but I think that we're not actually exposing too much here. I expect we'll need to tweak this stuff between now and our final version.
* | tor-proto: Draft APIs for handling control messagesNick Mathewson2023-01-171-0/+52
| | | | | | | | | | We will need these for onion services, to send and receive messages of types not handled directly by the tor-proto crate.
* | tor-proto: Rename "hs" experimental feature to "onion-common"Nick Mathewson2023-01-171-1/+1
|/ | | | (For consistency with other crates)
* Fix typosDimitris Apostolou2023-01-071-1/+1
|
* tor-proto: rustfmtIan Jackson2023-01-061-1/+2
| | | | Not sure why the tree didn't have this newline already. "Whatever".
* tor-proto: CreateFastWrap::decode_chanmsg: Do not report handshakeIan Jackson2023-01-062-3/+3
| | | | | The debug impl prints the handshake challenge, which we should probably treat as sensitive.
* tor-proto: impl Display for CreateResponseIan Jackson2023-01-061-0/+12
| | | | Don't print the handshake value, but do print the display reason.
* tor-proto: When relay IDs mismatch, the IDs are sensitive in errorsIan Jackson2023-01-062-3/+7
|
* Merge branch 'test-lints' into 'main'eta2023-01-0615-1/+124
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-1214-0/+115
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
| * test lint blocks: Do some semi-manuallyIan Jackson2022-12-121-1/+9
| | | | | | | | | | | | | | This is the hunks from running the rune in maint/adhoc-add-lint-blocks but which require some subsequent manual fixup: usually, deleting now-superfluous outer allows, but in some cases manually putting back lints that the adhoc script deleted.
* | Merge branch 'tor-proto-use-rfc3339' into 'main'Ian Jackson2023-01-041-1/+2
|\ \ | | | | | | | | | | | | Use parse_rfc3339() in the tor-proto crate See merge request tpo/core/arti!942
| * | Use parse_rfc3339() in the tor-proto crateNeel Chauhan2022-12-161-1/+2
| | |
* | | msg::{CreateFast/CreatedFast}: Rename accessor to (into_)body()Neel Chauhan2022-12-181-2/+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
|/
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-2/+2
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* Run add_warnings.Nick Mathewson2022-11-031-0/+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.
* proto: Make Channel::reparameterize take &self.Nick Mathewson2022-10-181-1/+1
| | | | | | | | | | Even though channels are practically changeable, they use locks internally so that you don't need a `&mut Channel` to send or receive traffic. It makes sense for reparameterizing the channel to also use a &self reference. I'll need this so that I can store channels in an `ByRelayIds<>` set, and still invoke their reparameterize methods.
* proto: Implement HasRelayIds for Channel.Nick Mathewson2022-10-181-0/+9
|
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-99/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* 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-112-6/+6
| | | | | | | 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-065-16/+58
| | | | These are now builders.
* tor-proto: Preserve the ChannelMethod, not the SocketAddrNick Mathewson2022-10-062-32/+62
|
* fix clippy::needless_borrowtrinity-1686a2022-09-101-1/+1
|
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-242-0/+2
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-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