Commit Graph

4703 Commits

Author SHA1 Message Date
Nick Mathewson 40ec12b0cb Merge branch 'guards_as_bridges_part1' into 'main'
Allow GuardMgr to expose bridges as guards (part 1)

See merge request tpo/core/arti!785
2022-10-24 13:30:02 +00:00
Nick Mathewson c4263543d4 circmgr: More NOTEs and TODO pt-clients. 2022-10-24 08:59:12 -04:00
Nick Mathewson d7672a13d5 linkspec: specify sort order for HasRelayIds. 2022-10-24 08:59:12 -04:00
Nick Mathewson 103c88dd95 Circmgr: construct paths using either Relay or OwnedCircTarget
Previously we could only use Relay for this case, which won't work
any more: a Bridge is not a `tor_netdir::Relay`.  Instead we allow
the GuardMgr to give us something that knows how to convert itself
into an OwnedCircTarget.

This change required a far amount of follow-on revisions and
refactoring, but it should all be internal to the path-building
logic.
2022-10-24 08:59:12 -04:00
Nick Mathewson 47cd5c97da netdir: Expose addrs-in-same-subnets calculation from SubnetConfig
Previously this was a private method only visible from Relay, but now
we can use it on any two HasAddrs objects.
2022-10-24 08:59:12 -04:00
Nick Mathewson 1195c40a99 linkspec: Remove now-useless declared_peer_addr
The singleton variation here is almost never what we want.
2022-10-24 08:59:12 -04:00
Nick Mathewson bb117a4bd4 guardmgr: Refactor the interior of FirstHop.
Now it contains either an `OwnedChanTarget` or an `OwnedCircTarget`,
which will let `GuardMgr` return bridges that can be used to make
circuits.

As part of this change, it was necessary to revise some
address-modification functions that applied to filters and
`OwnedChanTarget`.  Now they do the smart thing, and remove only the
address that are in the `ChanMethod`.  This means that the addresses
from HasAddrs are still accurate about which addresses the relay
"has".
2022-10-24 08:59:12 -04:00
Nick Mathewson b5e96c3414 Merge branch 'by_ids_mutate' into 'main'
Add two ways to change entries in an n_key_set

See merge request tpo/core/arti!797
2022-10-24 12:36:30 +00:00
Nick Mathewson 15ac14a5d9 n_key_set: clean up some wide lines 2022-10-24 08:08:56 -04:00
Nick Mathewson ef1c0cd282 n_key_set: Re-insert by_foo_mut() accessors, but make them unsafe. 2022-10-24 08:04:02 -04:00
Nick Mathewson d648446201 Fix some litter in a doc comment. 2022-10-24 07:59:42 -04:00
Nick Mathewson 24e62d3197 n_key_set: Add ability to modify entries in the map.
The keys can change: if they do, then the entry is removed from its
previous position and inserted at the new one, possibly displacing
others.
2022-10-24 07:58:45 -04:00
eta b031616b5f Merge branch 'fix_typos' into 'main'
tor-cell: Fix typos in msg.rs

See merge request tpo/core/arti!788
2022-10-21 20:21:28 +00:00
eta 533ff7bda2 Merge branch 'remove_redundant' into 'main'
tor-cell: Remove redundant match clauses

See merge request tpo/core/arti!792
2022-10-21 20:17:37 +00:00
eta 81525c345a Merge branch 'concrete_comments' into 'main'
tor-cell: Make historical comments more concrete

See merge request tpo/core/arti!787
2022-10-21 20:16:27 +00:00
eta 15d8ee715a Merge branch 'circmgr' into 'main'
tor-circmgr make get_or_launch_dir_specific depend on specific-relay feature

See merge request tpo/core/arti!795
2022-10-21 20:14:44 +00:00
Ian Jackson de5514c8f9 Merge branch 'ci-cleanup' into 'main'
cleanup target dir on job completion

See merge request tpo/core/arti!786
2022-10-21 18:10:39 +00:00
trinity-1686a dd5aa3ea38 cleanup target dir on job completion 2022-10-21 18:10:39 +00:00
Ian Jackson a4e65d38e1 Merge branch 'no_redundant_copy' into 'main'
tor-cell: Avoid redundant pointer copy

See merge request tpo/core/arti!791
2022-10-21 17:51:25 +00:00
Nick Mathewson b05d380ec0 Merge branch 'bridge-api-error' into 'main'
Make error from bridge descriptor provider be a trait object

See merge request tpo/core/arti!796
2022-10-21 16:07:23 +00:00
Ian Jackson 0924fb3623 tor-guardmgr: descs: Make BridgeDescError DynClone 2022-10-21 16:22:17 +01:00
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
Nick Mathewson 90a6ef122c Merge branch 'fixed_len_handshake' into 'main'
tor-cell: Rename fixed_len to fixed_len_handshake

See merge request tpo/core/arti!789
2022-10-21 12:18:12 +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 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 938af98b8c Remove now-needless check_doc_features exception. 2022-10-20 12:37:41 -04: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