summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
* Patchlevel bumps for remaining changed crates.Nick Mathewson2023-02-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have had small code changes, but no API additions: tor-config tor-socksproto tor-cert tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr arti tor-hsservice tor-congestion These crates have had API extensions: fs-mistrust tor-llcrypto tor-bytes tor-checkable tor-linkspec tor-netdoc tor-persist arti-client
* Bump tor-units version for breaking change.Nick Mathewson2023-02-281-1/+1
| | | | | | | | (The breaking change was removing `as_days()` from IntegerMinutes.) We are _not_ calling this a downstream-api breaking change, per discussion at https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012?commit_id=bb2ab7c2a3e0994bb438188511688b5b039cae29#note_2876819
* Bump minor versions for significant breaking changes.Nick Mathewson2023-02-281-2/+2
| | | | This includes tor-cell, tor-proto, and tor-netdir.
* Rename onion-* cargo features to hs-* in tor-* cratesIan Jackson2023-02-285-12/+12
| | | | Fixes #756
* proto: Tweak documentation and names around CmdChecker.Nick Mathewson2023-02-275-9/+33
|
* tor-proto: Rename end_received.Nick Mathewson2023-02-172-8/+9
| | | | It can now indicate _any_ cell that means we can forget about a stream.
* Use CmdChecker in our stream handling code.Nick Mathewson2023-02-174-96/+92
| | | | | | | | | | This change makes sure that open streams and half-closed streams have the same stream-type-dependent state machines with respect to which cells are acceptable. Fixes #774. Fixes #769.
* tor-proto: Introduce CmdChecker, and define it for our streams.Nick Mathewson2023-02-174-0/+150
| | | | | | | | The role of CmdChecker is to verify that messages are arriving at the appropriate sequence on a stream, with respect to the other messages that have been received. Once the stream becomes half-closed, the CmdChecker is also in charge of consuming incoming messages on the stream and making sure that they are well-formed.
* tor-proto: Add a TODO about simplifying a common pattern.Nick Mathewson2023-02-151-0/+8
|
* tor-proto: note implications for future HS workNick Mathewson2023-02-152-0/+12
|
* tor-proto: Push stream message parsing into the stream objects.Nick Mathewson2023-02-156-51/+88
| | | | | This closes #525, and ensures, at last, that we don't parse any message that we wouldn't accept.
* tor-proto: Defer parsing of messages send to half-closed streamsNick Mathewson2023-02-153-42/+94
| | | | | | This includes a partial solution for #769, but also turned up another bug (#774) while I was working on it. I'll close them both once I have a real solution.
* tor-proto: stop reactor (and kill circuit) if meta handler failsNick Mathewson2023-02-151-4/+7
| | | | | | | If the meta handler reports an error, then the circuit has violated its protocol, and needs to be shut down. Fixes #773.
* tor-proto: defer meta-cell parsing to the last moment.Nick Mathewson2023-02-152-36/+27
|
* tor-proto: Use UnparsedRelayCell to start deferring cell processing.Nick Mathewson2023-02-152-22/+43
| | | | | In general, we want to avoid parsing these cells until we are fairly sure that they are something we would accept.
* tor-cell: Refactor relay cells to copy much lessNick Mathewson2023-02-154-25/+15
| | | | | | | | | | | | | We now manipulate raw relay cell bodies as (an alias for) `Box<[u8;509]>` rather than as (an alias for) `[u8;509]`. This enables us to do much less copying. It will become more important soon, as we defer parsing relay cell bodies even longer. Related to #7. We also use SliceWriter to avoid allocating a Vec<> for every relay message we want to encode, and instead encode directly into the cell.
* Rename OpenClientChan{Msg,Cell} => OpenChan{Msg,Cell}S2CNick Mathewson2023-02-093-31/+31
|
* tor-proto: Do not parse forbidden commands on inbound cells.Nick Mathewson2023-02-093-88/+63
| | | | | | | | | | 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-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.
* Bump minor version of tor-cell.Nick Mathewson2023-02-011-1/+1
| | | | | | | | | In !948 we renamed a couple of accessor functions, which is a breaking change in `tor-cell`'s API. In retrospect, perhaps we should have deprecated the old names and added the new ones, so we wouldn't have to break the API. (This is the only API break AFAICT since 1.1.0.)
* Bump the patch version of every crate that had API additionsNick Mathewson2023-02-011-5/+5
| | | | | | These crates had API or behavior changes that may affect downstream crates. Fortunately, they're all version 0.x, and don't need minor bumps for this.
* Bump the patch-level version of crates with _minor_ changes.Nick Mathewson2023-02-011-5/+5
| | | | | | | These changes influence behavior, but not effect compatibility. (If I messed up, and any crate except for `arti` has non-breaking API changes, that's still fine, since they are all version 0.x.)
* Move tor-proto/semver.md to tor-cellNick Mathewson2023-02-011-2/+0
| | | | It was erroneously created in the wrong place.
* 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-172-1/+54
| | | | | | | | | | 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-172-3/+6
|/ | | | (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-063-3/+8
|
* 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
| | |