summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* | struct BridgeConfig: Rename from BridgeIan Jackson2022-10-123-17/+17
| | | | | | | | Fixes #599
* | struct Bridge: add ref to ticketIan Jackson2022-10-121-1/+1
|/
* tor-guardmgr: Export BridgeParseError from toplevelIan Jackson2022-10-121-1/+1
| | | | | Callers could `use` it as `tor_guardmgr::config::BridgeParseError` but it seems unecessary to force them to.
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-122-0/+2
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-112-8/+14
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* tor-guardmgr: Fix build without pt-client featureIan Jackson2022-10-111-1/+3
|
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-061-1/+7
| | | | These are now builders.
* Begin revising HasAddr and its relationship to ChanTargetNick Mathewson2022-10-064-1/+21
| | | | | | | | | | | | | | | | | | | HasAddr used to mean "Here are addresses that I have, at which I can be contacted." But "Where (and how) can I be contacted?" is now a question for HasChannelMethod to answer. (We still need to have "HasAddr", though, so we can answer things like "what country is this relay in" and "are these relays in the same /8?") So this commit introduces: * A new trait for adding an implementation of HasChannelMethod in terms of HasAddr. * A requirement on ChanTarget that it needs to implement HasChannelMethod. There is some temporary breakage here, marked with "TODO pt-client", that I'll fix later in this branch.
* Merge branch 'bridge_containers' into 'main'Nick Mathewson2022-10-065-61/+168
|\ | | | | | | | | Start implementing more data structures to hold Bridge descriptors. See merge request tpo/core/arti!755
| * Extend some comments about bridge descriptorsNick Mathewson2022-10-062-2/+11
| |
| * Add a temporary HasAddrs for BridgeRelayNick Mathewson2022-10-041-1/+10
| | | | | | | | See comment for an explanation of the next issue here.
| * BridgeRelay: Implement more traits.Nick Mathewson2022-10-042-2/+58
| | | | | | | | | | | | Also add a BridgeRelayWithDesc type (name tbd) to guarantee that a bridge relay really does have a known descriptor before you try to build a circuit with it.
| * Start on a new BridgeRelay type.Nick Mathewson2022-10-042-1/+41
| | | | | | | | | | | | | | | | This is the one we'll actually use to connect to bridges. It has a `Bridge` line, and an optional `BridgeDesc`. Maybe this will turn into a `BridgeRelay<'a>` by analogy to `Relay` some time; I'm not sure.
| * Implement HasRelayIds for Bridge.Nick Mathewson2022-10-041-1/+11
| |
| * Implement BridgeDesc and BridgeDescList.Nick Mathewson2022-10-041-58/+41
| | | | | | | | | | | | | | | | | | | | BridgeDesc is a separate type to make sure that we do not confuse bridges' descriptors with the descriptors from other routers down the road. (Bridges' descriptors need to be used differently, and treated as more private.) With this code, BridgerDescList is now just an alias for `ByRelayIds<BridgeDesc>`, which is pretty keen.
* | Temporarily suppress a false positive from nightly.Nick Mathewson2022-10-041-0/+5
|/ | | | | | Nightly rust gives a warning about this "pub use", but the warning is a false positive. Since it doesn't seem to be going away in a hurry, let's suppress it for now.
* Merge branch 'bridge-parse' into 'main'Ian Jackson2022-10-032-2/+516
|\ | | | | | | | | Parse (and format) bridge lines See merge request tpo/core/arti!745
| * pt: bridge line parsing: overhaul errorsIan Jackson2022-10-031-36/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | Include the offending word in all the applicable errors. Always print it with {word:?}. As a consequence, there are no From impls any more and error generation/conversion is by hand in all cases. Clarify InvalidPtOrAddr vs InvalidIAddrorPt, and don't make the attempted parse be a source error for those. Where we still have source errors, don't print them in Display.
| * pt: Check PT key=value syntaxIan Jackson2022-10-031-3/+0
| | | | | | | | | | This is not perfect but it at least ensures that our own parsing and printing code works correctly with all the values we accept.
| * pt: Make PtTarget::push_setting fallible, and take IntoIan Jackson2022-10-031-3/+8
| | | | | | | | | | | | It has its own error type PtTargetInvalidSetting. In check_doc_features, adjust suppression to new code.
| * pt: bridge line parsing: Add commentaryIan Jackson2022-10-031-0/+26
| |
| * pt: Document Bridge line syntaxIan Jackson2022-10-031-0/+31
| |
| * pt: bridge parsing: Add an IPv6 test caseIan Jackson2022-09-301-0/+12
| |
| * pt: impl Display for Bridge and test itIan Jackson2022-09-301-0/+43
| |
| * implement FromStr for Bridge, and test itIan Jackson2022-09-301-0/+327
| |
| * tor-guardmgr: Introduce pt-client featureIan Jackson2022-09-301-1/+3
| | | | | | | | | | guardmgr needs to know how to parse Bridge lines into Bridge structs so it needs to know about PTs specifically
| * pt: Make some more types EqIan Jackson2022-09-301-1/+1
| | | | | | | | I wanted this for testing. I think it's reasonable to promise this.
* | Remove semver.md files now that arti 1.0.1 is out.Nick Mathewson2022-10-031-2/+0
| |
* | 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
| | |