Commit Graph

2431 Commits

Author SHA1 Message Date
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
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
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
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
Ian Jackson 3a8bcd6fc6 Merge branch 'channel-usage-doc' into 'main'
Improve docs for ChannelUsage

See merge request tpo/core/arti!737
2022-09-22 13:30:10 +00:00
Ian Jackson 6b7b4896bb Merge branch 'expose-builder' into 'main'
CircMgr: Add an accessor for the CircuitBuilder.

See merge request tpo/core/arti!738
2022-09-22 13:28:04 +00:00
Nick Mathewson 67b88547c5 CircMgr: Add an accessor for the CircuitBuilder.
Without this, actually building circuits manually is a pain.

This API is behind the `experimental-api` feature, and so it does
not require a semver.md entry.
2022-09-22 08:57:34 -04:00
Nick Mathewson 016a362f8b Improve docs for ChannelUsage
Try to clarify more that the ChannelUsage is for describing the
usage for one particular channel request, not for the channel as a
whole.  This is a potentially confusing point, so we should spell it
out completely.
2022-09-22 08:49:32 -04:00
Yuan Lyu 6e5874d15b
Implement Introduce2 tor cell
Reuse the same Introduce inner body implementation
of Introduce1.
2022-09-21 00:34:13 -04:00
Nick Mathewson 3e922e5ede Intoduce1: Use a constant-time check for all-zero RsaIdentity
As a matter of good crypto practice, we shouldn't use
short-circuiting checks to compare keys or key-like objects, since
the amount of time taken by those checks can leak information about
their inputs.

I don't think it's actually _necessary_ to use a constant-time
operation in this case, but let's establish the precedent.

This is a follow-up to !724.
2022-09-20 09:36:49 -04:00
Nick Mathewson 657914f778 Add a new constant-time is_zero() check for RsaIdentity
There are some places in the protocol where we have an all-zero RSA
identity that does not truly represent a key, but rather represents
an absent or unknown key.  For these, it's better to use
`RsaIdentity::is_zero` instead of manually checking for a set of
zero bytes: it expresses the intent better, and ensures that the
operation is constant-time.

I am deliberately not introducing a more general IsZero trait here,
or implementing is_zero for anything else: This is the only one we
seem to need right now.  We can generalize it later if we have to.
2022-09-20 09:13:31 -04:00
Nick Mathewson 7715b9c8d6 Merge branch 'cell-introduce1' into 'main'
Implement onion service Introduce1

See merge request tpo/core/arti!724
2022-09-20 13:02:02 +00:00
trinity-1686a 8e7a904260 fix clippy::needless_borrow 2022-09-10 14:39:47 +02:00
trinity-1686a dcbdd076eb fix clippy::unwrap_used and old TODO for msrv 1.56 2022-09-10 14:37:32 +02:00
trinity-1686a edfd416ba4 enumerate platform with getresuid support 2022-09-10 14:13:26 +02:00
trinity-1686a cb9f085f77 force no inlining on internal_macro_test
it may fix this test when running in release, where the function gets inlined, so its name does not appear in the backtrace
2022-09-09 17:29:59 +02:00
Yuan Lyu 1a3b979ecf
Implement onion service Introduce1 2022-09-08 23:48:56 -04:00
Nick Mathewson a7d9d2ceb1 Add a dbg!() to diagnose #570.
This won't fix anything, but it will let us see what the backtrace
looks like when it fails.
2022-09-08 09:58:05 -04:00
eta d9c140992f Merge branch 'fix-async-std' into 'main'
fix compilation error with async-std

See merge request tpo/core/arti!723
2022-09-07 17:16:28 +00:00
Nick Mathewson 86e479ae13 `TaskSchedule`: give error on `sleep*()` if last handle is dropped
This fixes an busy-loop.

When the last `TaskHandle` on a `TaskSchedule` is dropped, the
schedule is permanently canceled: whatever operation it was
scheduling should no longer be performed.  But our code was broken:
the `sleep()` and `sleep_until_wallclock()` functions don't verify
whether the handles are dropped or not.

This breakage caused an CPU-eating busy-loop in
`sleep_until_wallclock`.

With this patch, we now return a `Result<(), SleepError>` from these
functions.

Fixes #572.
2022-09-07 09:22:38 -04:00
Nick Mathewson a5f704f443 Remove semver.md from arti-1.0.0 2022-09-07 09:17:00 -04:00