Commit Graph

6749 Commits

Author SHA1 Message Date
Nick Mathewson 9225b3f89d Merge branch 'shadow-v3' into 'main'
shadow tests: bump to shadow 3.0

See merge request tpo/core/arti!1199
2023-05-23 14:49:30 +00:00
Nick Mathewson 03cb91012d Fix a local-only CPU DoS bug.
Previously, there was a bug in the way that our code used our SOCKS
implementations.  If the buffer used for a SOCKS handshake became full
without completing the handshake, then rather than expanding the buffer
or closing the connection, our code would keep trying to read into the
zero-byte slice available in the full buffer forever, in a tight loop.

We're classifying this as a LOW-severity issue, since it is only
exploitable by pluggable transports (which are trusted) and by
local applications with access to the SOCKS port.

Closes #861.

Fixes TROVE-2023-001.

Reported-By: Jakob Lell <jakob AT srlabs DOT de>
2023-05-23 10:48:27 -04:00
Nick Mathewson 0993672cb2 rpc: Implement auth:query. 2023-05-23 09:08:32 -04:00
Nick Mathewson 2798dade00 rpc: Implement the auth:get_rpc_protocol method. 2023-05-23 08:58:03 -04:00
Nick Mathewson d745e2d866 rpc: move existing auth code to new module. 2023-05-23 08:46:19 -04:00
Ian Jackson b15ca0273b Merge branch 'thanks_trailer' into 'main'
maint/thanks: Include some git trailers in acknowledgments

See merge request tpo/core/arti!1194
2023-05-23 12:33:15 +00:00
Ian Jackson 7e0660a8ab Merge branch 'misc' into 'main'
Fix misc regressions in nascent HS client code

See merge request tpo/core/arti!1197
2023-05-23 12:17:34 +00:00
Ian Jackson 5ba7f31c1d tor-hsclient: Mockable: Do concrete calls with UFCS
Method dispatch rules mean that if the receiver type of the actual
function changes, `self.call()` can turn into a purely-recursive call
which overflows the stack.

Async Rust doesn't have the usual warning for this situation :-(.

UFCS is clumsier but doesn't have that problem because it involves
much less magical dispatch.  Instead of generating a recursive call
which overflows the stack, it fails to compile.
2023-05-23 12:47:33 +01:00
Ian Jackson 79b9a26df0 tor-hsclient: Fix MockableClientCirc for ClientCirc changes
ClientCirc::begin_dir_stream now takes Arc<Self>.  Method resolution
rules mean that this code would just recurse, leading to a stack
overflow.
2023-05-23 12:47:33 +01:00
Jim Newsome d282b009bd shadow-ci: check for successful transfers on bridge-client as well 2023-05-22 13:41:52 -05:00
Jim Newsome c2df3b3992 shadow ci: bump tgen 2023-05-22 13:40:44 -05:00
Jim Newsome 893ea38100 shadow ci: bump shadow 2023-05-22 13:40:44 -05:00
Nick Mathewson 0df0cf4250 proto: Create a `DataStreamCtrl` type.
The idea here is that we want to make DataStream visible to the
RPC system without requiring that the RPC session hold the
DataStream itself (or the Reader, or the Writer).  We could solve
this problem by making _all_ the state in the DataStream shared,
but that would introduce unnecessary extra locking in our critical
path.

Instead we're creating the notion of a "control handle" that lets
you manage and observe a stream without actually owning the stream.

Right now the only supported functionality is asking for the
stream's circuit.

Part of #847
2023-05-22 11:27:44 -04:00
Ian Jackson 1fc1c269c3 Fix a docs reference to refer to HsClientIntroAuthKeypair
Fixes warning from
  cargo -o doc --document-private-items --all-features --workspace

This was evidentlhy overlooked during recent replacement of unescorted
private keys in the code.
2023-05-22 14:30:16 +01:00
Nick Mathewson 0765412fc8 proto: Add a new experimental stream-ctrl feature.
(It doesn't do anything yet. It may eventually become always-on.
But for now let's make this API optional.  Part of #847)
2023-05-22 09:07:03 -04:00
Nick Mathewson b55a3ade33 tor-proto: Move a comment in Cargo.toml 2023-05-22 09:04:44 -04:00
Ian Jackson d6f7acc5b9 Merge branch 'misc_upgrades' into 'main'
Upgrade miscellaneous dependencies

See merge request tpo/core/arti!1195
2023-05-22 12:44:20 +00:00
Nick Mathewson 407a928022 thanks: Also acknowledge Suggested-By 2023-05-22 07:58:54 -04:00
Nick Mathewson 9848155f59 Upgrade notify dependency to 6.0 2023-05-22 07:54:10 -04:00
Nick Mathewson a179d10ad4 Upgrade async-compression dependency to 0.4.0. 2023-05-22 07:52:18 -04:00
Nick Mathewson 16c992ecd3 Upgrade memmap2 dependency to 0.6.1. 2023-05-22 07:51:22 -04:00
Nick Mathewson 512455da96 Upgrade serde_with dependency to 3.0.0 2023-05-22 07:49:58 -04:00
Nick Mathewson df9ff46b80 tor-rtcompat: Say default-features with a dash, not an underscore.
(`cargo-upgrade` warns about this.)
2023-05-22 07:49:28 -04:00
Nick Mathewson cf06933d95 Run "cargo update". 2023-05-22 07:47:20 -04:00
Ian Jackson 26af92ca10 Merge branch 'clippy-nightly' into 'main'
Fix a few warnings from clippy nightly

See merge request tpo/core/arti!1193
2023-05-22 10:49:10 +00:00
Nick Mathewson 4b9d6b255e Merge branch 'escorted_25519_secrets' into 'main'
Refactor code not to use unescorted ed25519 secrets

Closes #798

See merge request tpo/core/arti!1192
2023-05-18 18:48:05 +00:00
Nick Mathewson 9773633a84 hscrypto: Remove an incorrect comment.
(It said that we want to deprecate all unescorted secret keys; in
fact, only unescorted EdDSA secrets are bad.)
2023-05-18 14:18:53 -04:00
Nick Mathewson d75b4af0f1 key-management.md: Add a note deprecating unescorted ed secrets 2023-05-18 14:18:53 -04:00
Nick Mathewson 82801d9963 netdoc, hsclient: Update remaining ed25519::SecretKey users
Fortunately, these are all in experimental code.

Closes #798
2023-05-18 14:18:53 -04:00
Nick Mathewson 66c06ecc9c hscrypto: Replace ed25519 secret keys with keypairs
Part of #798: We no longer use unescorted ed25519 secret keys.
2023-05-18 14:18:53 -04:00
Nick Mathewson 217a9ead49 maint/thanks: Split up some long pipelines 2023-05-18 13:28:45 -04:00
Nick Mathewson bd2b2a171f maint/thanks: Remove email addresses from git trailers
Okay, technically we're removing everything between the first `<` and
the `>` at the end of the line.
2023-05-18 13:27:03 -04:00
Nick Mathewson 8cf1ff5084 maint/thanks: Include some git trailers in acknowledgments
When building our list of acknowledgments, previously we would only
include author and committer names.

Now we also include anybody listed in the "Reported-by",
"Co-authored-by", and "Thanks" trailers.
2023-05-18 13:26:50 -04:00
Nick Mathewson f333c9029a Merge branch 'virtual_hop' into 'main'
tor-proto: Add support for extending circuits through virtual hops.

Closes #726

See merge request tpo/core/arti!1191
2023-05-18 17:14:01 +00:00
Nick Mathewson e8e40e66f6 chanmgr: fix a unit-default warning from clippy nightly.
I could also have stopped using `::default()` to construct this
(testing-only) object, but I think it makes more sense to turn it
into a non-unit object.
2023-05-18 12:57:57 -04:00
Nick Mathewson 41863bd622 guardmgr, netdir: fix some needless-mut warnings
Found by clippy nightly
2023-05-18 12:54:55 -04:00
Nick Mathewson 45571b3ec7 guardmgr: suppress a clippy-nightly warning.
I don't love this change, but apparently we are trying for
"consistency".
2023-05-18 12:52:19 -04:00
Nick Mathewson 6f80caed9d proto: Explain "virtual" hops better.
Based on text from @diziet
2023-05-18 12:40:02 -04:00
Nick Mathewson 0230e7bccc proto: Try to improve the documentation in crypto/cell.rs 2023-05-18 12:40:02 -04:00
Nick Mathewson 3b7a20ef4c proto: Allow circuit Paths to represent virtual hops.
Sadly, this adds a few more `TODO HS` entries, but I think we can
clean them up later after a bit of discussion.
2023-05-18 12:40:02 -04:00
Nick Mathewson 663f25d44c proto: Implement Circuit::extend_virtual.
There are a few new TODO hs comments, though, and an XXXX I'll need
to fix up in the next commit.

Implements #726.
2023-05-18 12:40:02 -04:00
Nick Mathewson b9a848a7ac tor-proto: Code to construct crypto layers for virtual hops.
This is fairly straightforward, thanks to our existing design work
on this code.
2023-05-18 12:40:02 -04:00
Nick Mathewson 55c01158cc Merge branch 'logging-tweaks' into 'main'
tor-guardmgr, tor-proto: minor logging tweaks

See merge request tpo/core/arti!1190
2023-05-18 15:31:32 +00:00
eta 4665835ee8 tor-guardmgr, tor-proto: minor logging tweaks
- We make the tor-guardmgr "We have found that {} is usable" line
  include the word "guard", otherwise it doesn't appear very useful to a
  user in safe logging mode, since the guard gets replaced with
  [scrubbed].
- The "Actually got an end cell..." message is downgraded to DEBUG.
2023-05-18 16:04:11 +01:00
Nick Mathewson dcec7ca2dc llcrypto: Don't take or return "unescorted" ed25519 keys.
Per #798, we want to make sure that we never pass around an
`ed25519::SecretKey`; only an `ed25519::Keypair` (or
`ExpandedKeypair`).  This is because, when you're computing an
ed25519 signature, you have to use the public key as one of your
inputs, and if you ever use a mismatched public key you are
vulnerable to a nonce reuse attack.

(For more info see
https://moderncrypto.org/mail-archive/curves/2020/001012.html )
2023-05-18 11:00:43 -04:00
Nick Mathewson 2ffb200a77 llcrypto: Add an `ed25519::ExpandedKeypair` type.
This is like an `ed25519::Keypair`, except that instead of a
`SecretKey` it contains an `ExpandedSecretKey`.

We'll be using this to implement #798, where we impose a rule that
there must be no "unescorted" ed25519 secret keys.
2023-05-18 10:56:43 -04:00
Nick Mathewson a8b6f19552 Merge branch 'hs_handshake' into 'main'
Clean up hs_ntor.rs, add test vectors generated by C tor, and fix some bugs

Closes #865

See merge request tpo/core/arti!1189
2023-05-18 13:25:07 +00:00
Nick Mathewson c869d7bb7e Merge branch 'hs-intro-msg-refactor-again' into 'main'
Refactor Introduce messages to support looking at encoded headers

Closes #866

See merge request tpo/core/arti!1188
2023-05-17 20:54:25 +00:00
Nick Mathewson 07e2ed0e5c cell: Make Introduce2::new testing-only.
We never want to create one of these from its parts except when we
are testing it; we only want to forward an Introduce1 message with a
new command on it.
2023-05-17 16:22:35 -04:00
Nick Mathewson c3c44cea67 cell: Record the text of an INTRODUCE2 header
We'll need to store this so that it can later on be used to complete
the hs_ntor handshake.
2023-05-17 16:22:35 -04:00