Commit Graph

2848 Commits

Author SHA1 Message Date
Ian Jackson f4ec3e6cec tor-guardmgr: descs: Make BridgeDescError into a trait 2022-10-21 16:22:13 +01:00
Ian Jackson 77ddddb1f8 tor-error: make HasRetryTime object-safe
We could in the future provide a version of abs_retry_time which took
an &dyn closure if that turns out to be wanted.

I think this isn't a semver break because trait implementors are
allowed to relax bounds.
2022-10-21 16:08:48 +01:00
Ian Jackson a30e42a740 tor-circmgr: Make get_or_launch_dir_specific feature-specific 2022-10-21 15:19:18 +01:00
Ian Jackson 6806180ce1 tor-circmgr: Rename get_or_launch_dir_specific from _bridge
DirSpecificTarget in the usage was renamed apropos an MR comment but
this function name was overlooked.
2022-10-21 15:19:18 +01:00
Ian Jackson 2ccf8a1b5b tor-chanmgr: Suppress an unused imports warning for `use super::*`
If pt-client is disabled, there are in fact no tests, so the module is
empty.  But we would always want `use super::*` here.
2022-10-21 15:19:05 +01:00
Ian Jackson aa3cd7a97c tor-circmgr README: Add experimental features boilerplate 2022-10-21 15:18:41 +01:00
Ian Jackson ea7f31b357 tor-circmgr README: Remove "Limitations"
This doesn't make sense now we've released Arti 1.0.  The version
number is enough I think.
2022-10-21 15:18:41 +01:00
Ian Jackson f68591b923 tor-dirmgr README: Remove some redundant/duplicated headings 2022-10-21 15:18:41 +01:00
Nick Mathewson fa1d2f453a guardmgr: Hold FallbackDir in fallback::set::Entry
This resolves an old TODO, and will simplify our work a little.
2022-10-21 09:21:43 -04:00
Nick Mathewson 00f887db70 linkspec: Add compare-by-relay-ids function to HasRelayIds 2022-10-21 09:21:43 -04:00
Nick Mathewson 19fdf196d8 guardmgr: Add bridges sample, encode sample ID in FirstHopId.
The most important part of this commit is to make sure that each
`FirstHopId` includes the `GuardSetSelector` from which the guard
was selected.  Doing this lets us be certain that when we report
that a guard has succeeded or failed, we're reporting it in the
right context.

Additionally, this commit uses strum to make an iterator over the
samples, so that we can make sure that our "for each sample" code is
robust against future changes, and we don't miss the bridge sample.
2022-10-21 09:21:43 -04:00
Nick Mathewson fe6ac2d9ed Merge branch 'whoops_unused_imports' into 'main'
Oops: Mark some imports as pt-client only.

See merge request tpo/core/arti!794
2022-10-21 13:15:22 +00:00
Nick Mathewson e0c1928ea0 Merge branch 'matrix-features' into 'main'
add checks for many feature combinations

Closes #303

See merge request tpo/core/arti!775
2022-10-21 12:57:36 +00:00
Nick Mathewson 1e4b1f6433 Oops: Mark some imports as pt-client only.
This causes CI problems, and is entirely my fault.
2022-10-21 08:32:02 -04:00
Nick Mathewson a12667e077 Merge branch 'no_redundant_allocation' into 'main'
tor-cell: Avoid redundant allocation

See merge request tpo/core/arti!790
2022-10-21 12:18:49 +00:00
Emil Engler 169ed860c2
tor-cell: Avoid redundant pointer copy
This commit changes an iteration by copying a u16 (which is 2 bytes)
instead of a pointer address, which is most likely 8 bytes on most
machines.
2022-10-21 13:26:00 +02:00
Emil Engler c489e1d911
tor-cell: Avoid redundant allocation
This commit changes the way how a vector with a known sized gets
allocated, by using Vec::with_capacity() instead of Vec::new().
It will eventually avoid an allocation of more memory than required.
2022-10-21 13:25:26 +02:00
Emil Engler e5429a2891
tor-cell: Rename for_client and for_relay
This commit renames the for_client and for_relay functions to
from_client and from_relay respectively, in order to indicate their
origin, as the term "for" is more likely to indicate a destination,
which is not true in that situation.
2022-10-21 13:21:52 +02:00
Emil Engler 17759799f1
tor-cell: Remove redundant match clauses
This commit removes two redundant match clauses inside the
take_one_netinfo_addr function found inside msg.rs.
2022-10-21 13:17:43 +02:00
Emil Engler f423721cc3
tor-cell: Rename fixed_len to fixed_len_handshake
This commit renames the fixed_len! macro to fixed_len_handshake!, in
order to indicate, that this macro is only suited for cells with
commands related to handshaking.
2022-10-21 13:14:50 +02:00
Emil Engler 247cc37290
tor-cell: Fix typos in msg.rs 2022-10-21 13:10:30 +02:00
Emil Engler 7e04de6d96
tor-cell: Make historical comments more concrete
This commit extends comments that make references to historical protocol
versions of Tor, by adding the concrete protocol version numbers.
2022-10-21 12:59:26 +02:00
Ian Jackson db2ce541fb Merge branch 'dirclient-errors' into 'main'
Make DirResponse API not an error handling footgun

See merge request tpo/core/arti!782
2022-10-20 17:30:01 +00:00
Nick Mathewson f23adcd4c8 Merge branch 'pt-serde' into 'main'
serde support for PtTarget

See merge request tpo/core/arti!780
2022-10-20 17:13:19 +00:00
Nick Mathewson 608153cd93 Merge branch 'connect-via-proxy' into 'main'
Implement a TransportHelper to connect via a SOCKS-based pluggable transport

See merge request tpo/core/arti!776
2022-10-20 16:44:58 +00:00
Nick Mathewson 34aa352d16 Implement serde for PtTarget and its members.
This will let us remember bridges that use pluggable transports.
2022-10-20 12:37:41 -04:00
Nick Mathewson bc09a3fe65 Inline now-needless variant constructors for PtTargetAddr 2022-10-20 12:37:41 -04:00
Nick Mathewson 95b03dc96f Remove a now-needless `allow(dead_code)` 2022-10-20 12:37:41 -04:00
Nick Mathewson d8f9a79c4f linkspec: Always expose PT-related types.
The `PtTarget` type and its contents (`TransportName`,
`PtTargetAddr`, `PtSettings`) are now unconditionally compiled and
exposed.  This will allow us to serialize and deserialize them in
our guard-state files even when we have been built without explicit
PT support.

The `pt-client` feature controls whether `TransportName` is a
variant of `TransportId`, and whether `PtTarget` is a variant of
`ChanMethod`: this in turn means that we'll still have simpler
binary code and smaller structures when we're building without PT
support (which is what we wanted when we initially made these types
conditional).
2022-10-20 12:37:40 -04:00
Ian Jackson 7b2a0fbcb1 tor-dirclient: Provide fallible DirResponse::output and into_output 2022-10-20 17:24:53 +01:00
Ian Jackson da3351ad49 tor-dirclient: Make DirResponse be Clone
I want this for testing.  It seems friendly to provide it, though.
2022-10-20 17:24:53 +01:00
Ian Jackson b3675c76dc tor-dirclient: Introduce RequestError:HttpStatus 2022-10-20 17:24:53 +01:00
Ian Jackson e8d662ed7c tor-dirclient: Make RequestFailed its own error type (rustfmt)
Split off to assist review.
2022-10-20 17:24:53 +01:00
Ian Jackson d9375b2b8d tor-dirclient: Make RequestFailed its own error type
We're going to have functions on Response that fail by returning only
one of these.

Sadly this diff is quite noisy.
2022-10-20 17:24:53 +01:00
Ian Jackson 3b1af05851 tor-dirclient Response: Rename output methods
These don't check errors and are therefore quite hazardous.
I'm going to introduce a more cooked version in a moment.
2022-10-20 17:24:50 +01:00
Ian Jackson 803131c1ea Merge branch 'bridge-internal-apis' into 'main'
Use BridgeConfig to identify bridges in two places

See merge request tpo/core/arti!781
2022-10-20 16:14:14 +00:00
Ian Jackson 9c7ea41322 impl ChanTarget etc. for BridgeConfig 2022-10-20 14:16:34 +01:00
Ian Jackson 6193bed788 impl HasAddrs for PtChannelAddr and ChannelMethod 2022-10-20 14:16:34 +01:00
Ian Jackson c93500e14c tor-linkspec: impl From<&ChanTarget> for OwnedChanTarget
This lets us write functions which can either take an existing
owned OwnedChanTarget, or copy out of some other kind of ChanTarget
passed by reference.
2022-10-20 13:29:07 +01:00
Ian Jackson ef5e60c879 circmgr: Plumbing for direct to target directory circuits
The target is identified by Into<OwnedChanTarget>.
We introduce corresponding TargetCircUsage and SupportedCircUsage.
2022-10-20 13:28:30 +01:00
Ian Jackson 11c61a3d7f bridge descriptors: Change types of the descriptor cache
Now keyed by Arc<BridgeConfig>, and the values can be errors.

Currently there is no implementation so there can't be any errors,
but the error enum will become nonempty.
2022-10-20 13:28:23 +01:00
Nick Mathewson 05913f9720 transport: Escape = signs in keys only.
This is a compromise between C tor (never escapes = signs) and the
spec (calls for escaping all = signs).  In C tor there is no way to
actually construct a key with an = sign in it, so this difference
should be undetectable.
2022-10-20 08:11:05 -04:00
Nick Mathewson 40b9b57884 Clarify comment on ExternalProxyPlugin. 2022-10-20 08:11:05 -04:00
Nick Mathewson 27f53f241d transport: rename "ExtraneousData" to "UnexpectedData" 2022-10-20 08:11:05 -04:00
Nick Mathewson f39157f8c3 chanmgr: Add the code necessary to use SOCKS PTs via a TransportHelper
This is mostly a matter of encoding parameters in the format used
for socks authentication.
2022-10-20 08:11:00 -04:00
Nick Mathewson 50b65b217d chanmgr: Begin a socks-client implementation.
This code is _not_ conditional, since we want to support running
with a proxy even if we don't support pluggable transports.

We may eventually want to refactor this into a new create.
2022-10-20 08:09:18 -04:00
Nick Mathewson dcf27f2457 socksproto: Make a method conditional. 2022-10-20 08:09:18 -04:00
Nick Mathewson d1e70d9479 socksproto: impl Clone for Error. 2022-10-20 08:09:18 -04:00
Ian Jackson a5eba71edd HasAddrs: Make it clear that the set of addresses can be empty
Eg, a PT bridge may not have an address.
2022-10-20 12:47:50 +01:00
Nick Mathewson 2845ee24bf fix a couple of spelling errors in guardmgr 2022-10-19 07:49:39 -04:00
Nick Mathewson 5786637b4f Fix various typos (using typos tool and hand-inspection) 2022-10-18 15:39:33 -04:00
Nick Mathewson 3975d0db7e linkspec: Fix typo in error messages. 2022-10-18 15:01:54 -04:00
Nick Mathewson 06132d9f35 chanmgr: Add an error case if a final_attempt neither succeeds or fails
This can happen in weird corner cases, so it's probably best to
report it rather than having an "internal error."
2022-10-18 11:49:21 -04:00
Nick Mathewson 4b0c28014d Refactor flow control in get_or_launch.
Now, instead of duplicate checks in various cases, we simply go
through the loop one last time.

This allows us to simplify some of our other logic around here.
2022-10-18 11:49:21 -04:00
Nick Mathewson e0bd6111a8 chanmgr: Split get_or_launch into sub-functions.
This function had grown huge and hard to reason about.  Before I
make it even worse, let's split it up.
2022-10-18 11:49:21 -04:00
Nick Mathewson 710be8d4c6 chanmgr: Refactor choose_action code into its own function. 2022-10-18 11:49:21 -04:00
Nick Mathewson 8f4ff7014a Clarify a comment about the desired structure of ChanMgr 2022-10-18 11:49:21 -04:00
Nick Mathewson c0bca7213c Comments to explain effects of return in closure. 2022-10-18 11:49:21 -04:00
Nick Mathewson c802d39b80 chanmgr: Remove "Ident" from AbstractChannel
Thanks to our previous changes, we no longer need this type, or the
methods that access it.
2022-10-18 11:49:21 -04:00
Nick Mathewson c78bacce86 chanmgr: replace the HashMap<> with a ByRelayIds.
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.
}
2022-10-18 11:49:21 -04:00
Nick Mathewson 61a33da0ff proto: Make Channel::reparameterize take &self.
Even though channels are practically changeable, they use locks
internally so that you don't need a `&mut Channel` to send or
receive traffic.  It makes sense for reparameterizing the channel to
also use a &self reference.

I'll need this so that I can store channels in an `ByRelayIds<>`
set, and still invoke their reparameterize methods.
2022-10-18 11:49:21 -04:00
Nick Mathewson 735100455d chanmgr: Add identities to pending state in map.
This will let us migrate from `HashMap<Ed25519Identity, Entry>` to
`ByRelayIds<Entry>`.
2022-10-18 11:49:21 -04:00
Nick Mathewson e51fdbfb1b chanmgr: Require HasRelayIds for AbstractChannel::BuildSpec
This is mostly a testing only change for now too, but soon I'll use
it to deal with the fact that we need to know the IDs to actually
build a channel at all.
2022-10-18 11:49:21 -04:00
Nick Mathewson 71db8ebc2e chanmgr: Require HasRelayIds for AbstractChannel.
This is mostly a testing-only change for now, but soon I'll use it
so we can have IdMap for our channel map.
2022-10-18 11:49:21 -04:00
Nick Mathewson e94cff26e2 chanmgr: Remove the Poisoned state from the map type.
The `ByRelayIds` type doesn't have a type equivalent to
`hash_map::Entry`, since it's a set type rather than a map
type. Therefore, the only plausible way to do entry mutation will
be to remove the old entry and insert a new one.  And so, we no
longer need a "poisoned" state.
2022-10-18 11:49:21 -04:00
Nick Mathewson 96493f427d proto: Implement HasRelayIds for Channel. 2022-10-18 11:49:21 -04:00
Nick Mathewson a46e8af605 linkspec: Add ByRelayIds::remove_exact.
We need a function to remove an entry if it appears with _exactly_
the same relay Ids, but not otherwise.  This method will do that.
2022-10-18 11:49:21 -04:00
Nick Mathewson 0c8a5a1fa4 linkspec: Add an "all_overlapping" accessor to ByRelayIds.
Also, add a few tests for this and the other accessors.

We'll need this accessor to find whether we have any channels to
_any_ of the identities that we're trying to connect to.
2022-10-18 11:49:21 -04:00
trinity-1686a 3200870079 fix doc-feature synchro 2022-10-16 21:02:10 +02:00
trinity-1686a 53016a005b add test for many features
and fix issue compiling tor-rtcompat with on ssl runtime
2022-10-16 21:02:10 +02:00
Nick Mathewson 522907ac9a Write more tests for RelayId and RelayIdRef. 2022-10-15 10:38:08 -04:00
Nick Mathewson 8e2ce9de1d Write tests for RelayIdSet. 2022-10-15 10:06:02 -04:00
Nick Mathewson ae07909a02 Fix deserialize impl for RelayId.
We need to handle String, not just str, since some deserializers
have to handle escapes and generate new strings.

Found while writing tests; fixes #605.
2022-10-15 10:04:37 -04:00
Nick Mathewson ddc5b63a19 linkspec: impl Hash for RelayIdRef 2022-10-15 09:57:45 -04:00
Nick Mathewson 31528202c5 chanmgr: Edit comments, fix docs 2022-10-13 10:32:02 -04:00
Nick Mathewson 913d5b68ec chanmgr: Remove RegistryAsFactory.
Since there is no longer a blanket implementation of ChannelFactory
for TransportHelper, we no longer need a separate type here.
2022-10-13 10:15:05 -04:00
Nick Mathewson fe2d44d10a ChanMgr: Reorganize factory, builder, transport code.
There is no actual code change here: just movement.
2022-10-13 10:09:52 -04:00
Nick Mathewson 8f267ba166 Fix some rustdoc errors.
In addition to the usual "You named that method wrong!" errors, we
have a new rustdoc error that complains about bogus "HTML tags" that
are actually unquoted usage of types like `Result<Foo>`.
2022-10-13 09:08:46 -04:00
Nick Mathewson 85284ef847 Merge branch 'factory_redux' into 'main'
chanmgr: Build and use chanmgr factory APIs

See merge request tpo/core/arti!769
2022-10-13 12:58:28 +00:00
Nick Mathewson 7b58126706 Flatten TimeoutChannelFactory into ChannelBuilder. 2022-10-13 08:36:05 -04:00
Nick Mathewson 69b64a2795 chanmgr: clean up some TODO pt-client items and documentation. 2022-10-13 08:36:05 -04:00
Nick Mathewson d759489530 Allow multiple ChannelBuilders to share a ChanMgrEventSender. 2022-10-13 08:36:05 -04:00
Nick Mathewson 6b587b25e1 chanmgr: Use ChannelFactory via a Box<dyn<ChannelFactory>>.
This will prepare for supporting multiple different ChannelFactory
implementations.
2022-10-13 08:36:05 -04:00
Nick Mathewson 15108be5ce chanmgr: Move Timeout functionality into a decorator object. 2022-10-13 08:36:05 -04:00
Nick Mathewson e21ac24c77 Have ChannelBuilder use TransportHelper.
This lets us build channels using different TransportHelpers,
including the (new) default TransportHelper, which just uses the old
connect_to_one() code.
2022-10-13 08:36:05 -04:00
Nick Mathewson b4cc98b21b Merge branch 'readmes' into 'main'
Abolish maint/readme and use doc include

Closes #603

See merge request tpo/core/arti!768
2022-10-12 15:16:18 +00:00
Ian Jackson f84d8777db cargo fmt to remove blank lines
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.

This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00
Ian Jackson d9910dba08 Replace all README copies in src/lib.rs with includes
The feature we want is `#[doc = include_str!("README.md")]`, which is
stable since 1.54 and our MSRV is now 1.56.

This commit is precisely the result of the following Perl rune:
  perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
2022-10-12 15:29:03 +01:00
Ian Jackson 13654d7cd2 README doctests: fix tor-rtmock 2022-10-12 15:27:14 +01:00
Ian Jackson af07e17b45 README doctests: fix safelog
Add some dummy definitions that support the example.
2022-10-12 15:27:02 +01:00
Ian Jackson 99f4511f1e README doctests: fix fs-mistrust
Add fn main wrappers to allow use of ?.

Add ,no-run to test cases that fail due to accessing the filesystem.
2022-10-12 15:26:52 +01:00
Ian Jackson 03a6141865 README doctests: fix arti-client
Add ,ignore to ignore three shell runes.
2022-10-12 15:26:18 +01:00
Nick Mathewson 4d25049473 Implement ChannelFactory for (a wrapper of) TransportRegistry.
This will let us just have ChanMgr take a `dyn ChannelFactory`.
2022-10-12 10:15:00 -04:00
Nick Mathewson 28caae68d1 chanmgr: Clean up async-ness on factory types.
The traits that launch connections need to be async; the traits that
don't, shouldn't be async.

Additionally, we need a few more "Sync" annotations here for the
futures to work.
2022-10-12 10:15:00 -04:00
Nick Mathewson a106d97503 Rename mgr::ChannelFactory to mgr::AbstractChannelFactory
This is an internal type (distinct from factory::ChannelFactory)
that we use to make the code in `tor_chanmgr::mgr` agnostic about
what a channel actually is, and how it is actually launched.

Therefore, I'm renaming it and giving better documentation in a
couple of places, to prevent confusion.
2022-10-12 10:15:00 -04:00
Nick Mathewson 5da9596a04 Add several accessors to ChannelMethod.
* Get `TransportId`
 * Get the target address (of any type)
 * Ask, "is this a direct connection"?
2022-10-12 10:15:00 -04:00
Ian Jackson ac1c0bf8fb README doctests: fix arti-client
Add ,ignore to ignore three examples that don't actually compile.

cargo readme would add these annotations to lib.rs, but the doc
include doesn't do stuff like that.  pandoc seems to still render the
result just fine.
2022-10-12 14:56:37 +01:00
Ian Jackson 19de971775 struct BridgeConfig: Rename from Bridge
Fixes #599
2022-10-12 13:54:25 +01:00
Ian Jackson 029a11c833 struct Bridge: add ref to ticket 2022-10-12 13:51:52 +01:00
Ian Jackson b8b885fcf5 cfg tests: bridges: Document test case assumptions 2022-10-12 13:50:29 +01:00
Ian Jackson d1a84d9693 cfg tests: bridges: Remove now-redundant block { } 2022-10-12 13:50:29 +01:00
Ian Jackson 78d143c940 cfg test: bridges: Test all three feature cases
This demonstrates that:

 * !bridge-client: uncommenting nondefault bridge config generates
   urecognized config key warnings (but the config is still accepted)(

 * bridge-client, !pt-client: uncommenting nondefault bridges generates
   error due to attempting to use a PT.  If that's filtered out,
   everything is fine.

 * pt-client: Everything is good (as before).
2022-10-12 13:50:29 +01:00
Ian Jackson f0120534a2 cfg tests: bridges: Prepare for more comprehensive testing
* Introduce filter_examples and resolve_examples helpers,
  which will become more complex in a moment.

* Move the API test into a { } block to minimise subsequent diff.
  It's going to become conditional.

* In subsequent comparisons, use the parsed version, since
  the API built one might not exist.

No overall functional change.
2022-10-12 13:50:29 +01:00
Ian Jackson 7378a00a28 cfg tests: Make ExampleSectionLines::resolve fallible 2022-10-12 13:50:29 +01:00
Nick Mathewson fcea69bceb Fix comment typo. 2022-10-12 13:50:29 +01:00
Nick Mathewson 63cd6b0c87 Fix error message 2022-10-12 13:50:29 +01:00
Ian Jackson 2fb052404d bridge config: Clarify that examples are nonfunctional 2022-10-12 13:50:29 +01:00
Ian Jackson a1b76bc04f bridges: Test configuration 2022-10-12 13:50:29 +01:00
Ian Jackson 3c33108a85 pt and bridges: Parse configuration 2022-10-12 13:50:29 +01:00
Ian Jackson df2b10ea77 config exhaust checking: Feature-limit some of the tests 2022-10-12 13:50:29 +01:00
Ian Jackson cb1adb0103 tor-config: Provide MultilineListBuilder
This is what we'll use to parse the `bridges.bridges` config key.
2022-10-12 13:50:29 +01:00
Ian Jackson f9e841841a tor-guardmgr: Export BridgeParseError from toplevel
Callers could `use` it as `tor_guardmgr::config::BridgeParseError` but
it seems unecessary to force them to.
2022-10-12 13:50:29 +01:00
Ian Jackson debfa1f107 tor-config: Remove unneeded braces in an example 2022-10-12 13:50:29 +01:00
Ian Jackson 4a6ac4090c tor-config: Provide BoolOrAuto
We're going to use this for the config item `bridges.enabled`,
but it seems general enough that it ought to go here.
2022-10-12 13:50:29 +01:00
Ian Jackson b766b16e46 tor_config: define_list_builder_helper: Support custom serde
We're going to want something that has the standard list builder
methods at the Rust API, but which has different serialisation.

Sadly the implementation is annoying, because macro_rules makes it
hard to parse a nice input syntax.
2022-10-12 13:50:29 +01:00
Ian Jackson ffcc548163 Add pt-client and bridge-client features to arti and arti-client 2022-10-12 13:50:29 +01:00
Ian Jackson 4b1dea9d33 bridges config example: Add much more example syntax 2022-10-12 13:50:29 +01:00
Ian Jackson 86364e6f0a bridges config example: Add bridges section to example config
This is precisely the text from the original version of !744.

There is no implementation yet, so we must add a entry to the
exception list in the tests.
2022-10-12 13:50:29 +01:00
Ian Jackson 136e511390 config exhaust checking: Allow for whole sections
Section headings appear uncommented in the file, so if we have a
whole section which is completely unrecognized (ie, an entry with no
`.`, it will be spotted when we parse the not-uncommented file too.

Right now there aren't any but there will be in a moment.
2022-10-12 13:50:29 +01:00
Ian Jackson 9ec657d632 config exhaust checking: Allow for options only unrecognized in new 2022-10-12 13:50:29 +01:00
Ian Jackson a32a590886 config exhaust checking: Move unrecognized lists earlier
It turns out that we will need these even for uncommented parsing.
2022-10-12 13:50:29 +01:00
Ian Jackson 7393ea6dd4 arti config exhaust checking: Improve message, add comment
I had a failure that was confusing to me, and I wrote it...
2022-10-12 13:50:29 +01:00
Ian Jackson 82ad9eea5f Allow "clippy::single_char_pattern" in tests.
This lint exists for perf reasons, and this is rarely relevant in
tests.

Using double quoted str is generally cognitively less burdensome.
2022-10-12 13:50:29 +01:00
eta 0b588bb855 Merge branch 'typo' into 'main'
tor-config: CfgPath: Fix two typos "expaneded"

See merge request tpo/core/arti!764
2022-10-11 16:25:18 +00:00
eta e0698ef661 Merge branch 'disable_rtt_test' into 'main'
Disable rtt_test_vectors test on non-Linux platforms

See merge request tpo/core/arti!766
2022-10-11 14:46:29 +00:00
Nick Mathewson 34587ef192 Disable rtt_test_vectors test on non-Linux platforms
This test depends on `Duration` having a granularity of 1
nanosecond, which is not the case on OSX, and is probably not the
case on other places too.

We can re-enable this once we have a set of test vectors that use
more realistic RTTs, and a set of testing code that tolerates some
divergence.

Temporary solution for #574.
2022-10-11 10:18:04 -04:00
Nick Mathewson 0cb7b030b3 Fix a warning that I reintroduced.
It looks like this got fixed, but my branch for !759 reintroduced it
by refactoring.
2022-10-11 09:38:04 -04:00
Nick Mathewson 74d4c73d09 Change multiplicity of ChannelMethod and addresses
Now each `ChanTarget` has at most one `ChannelMethod`, and only
`Direct` `ChannelMethods` can have multiple addresses.

Closes #600.
2022-10-11 08:53:31 -04:00
Ian Jackson 171c4208a7 Make some things precisely conditional
I think this is quite an inconvenient way to be carrying on.

Maybe we should disable all dead code warnings unless all features are
also enabled, and just let the compiler get rid of unused stuff later.
2022-10-11 12:22:50 +01:00
Ian Jackson 85464bc770 tor-guardmgr: Fix build without pt-client feature 2022-10-11 12:22:46 +01:00
Ian Jackson 32126f2089 Allow two useless pattern matches that are going to be not useless 2022-10-11 12:22:46 +01:00
Ian Jackson d6b85b27c4 tor-config: CfgPath: Fix two typos "expaneded" 2022-10-11 11:22:49 +01:00
Ian Jackson 19d33d207d Merge branch 'progdir' into 'main'
CfgPath: Add support for ${PROGRAM_DIR}.

Closes #586

See merge request tpo/core/arti!760
2022-10-11 10:20:06 +00:00
eta fc5629cc1c Make cargo-sort stop complaining 2022-10-10 11:57:08 +01:00
EliTheCoder 16430ff54a Fixed grammar mistake 2022-10-08 02:06:09 +00:00
Nick Mathewson e005d38edb CfgPath: Add support for ${PROGRAM_DIR}.
`${PROGRAM_DIR}` expands to the equivalent of
`std::env::current_exe().parent()`, with appropriate unwrapping and
conversions.

It is expected to be useful for finding the locations of pluggable
transports in some kinds of bundles.

Closes #586.
2022-10-07 09:03:00 -04:00
Nick Mathewson c41305d110 tor-cell fuzzer: test more features. 2022-10-06 15:48:45 -04:00
Nick Mathewson 22b14066f0 Clarify limits on socket address from ChannelMethod 2022-10-06 15:13:05 -04:00
Nick Mathewson 95a5393cd8 Move two users of HasAddrs to HasChannelMethods
All the other users of HasAddrs are correct.
2022-10-06 15:13:05 -04:00
Nick Mathewson 299ebd729d tor-linkspec: Remove the old OwnedFoo::new() functions
These are now builders.
2022-10-06 15:13:05 -04:00
Nick Mathewson 34c9178feb tor-proto: Preserve the ChannelMethod, not the SocketAddr 2022-10-06 15:13:05 -04:00
Nick Mathewson f8dc4f8b06 ChannelMethod: Add method to access the (optional) SocketAddr 2022-10-06 15:13:05 -04:00
Nick Mathewson b84224feb4 Add builders for OwnedChanTarget/OwnedCircTarget
This will become the preferred way to make one of these objects, and
insulate us against future API changes.
2022-10-06 15:13:05 -04:00
Nick Mathewson ce09b7c96f Begin revising HasAddr and its relationship to ChanTarget
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.
2022-10-06 15:13:05 -04:00
Nick Mathewson 1d70bf4ddd Merge branch 'bridge_containers' into 'main'
Start implementing more data structures to hold Bridge descriptors.

See merge request tpo/core/arti!755
2022-10-06 17:16:44 +00:00
Nick Mathewson 3f419f7f65 Extend some comments about bridge descriptors 2022-10-06 12:56:28 -04:00
eta 92c5b386ac Merge branch 'workaround_589' into 'main'
Temporarily suppress a false positive from nightly.

See merge request tpo/core/arti!754
2022-10-06 14:15:23 +00:00
trinity-1686a f230cb5c03 remove manual limitation of coredump size
it's already disabled by secmem_proc
2022-10-05 18:32:16 +02:00
trinity-1686a 2b8b775dfc feature-gate some functions requiring PreferredRuntime 2022-10-05 12:54:04 +02:00
Nick Mathewson fac975ddfb Add a temporary HasAddrs for BridgeRelay
See comment for an explanation of the next issue here.
2022-10-04 17:53:40 -04:00
Nick Mathewson 23b3b0553f BridgeRelay: Implement more traits.
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.
2022-10-04 17:49:32 -04:00
Nick Mathewson acb6288621 netdoc: Add accessors for protocols and ntor key.
These are needed to actually be able to build circuits through
a bridge.
2022-10-04 17:49:32 -04:00
Nick Mathewson d9e3d38bd6 Start on a new BridgeRelay type.
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.
2022-10-04 17:49:32 -04:00
Nick Mathewson 013b9bff1b Implement HasRelayIds for Bridge. 2022-10-04 17:49:32 -04:00
Nick Mathewson d4f26581c0 Implement BridgeDesc and BridgeDescList.
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.
2022-10-04 17:49:32 -04:00
Nick Mathewson 6f0d974cbe tor-netdoc: Add relay ID accessors for RouterDesc.
To implement a reasonable RsaIdentity accessor, we have to
store the RsaIdentity in the RouterDesc, or else we'd have to
recalculate it using SHA1 and DER every time.

The Ed25519 identity is hidden inside the identity cert, but it's
safe to get a reference to it.
2022-10-04 17:49:32 -04:00
Nick Mathewson 6341057129 Temporarily suppress a false positive from nightly.
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.
2022-10-04 16:40:34 -04:00
Nick Mathewson 5a5f96aa37 n_key_set: Fix bugs in API documentation.
For whatever reason, rustdoc didn't like these multiline strings
in `doc` attributes.
2022-10-04 16:05:40 -04:00
Nick Mathewson 11caa46525 tor-linkspec: ByRelayIds<> type to hold a set of HasRelayIds
This is based on the type generated with n_key_set, with a
couple of extra methods to take advantage of RelayId and RelayIdRef.
2022-10-04 16:05:40 -04:00
Nick Mathewson f8382d4978 n_key_set: Wrap "where" clauses in square brackets too.
Otherwise, there is a parsing ambiguity. :(
2022-10-04 16:05:40 -04:00
Nick Mathewson 8475d3ab39 n_key_set: Rename generic parameters on functions.
Previously we used `<T>` in a bunch of places.  But that fails
if you try to declare `T` as a parameter on the structure itself.
2022-10-04 16:05:40 -04:00
Nick Mathewson bf7c0bb2ba n_key_set: Add a try_insert().
I am finding as I use this that I want a variant that can't panic.
2022-10-04 16:05:40 -04:00
Ian Jackson 9705ef3fea Merge branch 'bridge-parse' into 'main'
Parse (and format) bridge lines

See merge request tpo/core/arti!745
2022-10-03 20:13:02 +00:00
Ian Jackson 193d0f7007 pt: bridge line parsing: overhaul errors
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.
2022-10-03 20:45:54 +01:00
Ian Jackson c920dca9b2 pt: transport ID error: Fix style to remove full stop 2022-10-03 20:45:54 +01:00
Ian Jackson 00fb96650b pt: Check PT key=value syntax
This is not perfect but it at least ensures that our own parsing and
printing code works correctly with all the values we accept.
2022-10-03 20:45:54 +01:00
Ian Jackson b67b5ac536 pt: Make PtTarget::push_setting fallible, and take Into
It has its own error type PtTargetInvalidSetting.

In check_doc_features, adjust suppression to new code.
2022-10-03 20:45:54 +01:00
Ian Jackson a237b80ad8 pt: bridge line parsing: Add commentary 2022-10-03 20:45:54 +01:00
Ian Jackson f6a6fe0d8e pt: Document Bridge line syntax 2022-10-03 20:45:54 +01:00
Ian Jackson 01222dd9e7 pt: PtTransportAddr: change None string to "-"
This is going to appear in config files etc.  We don't want the user
to have to type "<none>" in a bridge line.
2022-10-03 20:45:54 +01:00
Nick Mathewson b08ac01b61 Merge branch 'new-libfuzzer' into 'main'
Upgrade all fuzzers to newer libfuzzer-sys version.

See merge request tpo/core/arti!752
2022-10-03 19:13:09 +00:00
Nick Mathewson 0d985b0def Merge branch 'hostname-validation' into 'main'
Use hostname-validator crate for hostname validation

See merge request tpo/core/arti!739
2022-10-03 19:01:56 +00:00
Nick Mathewson 128fb76c73 Upgrade all fuzzers to newer libfuzzer-sys version. 2022-10-03 14:35:34 -04:00
Nick Mathewson 88a06225b9 Remove semver.md files now that arti 1.0.1 is out. 2022-10-03 14:16:56 -04:00
Nick Mathewson 7402578af4 Merge branch 'multi_keyed_set' into 'main'
Include a HashSet variant that can be keyed on multiple keys.

See merge request tpo/core/arti!747
2022-10-03 18:16:10 +00:00
Nick Mathewson 1329f2c8f3 n_key_set: fix doctest compilation. 2022-10-03 13:31:03 -04:00
Nick Mathewson 8ab2a88923 n_key_set: Update generic syntax
Doing this lets us work with defaults and const generics.
2022-10-03 13:31:01 -04:00
Nick Mathewson 857272bc7a n_key_set: rename map elements.
This prevents an explosion if somebody has a key called "values".
2022-10-03 13:31:01 -04:00
Nick Mathewson 9c08fdb865 n_key_set: Add support for generic lifetimes.
It doesn't work for const generics yet, since they can't be repeated
in quite the same way.
2022-10-03 13:31:01 -04:00
Nick Mathewson 48a15d5627 Tweaks and improvements in documentation.
Most of these were suggested by Ian
2022-10-03 13:31:01 -04:00
Nick Mathewson 4724639d7c Require slab 0.4.4
The `try_remove()` method, which we need, was introduced there.
2022-10-03 13:31:01 -04:00
Nick Mathewson 59f1f7c11d Repair rustdoc.
The previous indentation was making it think that we had rust code
where none existed.
2022-10-03 13:31:01 -04:00
Nick Mathewson 9fd072a4d4 n_key_set: Add a function to check invariant violations
Also, document another invariant.
2022-10-03 13:31:01 -04:00
Nick Mathewson 0dc1573268 n_key_set: Use remove_by_foo to implement insert. 2022-10-03 13:31:01 -04:00
Nick Mathewson e06ae79009 n_key_set: Panic on more invariant and constraint violations. 2022-10-03 13:31:01 -04:00
Nick Mathewson 43fd594819 n_key_set: Remove by_$key_mut.
This can't be used in a consistency-preserving way.
2022-10-03 13:31:01 -04:00
Nick Mathewson 7043df0241 n_key_set: Add flags to keys rather than inferring from Option<T>
Using Option<T> as an alias for T was too clever indeed, and it
meant that our HashMaps were declared with the wrong types.

Putting flags here instead gives us an extension point that we can
use in the future.
2022-10-03 13:31:01 -04:00
Nick Mathewson f0d74db38e n_key_set: Use to_owned to permit &str accessors. 2022-10-03 13:31:01 -04:00
Nick Mathewson 47c9ae0e4b n_key_set: Add some tests, and notes on infelicities. 2022-10-03 13:31:01 -04:00
Nick Mathewson 4e3a390c5b n_key_set: Fix a bug in function access. 2022-10-03 13:31:01 -04:00
Nick Mathewson 0321912ad0 n_key_set: add FromIterator. 2022-10-03 13:30:54 -04:00
Nick Mathewson c2d4b4ed3b Include a HashSet variant that can be keyed on multiple keys.
Every element in the set has up to N keys, each of which may have differnt
types.  No value for any key may correspond to more than one element in
the set.

These properties can be provided, via a macro, for values of N between 1
and $BIG_ENOUGH.

We'll use this to implement a type that holds HasRelayIds.
2022-10-03 13:30:37 -04:00
Nick Mathewson 05868fea7f Merge branch 'socks_client' into 'main'
Implement a SOCKS client handshake

See merge request tpo/core/arti!746
2022-10-03 17:23:24 +00:00
Nick Mathewson f81afe4930 Move generate_* methods in socks client impl. 2022-10-03 12:52:38 -04:00
Nick Mathewson f663f5fdd2 Require no NUL in socks hostname. 2022-10-03 12:52:38 -04:00
Nick Mathewson 41be40694d Tweak "handshake" docs.
Per a suggestion from Diziet, clarify that the socks handshake code
only wants you to drain your buffers when it tells you to.
2022-10-03 12:52:38 -04:00
Nick Mathewson 235bda1210 Add a SocksReply type to capture address/port information.
I don't expect us to need this information much, but we may as well
hang on to it.
2022-10-03 12:52:38 -04:00
Nick Mathewson f12202d707 Make sure that socks4 auth doesn't have any 0 bytes.
Try to do it in constant time, to avoid even the smell of
side-channel attacks.
2022-10-03 12:52:38 -04:00
Nick Mathewson 3ae062911b Tests for socks client handshake.
These tests include a few reference cases, as well as a little
framework to make sure that the client and the proxy implementation
will handshake with one another successfully.
2022-10-03 12:52:38 -04:00
Nick Mathewson cb4e32ddc7 Bug fix: report empty SOCKS4 auth as "no auth".
Previously we would report it as authenticating using the empty
string.
2022-10-03 12:52:38 -04:00
Nick Mathewson dc55272602 Fuzzer code for socks client implementation. 2022-10-03 12:52:38 -04:00
Reylaba 6a6931e2c3 Use hostname-validator crate for hostname validation 2022-10-03 16:47:03 +02:00
Nick Mathewson c1e70b7af4 Bump patchlevels of binary crates.
Since these don't expose any Runtime-based APIs, they don't have
a breaking change.
2022-10-03 10:07:19 -04:00
Nick Mathewson 102e3c221d Bump minor version of tor-rtcompat and most of its dependents
(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.)
2022-10-03 10:01:46 -04:00
Nick Mathewson 388e0cbab5 Bump crates that have had backward compatible API changes. 2022-10-03 09:52:34 -04:00
Nick Mathewson f5389b53e9 Bump crates that have had no API changes. 2022-10-03 09:47:09 -04:00
Nick Mathewson 4b61d778bd Update README.md files. 2022-09-30 15:19:48 -04:00
Nick Mathewson 66ddbee1a4 Upgrade dependencies in preparation for upcoming release 2022-09-30 15:19:32 -04:00
Ian Jackson 5be8830b3f pt: bridge parsing: Add an IPv6 test case 2022-09-30 17:08:14 +01:00
Ian Jackson 47aae0c27a pt: impl Display for Bridge and test it 2022-09-30 17:08:14 +01:00
Ian Jackson 0c9b54c2f0 pt: Provide accessors for PtTarget 2022-09-30 17:08:14 +01:00
Ian Jackson 0dfa69510e implement FromStr for Bridge, and test it 2022-09-30 17:08:14 +01:00
Ian Jackson 4b28c0e120 tor-guardmgr: Introduce pt-client feature
guardmgr needs to know how to parse Bridge lines into Bridge structs
so it needs to know about PTs specifically
2022-09-30 17:08:14 +01:00
Ian Jackson c41ea6e07b pt: Make some more types Eq
I wanted this for testing.  I think it's reasonable to promise this.
2022-09-30 17:08:14 +01:00
Ian Jackson 7bbf7ac161 pt: Provide constructors for PtTarget
Make PtTargetSettings be Default.

No longer wrap it in Arc.  We want to be able to update it here during
construction.  If we want to save memory with copies of the same
bridge line, we should do this for the whole Bridge I think.
2022-09-30 17:08:14 +01:00
Ian Jackson 98f92d870e tor-error::internal: Remove a redundant suppression
Spotted this in passing.
2022-09-30 17:08:14 +01:00
Nick Mathewson 6a04188d59 Work around a new nightly clippy warning
The warning `clippy::bool_to_int_with_if` is meant to shout at you
when you say `if x { 1 } else { 0 }` and instead suggest that you
say `inttype::from(x)`.

I agreed with this for the case in tor-cert, where we are literally
converting a boolean into a flag.

I don't agree with this in tor-netdoc, where we are using a boolean
to decide how many fields to skip in a given document format.  So
for this case, I decided to clean up the code a little by renaming
"skip" to "n_skip", and changing the boolean to use an enum instead.
2022-09-30 09:00:42 -04:00
Nick Mathewson b146dacf1d Mark all bridge and pt features as experimental for now.
Also, document the features.

Closes #588.
2022-09-29 10:59:19 -04:00
Nick Mathewson af99979689 Implement client-side SOCKS handshake 2022-09-28 09:29:56 -04:00
Nick Mathewson d06dcefd7b Make "SocksRequest::new" public.
Also, have it enforce more correctness properties.
2022-09-27 12:38:48 -04:00
Nick Mathewson 4b992cbd89 New ErrorKind::LocalProtocolFailed.
This type is by analogy to `RemoteProtocolFailed`; we'll use it for
cases when the Socks proxy refuses to talk to us.
2022-09-27 12:30:20 -04:00
Ian Jackson 278425321d pt: Reject a pluggable transport named Bridge
https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/91
2022-09-27 17:30:00 +01:00
Ian Jackson 102a663907 Remove docsrs thing which is in wrong place? 2022-09-27 17:30:00 +01:00
Ian Jackson 9b55cc012e pt: Try to fix docsrs problem 2022-09-27 17:29:38 +01:00
Ian Jackson 3e5be3ddd6 pt: Use PtTransportName in PtTarget 2022-09-27 17:29:38 +01:00
Ian Jackson fdfbdf082a pt: Use PtTransportName in TransportId 2022-09-27 17:29:38 +01:00
Ian Jackson 0dab3e0c08 pt: PtTransportName: Provide TryFrom, into_inner, AsRef
This seems a minimal API for such a thing.
2022-09-27 17:29:38 +01:00
Ian Jackson 9980338a9d pt: tor-linkspec: Shorten some names with use
This repetition was getting repetitive.
2022-09-27 17:29:38 +01:00
Nick Mathewson b08073c2d4 socksproto: Rename SocksHandshake to SocksProxyHandshake.
Retain "SocksHandshake" as a deprecated synonym.

Also, make an (on-by-default) feature for SocksProxyHandshake.

(There is about to be a SocksClientHandshake as well.)
2022-09-27 08:28:47 -04:00
Ian Jackson bee40d3954 pt: Introduce PtTransportName
The config parsing wants this.  Also there are some anomalies in the
types here that ought to be tidied up.
2022-09-27 12:44:23 +01:00
Ian Jackson 85dfe9d1ec Merge branch 'always_safelog_on_console' into 'main'
Enforce SafeLogging on the console.

Closes #553

See merge request tpo/core/arti!742
2022-09-26 16:33:58 +00:00
Nick Mathewson 8ddc1a4b36 Enforce SafeLogging on the console.
Previously we always assumed that the console was ephemeral, and so
we disabled safe logging.  But the console can be piped to journald.
And even if we enforce isatty there's no guarantee that the user
isn't using some kind of terminal that logs to disk or something.

Best just to enable SafeLogging unconditionally.  I've added a note
about where and how we might re-enable this.

Closes #553.
2022-09-26 11:36:18 -04:00
Nick Mathewson 3272c6fb04 Add the necessary APIs for bridge-based circuit construction. 2022-09-26 11:23:21 -04:00
Nick Mathewson 1196e1b680 GuardMgr/DirMgr: Add APIs for bridge descriptor lists 2022-09-26 11:23:21 -04:00
Nick Mathewson 571e7f9556 Make RouterDesc implement Clone and Debug.
Their omission was an oversight.
2022-09-26 11:23:21 -04:00
Nick Mathewson ab5dd6cbc3 GuardMgr: Add TODOs for bridge support.
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.
2022-09-26 11:23:21 -04:00
Nick Mathewson e097d64417 A basic configuration type for a bridge.
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.
2022-09-26 11:23:21 -04:00
Ian Jackson 0154d82522 Merge branch 'cell-introduce2' into 'main'
Implement Introduce2 tor cell

See merge request tpo/core/arti!736
2022-09-26 12:07:33 +00:00
Nick Mathewson 52ca64fe0d Add a few comments based on review. 2022-09-23 14:08:53 -04:00
Nick Mathewson 4f93eee67b Clarify and combine PtTargetAddr constructors. 2022-09-23 14:08:53 -04:00
Nick Mathewson 141afbbf61 Rename various Transport* types to Pt*.
This clarifies that the types apply to pluggable transports only,
and not (typically) to the default plain-old-TCP transport.
2022-09-23 14:08:53 -04:00
Ian Jackson 9df8ea215a Clarify note on "none" transport ID. 2022-09-23 14:08:36 -04:00
Nick Mathewson e412d7400c Add the skeleton of a tor-ptmgr crate
When complete, this crate will handle launching and using pluggable
transports on demand.
2022-09-23 14:08:24 -04:00
Nick Mathewson bd627c2e15 ChanMgr: new (unimplemented) APIs for pluggable transports 2022-09-23 14:08:24 -04:00
Nick Mathewson cd88e8cb0b Add a HasChanMethods trait, with a bunch of open TODO questions.
We'll need to sort these out as we implement pluggable transports.
2022-09-23 14:08:24 -04:00
Nick Mathewson cf135ad3eb New data types to describe transport targets.
I've tried to name and structure these for consistency, and
comment reasonably well.  We'll still probably want to make changes.
2022-09-23 14:08:24 -04:00
Nick Mathewson b056e69e1b Add TransportTargetAddr as the target address for a PT-using channel
As with `TransportId`, this type only gets complicated when
`pt-client` is enabled: it's meant to stay simple for relays and
non-PT-using clients.
2022-09-23 14:08:24 -04:00
Nick Mathewson 63dbc7b22d Create an API for TransportId 2022-09-23 09:55:33 -04:00
Ian Jackson a773a753b3 Merge branch 'fix-nightly-clippy' into 'main'
Fix nightly clippy

See merge request tpo/core/arti!729
2022-09-22 16:45:52 +00:00
Ian Jackson 10d3fd9e9f Apply 1 suggestion(s) to 1 file(s) 2022-09-22 16:25:08 +00:00