Commit Graph

8051 Commits

Author SHA1 Message Date
Gabriela Moldovan 0fde1d09f5
tor-dirclient: Rename download() to send_request() (fmt). 2023-08-16 16:13:27 +01:00
Gabriela Moldovan 9a08f04a76
tor-dirclient: Rename download() to send_request().
`download()` is actually a general-purpose function for sending HTTP
requests on a stream. We will soon repurpose it for `POST`-ing
descriptors, so let's rename it to `send_request`.
2023-08-16 16:13:20 +01:00
Ian Jackson b2c37b0570 Merge branch 'remove-unused-import' into 'main'
tor-proto: remove unused import

See merge request tpo/core/arti!1493
2023-08-16 15:12:12 +00:00
Nick Mathewson 4a5f94daa0 cell: Add accessors to Introduce2. 2023-08-16 10:24:50 -04:00
Ian Jackson 8c73223626 Merge branch 'keystore-dir' into 'main'
arti-client: Make from_directories() derive the keystore_dir from state_dir.

Closes #988

See merge request tpo/core/arti!1498
2023-08-16 14:11:01 +00:00
Nick Mathewson 2a3fe5bf20 Merge branch 'more_introducing' into 'main'
Write more of IptEstablisher.

See merge request tpo/core/arti!1510
2023-08-16 13:02:29 +00:00
Nick Mathewson 0ee63cb04b Wire up more of IptEstablisher.
It now supports running in a loop, trying to establish an
introduction point, and reporting status.
2023-08-16 08:22:53 -04:00
Ian Jackson 2b85def3a6 Merge branch 'fix-weird-comment' into 'main'
doc: fix malformatted comment in SliceWriterError

See merge request tpo/core/arti!1503
2023-08-16 12:07:44 +00:00
Ian Jackson 3d65ab839c Merge branch 'dangerously_assume_timely' into 'main'
tor-cert: actually use dangerously_assume_timely

See merge request tpo/core/arti!1497
2023-08-16 12:07:15 +00:00
Ian Jackson 0cb789e93b Merge branch 'test-expired-certs' into 'main'
test: provide a test for expired certificates

See merge request tpo/core/arti!1496
2023-08-16 11:55:12 +00:00
Ian Jackson a2177e8d13 Merge branch 'coverage-encode' into 'main'
test: encode unrecognized `tor_cert::CertExt`

See merge request tpo/core/arti!1495
2023-08-16 10:52:10 +00:00
gabi-250 19d908f8bf Merge branch 'bump-ssh-key' into 'main'
keymgr: Bump ssh-key to 0.6.0.

Closes #936

See merge request tpo/core/arti!1508
2023-08-16 10:08:02 +00:00
Gabriela Moldovan 1e002b14c9
keymgr: Write a registry sketch.
This comment will form the basis for the protocol name registry.
2023-08-16 10:45:55 +01:00
Gabriela Moldovan 4b72da73b3
tor-keymgr: Add sec1 0.7.3 dependency. 2023-08-16 10:45:47 +01:00
Gabriela Moldovan c8999f230b
tor-keymgr: Re-export ssh-key.
The `KeypairData` type from [ssh-key] at some point leaked into the
keymgr API (via the `EncodableKey` trait). Instead of re-exporting just
`KeypairData`, let's re-export the entire `ssh_key` crate
(`EncodableKey` implementors would need additional types from `ssh_key`
to construct a `KeypairData` object anyway).

[ssh-key]: https://crates.io/crates/ssh-key
2023-08-16 10:44:14 +01:00
Gabriela Moldovan f07651807b
keymgr: Implement as_ssh_keypair_data for curve25519 keys. 2023-08-16 10:44:11 +01:00
Gabriela Moldovan abf83ecfa6
keymgr: Import internal! (fmt). 2023-08-16 10:44:06 +01:00
Gabriela Moldovan 0b109f3ee8
keymgr: Import internal!. 2023-08-16 10:43:51 +01:00
Gabriela Moldovan 9d8c28c639
keymgr: Remove unused helper.
This helper is no longer needed (the logic from
`parse_ssh_format_erased` changed).
2023-08-16 10:43:35 +01:00
Gabriela Moldovan fade75ae16
tor-keymgr: Test x25519 key parsing. 2023-08-16 10:43:32 +01:00
Gabriela Moldovan 17d965e894
keymgr: Do not expect x25519 keys to be stored as ed25519 ssh keys.
Previously, the Arti key store would store x25519 secret keys as ed25519
OpenSSH keys, which it would convert to x25519 upon loading (using the
conversion function added in !1297 (merged)). This approach isn't good
enough though: most people will probably want to bring their existing
x25519 keys, and in order to store those in OpenSSH format, we'd need
convert them to ed25519, which is impossible (because the secret part of
an x25519 key contains a SHA512'd secret, whereas the corresponding,
"un-expanded", ed25519 secret key contains the secret itself rather than
the SHA).

Now that `ssh-key` has support for ssh keys with [custom algorithm
names], we can store x25519 in OpenSSH format directly. This commit
changes the storage format used by the keymgr for x25519 client auth
keys (from ed25519-ssh to our own custom key type with an algorithm name
of `"x25519@torproject.org"`).

Closes #936

[custom algorithm names]: https://github.com/RustCrypto/SSH/pull/136
2023-08-16 10:43:28 +01:00
Gabriela Moldovan b2bcbaa708
keymgr: Bump ssh-key to 0.6.0.
This brings in the changes from #936.
2023-08-16 10:43:21 +01:00
Nick Mathewson ff2d0cffab reformat establish_intro_once 2023-08-15 18:44:11 -04:00
Nick Mathewson 806b08fdbe Make establish_intro_once a method on a new IptEstablisherReactor.
This will help with making a keep_established method.
2023-08-15 18:42:31 -04:00
Nick Mathewson e2fca464c2 hsservice: Actually return from establish_intro_once. 2023-08-15 18:32:13 -04:00
Nick Mathewson 6292f3544a hsservice: migrate IptStatus design to assume a postage::watch 2023-08-15 14:10:06 -04:00
Nick Mathewson e21a3b3151 Merge branch 'bump-backtrace' into 'main'
tor-error, arti: Bump backtrace to 0.3.68.

See merge request tpo/core/arti!1509
2023-08-15 17:58:28 +00:00
Nick Mathewson 99be70afd4 hsservice: Reject extensions in IntroEstablished cells
Intro points must not send these extensions except in response to a
request that prompts them.
2023-08-15 13:09:14 -04:00
Nick Mathewson bac156bcf5 cell: Add code to iterate over IntroEstablished extensions 2023-08-15 13:05:53 -04:00
Nick Mathewson 09d99f1053 cell, docs: Clarify what we mean by "Unrecognized". 2023-08-15 12:14:02 -04:00
Nick Mathewson a6f8b3299f hsservice: Send extensions in establish_intro msgs.
I had planned to make this code accept extensions of unknown type,
but for now I'm backing out of that plan: the set of extensions we
send influences the set that we're willing to receive.
2023-08-15 12:10:39 -04:00
Gabriela Moldovan 31645f4f37
tor-error, arti: Bump backtrace to 0.3.68.
Previously we were using backtrace 0.3.39, which has a [bug] that causes
it to segault in some circumstances. I experienced this bug while trying
to fix the minimal-versions build in !1508.

[bug]: https://github.com/rust-lang/backtrace-rs/issues/267
2023-08-15 16:34:31 +01:00
Nick Mathewson 5d02136ece Merge branch 'cargo_audit_2022_0093' into 'main'
cargo_audit: Add an exception for RUSTSEC-2022-0093.

See merge request tpo/core/arti!1506
2023-08-14 19:20:43 +00:00
Nick Mathewson 118ed81d82 Merge branch 'establish_intro_v2' into 'main'
Implement circuit binding and start on intro-point establisher logic

Closes #953 and #993

See merge request tpo/core/arti!1472
2023-08-14 18:19:33 +00:00
Nick Mathewson 875de204e9 cargo_audit: Add an exception for RUSTSEC-2022-0093.
This is the API deficiency in ed25519-dalek v1 that allows you to
mismatch public and private keys, leading to a (fatal)
double-signing attack.  We have worked around this in our current
design, so it's appropriate to suppress this warning for now.
2023-08-14 14:15:15 -04:00
Nick Mathewson 603175b977 Start working on the backend for an IptEstablisher.
This should be enough now to establish real introduction points,
though there is still a lot of work to do.  Part of #976.

This has been rebased and edited to incorporate discussions from
!1465.
2023-08-14 13:57:49 -04:00
Nick Mathewson d46e638ff0 proto: Fix a type-complexity warning. 2023-08-14 13:15:40 -04:00
Nick Mathewson 65a0ac5512 proto: API to expose the `CircuitBinding` type.
Closes #993
2023-08-14 13:15:29 -04:00
Nick Mathewson 61513de6d0 proto: Take CircuitBinding one step forward into Reactor::add_hop. 2023-08-14 13:15:29 -04:00
Nick Mathewson 0ffa6eddf5 proto: Add (not-yet-exposed) code to remember and use KH values
These values are computed as part of the circuit extension
handshake, and are used as MAC keys to bind `ESTABLISH_INTRO`
messages to a particular circuit so that they can't be replayed.

Part of #993.
2023-08-14 13:15:29 -04:00
Nick Mathewson 926cc65a9e cell: make establish_intro accept impl<Into<HsMacKey>>
This allows us to allow passing in opaque HsMacKey objects,
rather than untyped byte slices.

Additionally, we now check both MAC and signature unconditionally,
to avoid the large timing side-channel.  The small timing
side-channel of combining booleans with `&` is considered safe.

Part of #993.
2023-08-14 13:15:00 -04:00
Nick Mathewson 0759fdf681 hscrypto: Expose hs_mac as a SimpleMac. 2023-08-14 13:15:00 -04:00
Nick Mathewson e7f803529f llcrypto: New SimpleMac trait
This will be useful in preference to the regular Mac trait for the
places where we need to pass a Mac key around, but we don't need to
support incremental operation.

Part of arti#993, where we want to expose a MAC object without
exposing sensitive data.
2023-08-14 13:15:00 -04:00
Nick Mathewson 4047236bd9 Wrap a long line in hscrypto/Cargo.toml. 2023-08-14 13:15:00 -04:00
Gabriela Moldovan 5c5a7bfb14
arti-client: Use Path::join instead of format!. 2023-08-14 16:21:55 +01:00
Emil Engler 28f0120886
doc: fix malformatted comment in SliceWriterError 2023-08-14 10:59:45 +02:00
Nick Mathewson fe5a8a0106 Merge branch 'readme_timeline' into 'main'
README: Note more details about upcoming milestones

See merge request tpo/core/arti!1471
2023-08-13 16:01:29 +00:00
Emil Engler 60ad15b4ff
test: add a test for missing NETINFO cells
This commit adds a unit test to the `tor_proto::handshake` module,
which tests the behavior when no NETINFO cell is present within a
channel.
2023-08-12 19:09:48 +02:00
Gabriela Moldovan d9a04ff9ad
arti-client: Make from_directories() derive the keystore_dir from state_dir.
Closes #988
2023-08-11 12:09:52 +01:00
Emil Engler 2fd4d7d3a4
tor-cert: actually use dangerously_assume_timely
This commit makes a trait function use another currently unused trait
function, thereby increasing the test coverage, as well as being
potentially more correct from a semantic point of view.
2023-08-10 16:32:52 +02:00