Commit Graph

5090 Commits

Author SHA1 Message Date
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 34c689cbe8 Merge branch 'one_method' into 'main'
Change multiplicity of ChannelMethod and addresses

Closes #600

See merge request tpo/core/arti!759
2022-10-11 13:20:55 +00: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 82af3a370e Merge branch 'warnings' into 'main'
Fix some warnings

See merge request tpo/core/arti!761
2022-10-11 11:49:34 +00: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 563a6d746e Merge branch 'cargo-sort-2022-10-10' into 'main'
Make cargo-sort stop complaining

See merge request tpo/core/arti!763
2022-10-10 11:27:48 +00:00
eta fc5629cc1c Make cargo-sort stop complaining 2022-10-10 11:57:08 +01:00
eta f27eb88af2 Merge branch 'main' into 'main'
Fixed grammar mistake

See merge request tpo/core/arti!762
2022-10-10 10:53:07 +00: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 b81ad4c879 Update fuzzer corpora 2022-10-07 07:33:01 -04:00
Nick Mathewson c41305d110 tor-cell fuzzer: test more features. 2022-10-06 15:48:45 -04:00
Nick Mathewson 086a7e2692 Merge branch 'addrs-api' into 'main'
tor-linkspec: Refactor HasAddrs, HasChanMethods, and Owned* objects

See merge request tpo/core/arti!758
2022-10-06 19:30:37 +00: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
Nick Mathewson 3068619a06 Merge branch 'shadow-ci' into 'main'
Shadow ci

Closes #174

See merge request tpo/core/arti!634
2022-10-05 18:44:17 +00:00
Jim Newsome cef9a7b65a Create a shadow-based integration test
Fixes https://gitlab.torproject.org/tpo/core/arti/-/issues/174
2022-10-05 12:48:45 -05:00
Nick Mathewson 068b4d944e Merge branch 'dont-limit-coredump' into 'main'
remove manual limitation of coredump size

Closes #598

See merge request tpo/core/arti!757
2022-10-05 16:54:47 +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
Nick Mathewson 4fd98c1760 Merge branch 'no-default-feature-arti-client' into 'main'
feature-gate some functions requiring PreferredRuntime in arti_client

Closes #597

See merge request tpo/core/arti!756
2022-10-05 12:51:27 +00: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 0f06b9af0b Merge branch 'by_relay_id_set' into 'main'
Implement ByRelayIds<H : HasRelayIds>

See merge request tpo/core/arti!753
2022-10-04 20:34:49 +00:00
Nick Mathewson d50efc835b Bump to new arti-corpora. 2022-10-04 16:17:45 -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