aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* chanmgr: report target address, not proxy address, in errorNick Mathewson2026-05-071-2/+4
| | | | | | Also, change the address type in the error to String for now. In reality we need a better representation of this error, but that shouldn't block this.
* chanmgr: refactor error typesNick Mathewson2026-05-071-18/+34
| | | | | Proxy belonged as a subcase of ChannelBuild. And ChannelBuild was only about making an initial connection.
* chanmgr: Do not turn connect errors into proxy errors.Nick Mathewson2026-05-071-1/+23
| | | | | | | This fixes the problem where we'd report all connect failures as proxy failures. Closes #2459.
* chanmgr: Safely log the peer in the channel builderDavid Goulet2026-03-031-3/+3
| | | | | | | | | On I/O error, we safely log the peer address that was used that lead to this error. Closes #2375 Signed-off-by: David Goulet <[email protected]>
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-3/+3
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-chanmgr: change `RequestCancelled` retry from `Never` to `Immediate`Steven Engler2024-11-211-1/+1
| | | | | | | If the channel request was cancelled, we should be able to retry immediately. Additionally, the `kind()` of `RequestCancelled` is `TransientFailure`, and I don't think it make sense for a transient error to return a `retry_time()` of `Never`.
* tor-chanmgr: Provide a variant for memquota errorsIan Jackson2024-10-031-0/+8
|
* tor-linkspec: add `ListByRelayIds`Steven Engler2024-09-231-0/+6
| | | | Like `ByRelayIds`, but allows multiple items per relay ID.
* Merge branch 'todos-chanmgr' into 'main'Nick Mathewson2022-11-291-1/+1
|\ | | | | | | | | chanmgr: resolve several remaining "TODO pt-client" issues See merge request tpo/core/arti!897
| * chanmgr: Distinguish failure to connect to proxy from other IO failuresNick Mathewson2022-11-291-1/+1
| |
* | Remove deprecated aliases in tor-linkspec.Nick Mathewson2022-11-291-2/+2
|/
* tor-chanmgr: Invent [Box]ChanSensitive for two error payloadsIan Jackson2022-11-231-2/+8
| | | | | | | | | | | This 1. Makes the errors smaller (in the case of Io's PtTargetAddr; ChannelBuild's addresses are already indirected in a Vec). 2. Redacts (currently, scrubs) the PtTargetAddr and SocketAddr when safe logging is enabled These are the remaining error variants in tor-chanmgr that contain information that should become sensitive as part of bridge support.
* tor-chanmgr: Replace OwnedChanTarget with LoggedChanTarget in errorsIan Jackson2022-11-231-5/+5
| | | | | | | | | This 1. Makes the errors smaller 2. Redacts (currently, scrubs) the chantarget when safe logging is enabled This commit doesn't treat other should-be-sensitive inforemation in errors just yet. That will come in a moment.
* Replace TransportRegistry with AbstractPtMgreta2022-11-221-0/+12
| | | | | | | | | | | | | | | | | | It doesn't make much sense to have the pluggable transport manager be a registry, so replace its interface with a more narrowly defined, less generic version. Other changes: - instead of returning a &-reference, it returns an owned Arc, which should make the ptmgr easier to implement while allowing efficient reuse - provision for error handling is added, but will probably be revised in a future commit pending discussion - tor-ptmgr code that would generate warnings as a result of this change is temporarily removed This is a split out version of arti!886, intended so work on arti#659 can proceed.
* chanmgr: Add the code necessary to use SOCKS PTs via a TransportHelperNick Mathewson2022-10-201-0/+10
| | | | | This is mostly a matter of encoding parameters in the format used for socks authentication.
* Fix various typos (using typos tool and hand-inspection)Nick Mathewson2022-10-181-2/+2
|
* chanmgr: Add an error case if a final_attempt neither succeeds or failsNick Mathewson2022-10-181-1/+9
| | | | | This can happen in weird corner cases, so it's probably best to report it rather than having an "internal error."
* chanmgr: replace the HashMap<> with a ByRelayIds.Nick Mathewson2022-10-181-2/+20
| | | | | | | | | | | | | | | | | | This is necessary so that we can look up channels (open and pending) by all of the Ids that we know about them. The operations needed here are pretty complex: to get them right, I've replaced most of the accessors on the inner `ChannelMap` with a function that holds the lock while another `FnOnce` is called. This still gets us the invariant that we can't accidentally await while holding the lock on the `ChannelMap`. I've removed the tests for the accessors that are no longer there. There are some subtleties here. Now that we have more than one kind of Id, it's possible to have a partial match. I've tried to explain all these cases in the comments. }
* chanmgr: clean up some TODO pt-client items and documentation.Nick Mathewson2022-10-131-4/+0
|
* Have ChannelBuilder use TransportHelper.Nick Mathewson2022-10-131-3/+3
| | | | | | This lets us build channels using different TransportHelpers, including the (new) default TransportHelper, which just uses the old connect_to_one() code.
* ChanMgr: new (unimplemented) APIs for pluggable transportsNick Mathewson2022-09-231-0/+13
|
* Final (?) API revisions for tor-linkspecNick Mathewson2022-08-101-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, each individual identity type becomes optional. The functions that expose them unconditionally are now in a "legacy" trait that only some downstream types are expected to implement. There are new convenience APIs in HasRelayIds: * to return Option<&keytype>, * to see if one identity-set contains another. This commit will break several downstream crates! For the reviewer's convenience, I will put the fixes for those crates into a series of squash! commits on this one. tor-netdir ---------- Revise tor-netdir to accept optional identities. This required some caveats and workarounds about the cases where we have to deal with a key type that the tor-netdir code does not currently recognize at all. If we start to add more identity types in the future, we may well want more internal indices in this code. tor-proto --------- In order to make tor-proto support optional identities, there were fewer changes than I thought. Some "check" functions needed to start looking at "all the ids we want" rather than at "the two known IDs"; they also needed to accommodate that case where we don't have an ID that we demand. This change will also help with bridges, since we want to be able to connect to a bridge without knowing all of its IDs up front. The protocol currently _requires_ the two current ID types in some places. To deal with that, I added a new `MissingId` error. I also removed a couple of unconditional identity accessors for chanmgr; code should use `target().identity(...)` instead. tor-chanmgr ----------- This is an incomplete conversion: it does not at all handle channel targets without Ed25519 identities yet. It still uses those identities to index its internal map from identity to channel; but it gives a new `MissingId` error type if it's given a channel target that doesn't have one. We'll want to revise the map type again down the road when we implement bridges, but I'd rather not step on the channel-padding work in progress right now. tor-guardmgr ------------ This change is mostly a matter of constructing owned identity types more sensibly, rather than unwrapping them directly. There are some places marked with TODOs where we still depend on particular identity types, because of how the directory protocol works. This will need revisiting when we add bridge support here. tor-circmgr ----------- These changes are just relatively simple API changes in the tests.
* ChanMgr: Add more contextual info to error types.Nick Mathewson2022-07-061-16/+23
| | | | | | Now each type has a peer. In some cases this peer is just an address, whereas in others (where key is relevant or address isn't yet narrowed down) it's a full OwnedChanTarget.
* Do not include error source() in display() format.Nick Mathewson2022-06-211-2/+2
| | | | | | | | | According to doc/Errors.md, and in keeping with current best practices, we should not include display an error's `source()` as part of that error's display method. Instead, we should let the caller decide to call source() and display that error in turn. Part of #323.
* chanmgr: bubble ClockSkew up through the Error object.Nick Mathewson2022-04-071-5/+41
| | | | | | | | Fortunately, we don't need a separate type here: authenticated clock skew can only come attached to a `tor_proto::Error`. We also remove skew from `tor_proto::Error::HandshakeCertsExpired`, since it would now be redundant.
* chanmgr: implement HasRetryTime.Nick Mathewson2022-04-041-0/+31
|
* Implement a basic form of RFC 8305 ("happy eyeballs") for channelseta2022-03-071-0/+9
| | | | | | | | | | | | This makes Arti usable in IPv6-only environments (arti#92) by letting us attempt multiple connections to a given relay using all of its addresses instead of just using the first (probably IPv4) one, using the strategy from RFC 8305 ยง 5. This isn't a complete implementation of Happy Eyeballs; ideally, we'd sort the address list before doing concurrent connections. However, it works (and has been tested inside an IPv6-only container inside eta's network :p)
* tor-proto: Split IoErr based on when it occursNick Mathewson2022-02-231-1/+1
| | | | | | | We want to distinguish handshake failures from errors later on in the channel's lifetime. Closes #359.
* Rename TorConnectionFailed to TorAccessFailedNick Mathewson2022-02-221-2/+2
|
* tor-chanmgr: use Bug types.Nick Mathewson2022-02-161-4/+4
|
* Implement HasKind for tor-chanmgr::ErrorNick Mathewson2022-02-161-2/+6
| | | | (There will be a folowup to work on internal errors here.)
* Make SpawnError wrappers contain a 'spawning' stringNick Mathewson2022-02-041-9/+18
| | | | | (By our convention, these errors should say what we were trying to spawn when the error occurred.)
* channel errors: Include what we were doingIan Jackson2022-02-041-5/+3
|
* errors: Add some TODOs as per discussion commentsIan Jackson2022-02-041-0/+5
|
* tor-chanmgr::Error: impl HasKindIan Jackson2022-02-041-0/+13
|
* tor-chanmgr: Handle IO errora in the new styleIan Jackson2022-02-041-9/+11
| | | | | Two ? in the tests become expects, which will do. That avoids having to construct a proper error with context here.
* spawn errors: Fix arti-client, tor-chanmgr, tor-circmgrIan Jackson2022-02-041-3/+9
| | | | | | | Provide an enum variant to contain the SpawnError and a From impl. We use `#[from]` here because it doesn't really make sense to attach any context, as it's not likely to be very relevant.
* tor-chanmgr: remove PendingChanError as unnecessary.Nick Mathewson2021-10-281-19/+0
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+76
This will cause some pain for now, but now is really the best time to do this kind of thing.