summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | tor-hsservice errors: Use `crate::Result` rather than importsIan Jackson2023-08-172-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to change the error return types of many methods, so we need a way to name `std::result::Result`. We could use `StdResult`, but, actually, properly distinguishing the kinds of errors that can occur in various contexts means we don't actually want a single Error type for the whole crate, so `crate::Result` is going to go away.
* | | Merge branch 'ipt-e-drop' into 'main'gabi-2502023-08-184-2/+33
|\ \ \ | | | | | | | | | | | | | | | | Define drop behaviour of IPT establisher, wrt status watch See merge request tpo/core/arti!1516
| * | | tor-hsservice: Define drop behaviour of IPT establisher statusIan Jackson2023-08-173-0/+21
| | | |
| * | | tor-async-utils: Deprecate DropNotifyEofSignallable::is_eofIan Jackson2023-08-171-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was introduced in c82cda85d69d tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable and already, then, the is_eof() method is redundant.
* | | | Merge branch 'hss_circparams' into 'main'gabi-2502023-08-181-7/+5
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | hsservice: Use correct circparameters_from_netparameters fn See merge request tpo/core/arti!1520
| * | | hsservice: Use correct circparameters_from_netparameters fnNick Mathewson2023-08-181-7/+5
|/ / / | | | | | | | | | I had incorrectly thought that this function was private.
* | | Merge branch 'allow_stream_req-hop-num' into 'main'Nick Mathewson2023-08-184-9/+80
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-proto: Make ClientCirc::allow_stream_requests take a HopNum. Closes #1009 See merge request tpo/core/arti!1519
| * | | tor-proto: Add test where an incoming stream comes from an unexpect hop.Gabriela Moldovan2023-08-181-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a test that checks if the reactor is shut down if it receives an incoming stream request from an unexpected hop. Part of #1009
| * | | tor-proto: Make ClientCirc::allow_stream_requests take a HopNum.Gabriela Moldovan2023-08-184-9/+36
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | For consistency with the other `ClientCirc` APIs, `ClientCirc::allow_stream_requests` now takes a `HopNum` argument. Upon receiving an incoming stream request, the reactor now checks if the request came from the hop specified in `allow_stream_requests` (and if it came from a different hop, the circuit is closed). Part of #1009
* | | Merge branch 'ipt-relay' into 'main'Nick Mathewson2023-08-181-3/+3
|\ \ \ | |/ / |/| | | | | | | | tor-hsservice: Change IptEstablisher::new to take RelayIds See merge request tpo/core/arti!1517
| * | tor-hsservice: Change IptEstablisher::new to take RelayIdsIan Jackson2023-08-171-3/+3
|/ / | | | | | | | | | | | | | | | | | | The IptEstablisher needs to continuously maintain the IPT even as the netdir is updated. Whereas, the IPT manager just wants to select the relay from the netdir once and then only think about the relay identity. So it makes sense for the establisher to do necessary lookups of the relay's ids in the netdir.
* | Merge branch 'rendezvous_handshake' into 'main'Nick Mathewson2023-08-177-0/+293
|\ \ | | | | | | | | | | | | hsservice: new rend_handshake module See merge request tpo/core/arti!1512
| * | hsservice: new rend_handshake moduleNick Mathewson2023-08-174-0/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | This code has most of what we need to go from an INTRODUCE2 message we've just received to the point where we've connected to the rendezvous point and we're waiting for a stream of BEGIN messages. Unfinished pieces are marked with TODO HSS. Most of #980.
| * | cell: Add accessors to IntroduceHandshakePayloadNick Mathewson2023-08-162-0/+16
| | |
| * | cell: Add accessors to Introduce2.Nick Mathewson2023-08-162-0/+18
| | |
* | | Merge branch 'always_bug-from' into 'main'gabi-2502023-08-173-2/+13
|\ \ \ | |_|/ |/| | | | | | | | tor-bytes: deprecate always_bug with From trait See merge request tpo/core/arti!1500
| * | tor-bytes: deprecate always_bug with From traitEmil Engler2023-08-173-2/+13
| | | | | | | | | | | | | | | | | | This commit deprecates the `EncodeError::always_bug` function with a `From<EncodeError> for Bug` trait, which is a more semantically correct way to perform this action.
* | | Merge branch 'handshake-tests' into 'main'gabi-2502023-08-171-0/+15
|\ \ \ | |/ / |/| | | | | | | | test: add a test for missing NETINFO cells See merge request tpo/core/arti!1501
| * | 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.
* | | Merge branch 'all_crates_warnings' into 'main'Nick Mathewson2023-08-165-5/+10
|\ \ \ | | | | | | | | | | | | | | | | Resolve all warnings that appear from `maint/every-crate` See merge request tpo/core/arti!1507
| * | | arti-client: fix conditional unused_import and dead_code warningsNick Mathewson2023-08-162-5/+7
| | | |
| * | | guardmgr: Fix a dead-code warning when built without bridge support.Nick Mathewson2023-08-161-0/+1
| | | |
| * | | tor-proto: Fix dead_code when building without experimental-apiNick Mathewson2023-08-162-0/+2
| | | |
* | | | Merge branch 'netdir-todo' into 'main'gabi-2502023-08-162-23/+112
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | tor-netdir: Only select nodes that haven't been used for lower-numbered replicas. See merge request tpo/core/arti!1494
| * | | | tor-netdir: Replace somewhat niche scan() usage with flat_map().Gabriela Moldovan2023-08-161-9/+7
| | | | |
| * | | | tor-netdir: Rework the logic for checking if a node has already been selected.Gabriela Moldovan2023-08-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This just simplifies the expression a little bit. It still has the same behaviour.
| * | | | tor-netdir: Store the hsdir indices in a HashSet instead of a BTreeSet.Gabriela Moldovan2023-08-161-4/+4
| | | | |
| * | | | tor-netdir: Derive Hash for HsDirIndex.Gabriela Moldovan2023-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | This will become useful later when we build a `HashSet` of `HsDirIndex`.
| * | | | tor-netdir: Explain what the ring_items_at filter is for.Gabriela Moldovan2023-08-161-0/+5
| | | | |
| * | | | tor-netdir: Only select nodes that haven't been used for lower-numbered ↵Gabriela Moldovan2023-08-161-15/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replicas. This implements the part of the spec that says a node that has already been selected for a lowered-numbered replica, shouldn't be considered when choosing `spread` nodes for any other higher-numbered replicas. Note: previously, the test added in this commit wouldn't have passed (because `NetDir::hs_dirs` used to return duplicate relays under some circumstances). Part of #960
| * | | | tor-netdir: Make ring_items_at() filter the items before returning.Gabriela Moldovan2023-08-162-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes `ring_items_at()` take an extra parameter which specifies whether an item is acceptable or not. The newly added filtering capabilities will be used to implement the part of the spec that says that if a node was selected for a replica, then it shouldn't be considered when choosing `spread` nodes for any other higher-numbered replicas.
| * | | | tor-netdir: Update ring_items_at() docs.Gabriela Moldovan2023-08-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This updates the docs to reference the `spread` parameter (rather than `spread_fetch`).
| * | | | tor-netdir: Remove extraneous whitespace.Gabriela Moldovan2023-08-161-1/+1
| | | | |
| * | | | tor-netdir: Use hsdir_spread_store if we're uploading.Gabriela Moldovan2023-08-161-4/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | The spread should be either `hsdir_spread_store` or `hsdir_spread_fetch`, depending on whether we're uploading or downloading descriptors.
* | | | Merge branch 'ipt-e' into 'main'Nick Mathewson2023-08-162-8/+8
|\ \ \ \ | |/ / / |/| | | | | | | | | | | tor-hsservice: Have IptEstablisher::new() return the status watch See merge request tpo/core/arti!1511
| * | | tor-hsservice: Have IptEstablisher::new() return the status watch (fmt)Ian Jackson2023-08-161-2/+1
| | | |
| * | | tor-hsservice: Have IptEstablisher::new() return the status watchIan Jackson2023-08-161-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The IPT manager is going to want to separate the IptEstablisher struct (which contains the Drop signal) from the watch receiver. We could add an accessor to clone the watch, but the copy in the IptEstablisher would be redundant. This makes new()'s signature a bit funky but it's an internal method so I think that's fine.
| * | | Apply some churn from rustfmt (beta)Ian Jackson2023-08-161-1/+1
|/ / /
* | | Merge branch 'upload-descriptor' into 'main'gabi-2502023-08-167-38/+120
|\ \ \ | | | | | | | | | | | | | | | | tor-dirclient: Add support for uploading descriptors. See merge request tpo/core/arti!1505
| * | | tor-dirclient: Fix clippy lints.Gabriela Moldovan2023-08-161-5/+5
| | | |
| * | | tor-dirclient: Remove unused `StringBody` trait.Gabriela Moldovan2023-08-162-27/+0
| | | |
| * | | tor-dirclient: Make Requestable return requests with String bodies.Gabriela Moldovan2023-08-164-53/+25
| | | | | | | | | | | | | | | | | | | | It's simpler to always use a `String` to represent directory request bodies. We no longer need the `StringBody` trait.
| * | | tor-dirclient: Rename StringBody::str() to StringBody::as_str().Gabriela Moldovan2023-08-162-6/+6
| | | |
| * | | tor-dirclient: Deprecate download() instead of removing it.Gabriela Moldovan2023-08-162-1/+18
| | | |
| * | | tor-dirclient: Extend format test to check the body is formatted too (fmt)Gabriela Moldovan2023-08-161-1/+4
| | | |
| * | | tor-dirclient: Extend format test to check the body is formatted too.Gabriela Moldovan2023-08-161-8/+22
| | | |
| * | | tor-dirclient: Move request building to a test helper function.Gabriela Moldovan2023-08-161-11/+13
| | | |
| * | | tor-dirclient: Add `HsDescUploadRequest`.Gabriela Moldovan2023-08-163-0/+50
| | | | | | | | | | | | | | | | | | | | The hsdir publisher will send the `HsDescUploadRequest`s to the appropriate directory using `send_request()`.
| * | | tor-dirclient: Make the body type of a `Requestable` type configurable.Gabriela Moldovan2023-08-164-4/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the `Requestable` trait assumed the body of the request would always be empty (`http::Request<()>`). This change replaces the hardcoded `()` body type with the `Requestable::Body` associated type (which will allow implementors to create requests with non-empty bodies). This will enable us to reuse the `Requestable` trait for building `POST` requests for uploading descriptors.
| * | | tor-dirclient: Rename download() to send_request() (fmt).Gabriela Moldovan2023-08-161-1/+5
| | | |