Commit Graph

4748 Commits

Author SHA1 Message Date
Ian Jackson a56efbfdf0 impl Hash for BridgeConfig and various PT information
The bridge descriptor manager wants to index data structures by the
BridgeConfig.
2022-10-27 15:57:54 +01:00
Ian Jackson a89daba1c8 tor-guardmgr: bridges: export BridgeDescError at toplevel 2022-10-27 15:57:54 +01:00
eta 84a2624401 Merge branch 'fuzz_ptmgr_ipc' into 'main'
ptmgr: Add a fuzzer for ptmessage.

See merge request tpo/core/arti!814
2022-10-27 14:51:35 +00:00
eta b3d8f3b5ee Merge branch 'simpler_quote_skipping' into 'main'
ptmgr::ipc: Try an alternate approach to initial quotes.

See merge request tpo/core/arti!813
2022-10-27 14:50:56 +00:00
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 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 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
Emil Engler cc8b9e446f
tor-cell: Fix typos in msg.rs 2022-10-24 14:45:48 +02:00
Emil Engler c42a55d515
tor-cell: Consistent and secure conversion to u16
This commit improves the overflow protection of one call to
Vec::write_u16(), by replacing the cast conversion from self.sig.len()
with a call to u16::try_from(), like it is already done in the rest of
the accompanying function.
2022-10-24 14:40:51 +02: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