summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr
Commit message (Collapse)AuthorAgeFilesLines
* Bump minor version of tor-rtcompat and most of its dependentsNick Mathewson2022-10-031-5/+5
| | | | | | | (Since the APIs for the `Schedule::sleep*` functions changed, this is a breaking change in tor-rtcompat. Therefore, the Runtime trait in tor-rtcompat is now a different trait. Therefore, anything that uses the Runtime trait in its APIs has also broken.)
* Bump crates that have had backward compatible API changes.Nick Mathewson2022-10-031-4/+4
|
* Mark all bridge and pt features as experimental for now.Nick Mathewson2022-09-291-0/+2
| | | | | | Also, document the features. Closes #588.
* Add the necessary APIs for bridge-based circuit construction.Nick Mathewson2022-09-261-0/+10
|
* GuardMgr/DirMgr: Add APIs for bridge descriptor listsNick Mathewson2022-09-264-3/+114
|
* GuardMgr: Add TODOs for bridge support.Nick Mathewson2022-09-262-0/+29
| | | | | | This covers only the most basic notions of working with bridges: that we need a separate set of guards, and that they have to come from the list of known bridges.
* A basic configuration type for a bridge.Nick Mathewson2022-09-265-1/+66
| | | | | | | This type goes in tor-guardmgr, since that's where decisions about circuits' first hops are made. There are a lot of "todo"s here for us to resolve.
* Remove semver.md from arti-1.0.0Nick Mathewson2022-09-071-6/+0
|
* Bump crate versions in preparation for Arti 1.0.0 release.Nick Mathewson2022-09-011-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we want to work more on ensuring that our semver stability story is solid, we are _not_ bumping arti-client to 1.0.0 right now. Here are the bumps we _are_ doing. Crates with "minor" bumps have had API breaks; crates with "patch" bumps have had new APIs added. Note that `tor-congestion` is not bumped here: it's a new crate, and hasn't been published before. ``` tor-basic-utils minor fs-mistrust minor tor-config minor tor-rtcompat minor tor-rtmock minor tor-llcrypto patch tor-bytes patch tor-linkspec minor tor-cell minor tor-proto minor tor-netdoc patch tor-netdir minor tor-persist patch tor-chanmgr minor tor-guardmgr minor tor-circmgr minor tor-dirmgr minor arti-client minor arti-hyper minor arti major arti-bench minor arti-testing minor ```
* Downgrade "guard set loaded" messagesNick Mathewson2022-08-251-1/+1
| | | | These aren't interesting to the user.
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-242-0/+4
|
* Merge branch 'main' into 'linkspec_refactor_v3'Nick Mathewson2022-08-102-1/+1
|\ | | | | | | # Conflicts: # crates/tor-netdir/semver.md
| * Merge branch 'inc-rename' into 'main'Ian Jackson2022-08-022-1/+1
| |\ | | | | | | | | | | | | | | | | | | Rename `.inc` and other included files to end in `.rs` Closes #381 See merge request tpo/core/arti!645
| | * Rename `.inc` and other included files to end in `.rs`eta2022-07-262-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to mitigate syntax highlighting issues and a rust-analyzer bug (https://github.com/rust-analyzer/rust-analyzer/issues/10178), rename files that are included with the `include!` macro to have a `.rs` extension. Make sure the included files are outside `src/`, in order to not confuse humans and automated editing tools that might mistake them for valid Rust modules. fixes arti#381
* | | Make sure all HasRelayIds constaints allow ?Sized.Nick Mathewson2022-08-102-16/+25
| | |
* | | tor-netdir: Collapse by_id and by_relay_id into a single fn.Nick Mathewson2022-08-101-1/+2
| | | | | | | | | | | | | | | | | | There are some downstream changes required for this to work, but they are all just unit tests that could no longer infer the type of an Ed25519 key.
* | | Final (?) API revisions for tor-linkspecNick Mathewson2022-08-106-60/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Introduce a RelayIdSet and use it in place of HashSet<RelayId>.Nick Mathewson2022-08-103-11/+7
| | | | | | | | | | | | | | | This makes lookups a little more efficient. I do with that HashSet just supported this use-case, but for now this seems our best option.
* | | Teach guard restrictions about RelayId.Nick Mathewson2022-08-102-14/+26
| | | | | | | | | | | | | | | This implementation is (sadly) too copy-heavy or now, because HashSet<RelayId> can't be indexed with RelayIdRef.
* | | Use accessors in two places where tests look at specific keys.Nick Mathewson2022-08-101-3/+4
| | | | | | | | | | | | | | | | | | (It's safe to require these specific keys, since we constructed the objects for testing, and we know for certain that they contain given keys.)
* | | guardmgr: Avoid a case of using HasRelayIds key methods.Nick Mathewson2022-08-021-1/+1
| | |
* | | netdir: Add and use a new ids_listed() function.Nick Mathewson2022-08-021-1/+1
| | |
* | | Introduce HasRelayIds::same_relay_ids.Nick Mathewson2022-08-021-5/+3
| | | | | | | | | | | | | | | This method tells if two HasRelayIds contain exactly the same set of Relay identities, and is generally useful for debugging.
* | | guardmgr: Change APIs that used to take IDs.Nick Mathewson2022-08-022-14/+11
| | | | | | | | | | | | These are the other inspiration for #428.
* | | guardmgr: Replace IdPair with RelayIdsNick Mathewson2022-08-024-30/+31
| | | | | | | | | | | | I believe that this was the original motivation behind #428.
* | | tor-linkspec: Refactor out traits to represent a relay's ID set.Nick Mathewson2022-08-024-8/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | We want the set of identities supported by a relay to be extensible in the future with minimal fuss; we'd also like to make working with these ID sets more convenient. To handle that, this commit adds a new trait for "Something that has the same IDs as a relay" and a new object for "an owned representation of a relay's IDs." This commit introduces a similar trait for "Something with a list of SocketAddr, like a relay has." There's no owned equivelent for that, since Vec<SocketAddr> is already a thing. Closes #428.
* | Now that versions have bumped, remove semver.md files.Nick Mathewson2022-08-011-1/+0
| |
* | Bump patch versions on crates that have new APIs.Nick Mathewson2022-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do _not_ bump the dependency versions on crates that have had no changes since arti 0.0.5, since those crates do not depend on the new APIs. ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p tor-llcrypto --bump patch git restore crates/tor-checkable git restore crates/tor-consdiff git restore crates/tor-rtmock ```
* | Bump minor version on crates with deps with breaking changes.Nick Mathewson2022-08-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs the transitive closure of the last operation: everything that depends on a crate with a breaking change gets the version which it depends on bumped. ``` cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor cargo set-version -p tor-config --bump minor ```
* | Bump minor versions on all crates that have had breaking changes.Nick Mathewson2022-08-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with these commands: ``` cargo set-version -p fs-mistrust --bump minor 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-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti --bump minor ```
* | fix runtime issues on iostrinity-1686a2022-07-301-4/+4
|/
* GuardMgr: Update to use new NetDirProvider API.Nick Mathewson2022-07-262-4/+4
|
* Note semver break in tor-guardmgr::Error.Nick Mathewson2022-07-071-0/+1
|
* Remove now-unused NoGuardsUsable case.Nick Mathewson2022-07-071-8/+2
|
* Improve message for failure to select a guard.Nick Mathewson2022-07-072-19/+48
| | | | This uses similar techniques to the commit I just did for Fallbacks.
* Add more information to failed-to-select fallback errors.Nick Mathewson2022-07-072-5/+22
| | | | Also re-order the filters to be a little more logical.
* GuardMgr: tweak an error message.Nick Mathewson2022-07-061-1/+1
|
* Remove semver.md files now that 0.5.0 is outNick Mathewson2022-06-241-2/+0
|
* Bump crate and dependency versions.Nick Mathewson2022-06-241-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Merge branch 'clippy' into 'main'Ian Jackson2022-06-242-0/+11
|\ | | | | | | | | Fix clippy nightly again See merge request tpo/core/arti!603
| * clippy: Consolidate many lints in maint/add_warningIan Jackson2022-06-241-0/+8
| | | | | | | | | | | | 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.
| * Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | | | | | Update all lint blocks
* | Update README.md files from rustdoc.Nick Mathewson2022-06-241-3/+0
|/
* Merge branch 'reachable_addrs_v2' into 'main'Nick Mathewson2022-06-177-147/+379
|\ | | | | | | | | | | | | Implement support for reachable_addrs Closes #491 and #93 See merge request tpo/core/arti!583
| * Rename guardset-selection function.Nick Mathewson2022-06-171-2/+7
| | | | | | | | Also, improve its documentation.
| * Rename pick_guard, pick_guard_ext.Nick Mathewson2022-06-172-17/+29
| | | | | | | | | | | | Now the primary exposed function is `pick_guard` again. This commit is just function renaming.
| * Refactor and document issues with modify_hop.Nick Mathewson2022-06-173-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | At the site of modify_hop, we now have a comment explaining the internal-error issue. To make the internal error less likely, we lower the modify_hop call in lib.rs into GuardSet, where it can make sure it's looking at the same filter as was used to select the guard. The function name "pick_guard_ext" is not permanent; I'm going to rename it in the next commit.
| * API-fix for extend_sample_as_needed.Nick Mathewson2022-06-172-19/+20
| | | | | | | | | | | | | | | | | | Previously, the API said "you need to call this in a loop till it returns false". We did that in one place, but not another. With the introduction of filters, forgetting to loop here becomes a bug: so instead, change the behavior of extend_sample_as_needed so it handles looping itself.
| * Remove some outdated comments.Nick Mathewson2022-06-173-18/+0
| | | | | | | | | | These all say, in one form or another, "there is no guard filtering; there is only one selection". That's now false.
| * Tweak parameters in guardmgr tests to improve testnet behavior.Nick Mathewson2022-06-171-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The fake network we construct for these tests is small in ways that can sometimes cause weird behavior with guard filters. We fix this by adjusting the parameters of the guard selection algorithm accordingly in the tests. With these new parameters, #491 no longer occurs. This commit also adds comments to explain why the parameters are set as they are. Closes #491.