Commit Graph

4851 Commits

Author SHA1 Message Date
Ian Jackson 38a940d5a9 Merge branch 'misc-yaks' into 'main'
Two misc minor changes, for descriptor downloading

See merge request tpo/core/arti!811
2022-10-27 10:16:59 +00:00
Ian Jackson 9796d615f8 tor-basic-utils: Provide an implementation of BinaryHeap::retain
This is currently nightly-only and is blocked on an unresolved API
question:
  https://github.com/rust-lang/rust/issues/71503
2022-10-27 10:46:03 +01:00
Ian Jackson a59fef00e9 tor-checkable: Make TimerangeBound::dangerously* non-experimental
I want one of these for the bridge descriptor downloader, and they
seem reasonable to me.
2022-10-27 10:46:03 +01:00
Nick Mathewson 9f73ddd440 Merge branch 'assert_maxlen' into 'main'
tor-cell: Assert data length in Data cells

See merge request tpo/core/arti!800
2022-10-27 01:46:21 +00:00
Nick Mathewson 42fefe021d ptmgr: Add a fuzzer for ptmessage. 2022-10-26 16:59:48 -04:00
Nick Mathewson cb7eb3b00d ptmgr::ipc: Try an alternate approach to initial quotes.
This lets us use `chars()` rather than `char_indices()`.
2022-10-26 14:49:24 -04:00
Nick Mathewson a8b96534be Merge branch 'dirclient-yaks' into 'main'
Misc minor changes to tor-dirclient, for descriptor downloading

See merge request tpo/core/arti!810
2022-10-26 18:43:15 +00:00
eta 1ffb2856d9 Merge branch 'pt-ipc-v1' into 'main'
tor-ptmgr/ipc: First cut of pluggable transport spawning

Closes #394

See merge request tpo/core/arti!779
2022-10-26 15:31:59 +00:00
eta a118a639ed tor-ptmgr/ipc: First cut of pluggable transport spawning
The new `ipc` module inside `tor-ptmgr` implements the Pluggable
Transport Specification version 1 (`pt-spec.txt`,
https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/pt-spec.txt).

This enables module users to spawn pluggable transport binaries inside a
child process asynchronously, and receive structured information about
how to connect to the transports provided by said binaries.

Internally, this is structured as a pure set of serialisers and
deserialisers for the protocol in the specification (in the form of
environment variables, and the PT's stdout), a wrapper to run the PT
binary and enable accessing its output asynchronously, and a user-facing
wrapper that handles ensuring all the requested transports launched
properly.

The included `run-pt` example is an exceedingly minimal wrapper program
that was useful in testing. More tests can and should be added in a
further MR.

closes arti#394; part of arti#69
2022-10-26 16:07:30 +01:00
Ian Jackson d0492ba189 Merge branch 'redundant_allocation' into 'main'
tor-bytes: Avoid redundant allocation

See merge request tpo/core/arti!806
2022-10-26 09:43:13 +00:00
Nick Mathewson a9e74aa72a Merge branch 's101-metrics-october-2022' into 'main'
Update heap and download size metrics for October

See merge request tpo/core/arti!809
2022-10-25 20:25:34 +00:00
Alexander Færøy d092c7fa90 Add September values to heap_and_download_size.md. 2022-10-25 21:52:16 +02:00
Alexander Færøy 2cc1996bb6 Add Methodologies section to our Heap and Download Size document. 2022-10-25 21:51:56 +02:00
Alexander Færøy 7a99555e9d Add missing data from October from Nick. 2022-10-25 21:51:37 +02:00
Ian Jackson a04becf8b4 Merge branch 'flag-event' into 'main'
FlagEvent trait: Implement using macros

See merge request tpo/core/arti!804
2022-10-25 19:16:45 +00:00
Ian Jackson 79a6b4d94f tor-dirclient: impl HasKind for RequestFailedError 2022-10-25 20:12:56 +01:00
Ian Jackson 0b046ad4fb tor-dirclient: Promise that download only gives RequestFailed 2022-10-25 20:12:56 +01:00
Ian Jackson b68f7af79b tor-dirclient::DirResponse: provide output_string
This gives callers a nice error type with source and everything.
2022-10-25 20:12:56 +01:00
Ian Jackson 897e472e60 tor-dirclient: Provide RoutersOwnDescRequest
This will be used for bridges' descriptors.
2022-10-25 20:12:56 +01:00
Ian Jackson 9c9d82f6b8 Fix clippy false positive 2022-10-25 19:42:41 +01:00
Alexander Færøy a8a2de747b Update heap and download size metrics for October
This patch updates the heap_and_download_size.md file with numbers from
October 2022 for our Sponsor 101 deliverables.
2022-10-25 19:56:35 +02:00
Nick Mathewson 20016df6fa guardmgr: Use new ambiguity-tolerant contains in state handling
This has subtleties; the comments try to explain them.
2022-10-25 11:15:53 -04:00
Nick Mathewson d65c351b33 guard sample: Change semantics of `contains` to handle ambiguity.
This is necessary for the (somewhat undesirable) lookup_ids function
to return an ID that the dirmgr can actually use to report successes
and failures.

As noted, lookup_ids will create problems down the road when we
implement relays. We should refactor it out before then.
2022-10-25 11:15:53 -04:00
Nick Mathewson 28f2e2997e Replace contains_relay with can_add_relay().
To see if we can add a relay as a guard, we need a conservative
test: any IDs in common with the given relay prevent us from adding
it.
2022-10-25 11:15:53 -04:00
Nick Mathewson 3a994c32dc Convert guard samples to use ByRelayIds.
This required a number of changes, which I've tried to document.
I've taken a conservative approach to modification, and I'm not
using any of the by_*_mut() functions (yet).  For cases which
potentially modify the whole set, I'm using into_values() and
collect() to ensure that it's re-indexed correctly, even though the
identities don't change.

I introduce some "TODO pt-client" comments here which I will resolve
in the next commit(s).
2022-10-25 11:15:53 -04:00
Nick Mathewson 547d476e0e Merge branch 'bridge-desc-event' into 'main'
BridgeDescEvent: Change the sole variant to SomethingChanged

See merge request tpo/core/arti!807
2022-10-25 15:02:56 +00:00
Ian Jackson f7e5892e40 BridgeDescEvent: Change the sole variant to SomethingChanged
And explain what this all means.
2022-10-25 15:32:56 +01:00
Emil Engler 362d822ee4
tor-bytes: Avoid redundant allocation
See c489e1d911
2022-10-25 16:24:42 +02:00
Nick Mathewson 8528d61a78 impl HasRelayIds for GuardId. 2022-10-25 09:23:28 -04:00
Nick Mathewson 7d313a12bc ByRelayIds: Add additional accessor functions.
These are the ones that turned out to be necessary while converting
guard samples to use ByRelayIds.
2022-10-25 09:23:28 -04:00
Nick Mathewson ac71bb0ef1 linkspec: add HasRelayIds::has_any_identity. 2022-10-25 09:23:28 -04:00
Nick Mathewson 49ffb1cf4b Merge branch 'safe_u16_conversion' into 'main'
tor-cell: Consistent and secure conversion to u16

See merge request tpo/core/arti!803
2022-10-25 13:17:55 +00:00
Nick Mathewson 3e84a5a010 Merge branch 'update_license' into 'main'
meta: Update license year range to 2022

See merge request tpo/core/arti!799
2022-10-25 13:14:40 +00:00
Nick Mathewson 49f0521904 Merge branch 'rename_for_to_from' into 'main'
tor-cell: Rename for_client and for_relay

See merge request tpo/core/arti!793
2022-10-25 11:53:57 +00:00
Nick Mathewson 303727081b Merge branch 'feat/add-semvermd-tor-cell' into 'main'
Add semver.md in tor-cell for MR#793

See merge request tpo/core/arti!798
2022-10-25 11:53:48 +00:00
breezykermo f177f8a02b Add semver.md in tor-cell for MR#793 2022-10-25 11:53:48 +00:00
eta 378a4999ad Merge branch 'fix_typos' into 'main'
tor-cell: Fix typos in msg.rs

See merge request tpo/core/arti!802
2022-10-25 10:36:07 +00:00
eta 26ff63f985 Merge branch 'explain_magic' into 'main'
tor-cell: Add comment explaing Data::MAXLEN

See merge request tpo/core/arti!801
2022-10-25 10:35:56 +00:00
Ian Jackson 9a175ee323 FlagEvent trait: Implement using macros
The explicit list of variant names, that needs to be kept in sync, and
is a test failure semver break hazard, is now gone.

All the necessary code is now generated automatically, and cannot be
wrong.

I want this because I find myself wanting to add a second
implementation of FlagEvent, for another type.
2022-10-25 10:33:28 +01:00
Nick Mathewson 8692b98b2d Merge branch 'error-misc' into 'main'
tor-error: Prepare for more misc errors

See merge request tpo/core/arti!805
2022-10-25 00:14:52 +00:00
Ian Jackson f2a08a15cd tor-error: Tidy up use of thiserror::Error
1. Import it, as we do elsewhere, and use that import.
2. Use thiserror to generate the Display impl, rather than
   derive_more, as we do for errors elsewhere.

(tor_error still needs derive_more::Display for ErrorKind.)
2022-10-24 19:38:46 +01:00
Ian Jackson d7783dd956 tor-error: Rename truncated module to misc
This has no external API change, but makes space for other
miscellaneous errors to arrive later.
2022-10-24 19:38:46 +01:00
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
Emil Engler 05cad9f6d7
tor-cell: Add comment explaing Data::MAXLEN
This commit adds a comment explaining composition of the magic number
"11" found in the assignment of the Data::MAXLEN constant.
2022-10-24 14:46:32 +02:00