summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr
Commit message (Collapse)AuthorAgeFilesLines
* ChanMgr: errors: attribute errors to correct address.Nick Mathewson2022-07-061-3/+7
| | | | | | Even when keys are relevant, we still don't want to attribute errors to a set of addresses when we have a single address that we're connected with.
* ChanMgr: Add more contextual info to error types.Nick Mathewson2022-07-064-25/+41
| | | | | | 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.
* Bump crate and dependency versions.Nick Mathewson2022-06-241-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were done with the following commands: ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-error --bump patch cargo set-version -p tor-config --bump patch cargo set-version -p tor-units --bump patch cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-llcrypto --bump patch cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump patch cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump patch cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump patch cargo set-version -p tor-dirclient --bump patch cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump patch cargo set-version -p arti --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor ```
* clippy: Consolidate many lints in maint/add_warningIan Jackson2022-06-241-0/+3
| | | | | | Found these by disabling the nightly dbg macro special case. Now, we have a mechanism for globally adding suppressions to tests, we can use that instead.
* maint/add_warning: Add two lints via add_warning as a test caseIan Jackson2022-06-241-0/+2
|
* maint/add_warning: Add ability maintain test lint blocksIan Jackson2022-06-241-0/+3
|
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Merge branch 'display_source_cleanup' into 'main'eta2022-06-211-2/+2
|\ | | | | | | | | Do not include error source() in display() format. See merge request tpo/core/arti!598
| * 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.
* | tor-chanmgr: Change to use unwrap_voidIan Jackson2022-06-212-8/+5
| | | | | | | | | | As per discussion in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813573
* | channel padding: Rename ChannelsParams from ChannelsConfigIan Jackson2022-06-213-39/+39
| | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2814276 Change names and comments and docs everywhere.
* | channel padding: chanmgr: Clarify a commentIan Jackson2022-06-211-3/+3
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813574
* | channel padding: Use IntegerMilliseconds in netdirIan Jackson2022-06-211-12/+10
| |
* | channel padding: Use IntegerMilliseconds in padding::ParametersIan Jackson2022-06-212-10/+16
| |
* | channel padding parameters update: Drop a redundant cloneIan Jackson2022-06-211-1/+1
| |
* | Fix typoseta2022-06-211-2/+2
| |
* | channel padding: Test timeout updatesIan Jackson2022-06-212-1/+50
| |
* | tor-chanmgr tests: Add config_update tracking to FakeChannelIan Jackson2022-06-211-1/+7
| |
* | channel padding: Honour NetDir for timeoutsIan Jackson2022-06-211-3/+47
| | | | | | | | But padding is still not enabled by default.
* | channel padding: Plumb settings from chanmgrIan Jackson2022-06-215-14/+186
| |
* | chanmgr: inner (map): Reorganise to prepare for having more stateIan Jackson2022-06-211-14/+27
| | | | | | | | | | | | The main copy of the (global) configuration for the client's channels is going to have to live here, inside this mutex. So this really needs to become a struct with names fields.
* | tor-chanmgr: tests: Have unwrap_open return a (mut) referenceIan Jackson2022-06-211-2/+2
|/ | | | | This avoids confusing bugs where you try to modify the result and nothing happens!
* tor-proto: channel: Provide padding::TimerIan Jackson2022-06-081-0/+1
|
* Merge branch 'sleep' into 'main'Ian Jackson2022-06-081-1/+4
|\ | | | | | | | | Plumb a SleepProvider (now Clone + ....) into Channel See merge request tpo/core/arti!569
| * Plumb a SleepProvider into the channel reactorIan Jackson2022-06-081-1/+4
| | | | | | | | | | The channel reactor is going to want to be able to sleep so that it can do padding, so it needs a SleepProvider.
* | Upgrade float_eq dev-dependency to 1.0.0Nick Mathewson2022-06-071-1/+1
|/
* lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | From running add_warning, with manual picking of the right hunks/lines.
* lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* Lexically sort Cargo.toml dependenciesOrhun Parmaksız2022-05-281-9/+8
| | | | | | Utilize cargo-sort: https://github.com/DevinR528/cargo-sort Signed-off-by: Orhun Parmaksız <[email protected]>
* Regenerate version bump from previous commit.arti-v0.4.0Nick Mathewson2022-05-271-5/+5
| | | | | | | This commit was made by reverting the previous commit, then re-running the script I used to generate it. In theory there should be no semantic changes: only changes due to improved formatting from cargo edit.
* Semantic version changes for Arti 0.4.0 releaseNick Mathewson2022-05-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | I followed the following procedure to make these changes: * I used maint/changed_crates to find out which crates had changed since 0.3.0. * I used grep and maint/list_crates to sort those crates in topological (dependency) order. * I looked through semver_status to find which crates were listed as having semver-relevant changes (new APIs and breaking changes). * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no changes. For those crates, I incremented their patch-level version _without_ changing the version that other crates depend on. * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no obvious breaking changes. * I treated all crates that depend on `arti` and/or `arti-client` as having breaking changes. * I identified crates that depend on crates that have changed, even if they have not changed themselves, and identified them as having a non-breaking change. * For all of the crates, I used `cargo set-version -p $CRATE --bump $STATUS` (where `STATUS` is `patch` or `minor`) to update the versions, and the depended-upon versions.
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-9/+9
| | | | * Except for safelog and fs-mistrust, which are new.
* Upgrade to Postage 0.5.0Nick Mathewson2022-04-261-1/+1
|
* Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-11/+11
| | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* chanmgr: expose whether we are failing because of expired certs.Nick Mathewson2022-04-122-20/+87
|
* ChanMgr: Return provenance information from get_or_launchNick Mathewson2022-04-072-14/+31
| | | | | | We need this since we want to report certain conditions only when they happen on a new channel, not if we observe them on a preexisting channel.
* chanmgr: bubble ClockSkew up through the Error object.Nick Mathewson2022-04-073-9/+58
| | | | | | | | 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.
* Merge branch 'main' into 'retriable'Nick Mathewson2022-04-052-3/+98
|\ | | | | | | # Conflicts: # doc/semver_status.md
| * chanmgr: tests for ConnStatus::usableNick Mathewson2022-04-021-0/+5
| |
| * chanmgr: add a test for AbstractChannel::duration_unusedNick Mathewson2022-04-021-1/+9
| |
| * chanmgr: add tests for connect_one.Nick Mathewson2022-04-021-2/+84
| |
* | chanmgr: implement HasRetryTime.Nick Mathewson2022-04-041-0/+31
|/
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-9/+9
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-301-0/+41
| | | | | | | | | | | | | | | The various background daemon tasks that `arti-client` used to spawn are now handled inside their respective crates instead, with functions provided to spawn them that return `TaskHandle`s. This required introducing a new trait, `NetDirProvider`, which steals some functionality from the `DirProvider` trait to enable `tor-circmgr` to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it can't depend on `DirProvider` directly). While we're at it, we also make some of the tasks wait for events from the `NetDirProvider` instead of sleeping, slightly increasing efficiency.
* tor-proto: add a backend to detect reported clock skew.Nick Mathewson2022-03-231-1/+4
| | | | | | | | | | | | | | | | NETINFO cells, which are sent in every handshake, may contain timestamps. This patch adds an accessor for the timestamp in the Netinfo messages, and teaches the tor-proto code how to compute the minimum clock skew in the code. The computation isn't terribly precise, but it doesn't need to be: Tor should work fine if your clock is accurate to within a few hours. This patch also notes a Y2038 problem in the protocol: see torspec#80. Part of #405.
* Merge branch 'ticket_383' into 'main'Ian Jackson2022-03-091-5/+5
|\ | | | | | | | | | | | | tor-chanmgr: Do not allocate an Internal error unless we mean it. Closes #383 See merge request tpo/core/arti!394
| * tor-chanmgr: Do not allocate an Internal error unless we mean it.Nick Mathewson2022-03-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Previously we'd allocate an error as a place-holder here, but it's not a great idea to do that with a `Bug`: each `Bug` stores a whole stack trace, which uses a whole pile of allocations to construct. Now we keep an `Option<Error>` instead. Found while heap profiling. Closes #383.
* | Merge branch 'moderately-enthused-eyeballs' into 'main'eta2022-03-072-21/+84
|\ \ | |/ |/| | | | | Implement a basic form of RFC 8305 ("happy eyeballs") for channels See merge request tpo/core/arti!382