aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/crypto/handshake
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade cipher, aes, and ctr.Nick Mathewson2026-07-132-3/+3
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-093-0/+3
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-124-16/+16
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-063-3/+3
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-074-12/+43
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* cell,proto: Split request/response extensions into seprate typesNick Mathewson2025-05-071-9/+9
| | | | Implements part of proposal 358.
* cell: Use ExtList to implement CircRequestExt.Nick Mathewson2025-05-071-3/+4
| | | | This required some renaming, so that the types and their codes matched.
* Rename NtorV3Extension to CircRequestExtNick Mathewson2025-05-071-16/+16
| | | | | | | This type will, because of prop358, be shared by ntorv3, hs-ntor, and probably other future handshakes. There will also be a CircResponseExt type.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-3/+3
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* tor-proto: Use Reader::take_all_but().Nick Mathewson2024-09-161-8/+1
|
* tor-bytes: Error: provide and call Error::incomplete_errorIan Jackson2024-09-111-1/+1
| | | | | | | | | | | | | | | | | | | We introduce the new constructor and call it at the error generation sites. But there is still not yet any functional change. Change the type of Truncated's field to be Sensitive. The original reason for not doing this no longer applies, since we don't generally want to open-code construction of this variant. Conveniently, changing the type means we get to find all the sites where one *is* constructed and adjust them. In reader.rs and tor-proto we can just call incomplete_error. In tor-cell, there's a call site where we previously provided an underestimate, and where the Reader isn't available. We adjust that ad-hoc but this is fine because the error variant will change. (relaycell is using a Reader from from_slice.)
* tor-bytes: Add a deficit field to Error::Truncated (fmt)Ian Jackson2024-09-101-1/+3
|
* tor-bytes: Add a deficit field to Error::TruncatedIan Jackson2024-09-101-1/+2
| | | | This will allow us to fix #1592, but it doesn't do so yet.
* Add allows for many dead code warnings in tor-protoIan Jackson2024-07-082-0/+5
| | | | | | | I'm not sure how to resolve these. See #1467. We ought to fix them before they propagate to +stable, particularly since after !2242 they'll break CI.
* Run maint/add_warning.Nick Mathewson2024-03-133-0/+3
|
* NtorV3Extension set encoding/decoding: include n_extensionsJim Newsome2023-12-071-3/+3
| | | | | | | | | | An encoded set of extensions in the ntorv3 handshake includes a header with the number of extensions. This change adds that header. It also changes `write_many_onto` to take a slice instead of an iterator, since we need to know the number of extensions up-front. In principle we could take a clonable iterator instead and use Iterator::count, but it's probably not worth the extra complexity.
* Remove RngCompatExt.Nick Mathewson2023-11-292-7/+6
| | | | | | | | | | This code was needed with the old version of dalek-cryptography, which wasn't compatible with up-to-date versions of the `rand` crate(s). But now that we've upgraded, we can drop this. (We could have left it around and deprecated it, but we are already making a breaking change to tor-llcrypto by upgrading dalek-cryptography.)
* Convert to the latest versions of dalek-cryptographyNick Mathewson2023-11-293-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes that we have to adjust for are as follows: * In x25519-dalek: * `StaticSecret` is now behind a feature. * `StaticSecret::new` is deprecated in favor of `StaticSecret::random_from_rng`. * StaticSecret no longer does its own clamping. * In ed25519-dalek: * `SecretKey` has (in effect) been renamed to `SigningKey`. The name `SecretKey` is now an alias for `[u8; 32]`. * `SigningKey` is effectively a keypair, since it contains a public key as well. * `PublicKey` has been renamed to `VerifyingKey`. * The functions to extract a signing key and verifying key have been renamed as you might expect. * `ExpandedSecretKey` has been moved to `hasmat` and no longer implements `sign`. * `ExpanededSecretKey` now has as its elements a scalar and a hash prefix. * Various functions that took `&[u8]` now take `&[u8; N]`. * We no longer need a wrapper for older versions of rand. There is a single test in tor-keymgr that does not pass. I've marked it as ignore for now, in hopes that @gabi-250 can help me figure it out. This closes #808. There are several changes I want to make before we merge, however. They are marked with TODO DALEK.
* Add NtorV3SecretKey::generate_for_test and NtorV3SecretKey::newJim Newsome2023-11-271-39/+36
|
* NtorV3PublicKey: make fields pub(crate), as for NtorPublicKeyJim Newsome2023-11-271-2/+2
|
* tor-proto: make ClientHandShake and ServerHandshake generic over aux dataJim Newsome2023-11-153-103/+62
|
* Add NtorV3Server and implement ServerHandshake for itJim Newsome2023-11-151-29/+43
|
* ServerHandshake: extend to support ntorv3 extensionsJim Newsome2023-11-152-12/+69
|
* NtorV3Client: implement ClientHandshakeJim Newsome2023-11-151-7/+13
|
* ClientHandshake: extend to support ntorv3 extensionsJim Newsome2023-11-152-16/+36
|
* NtorV3Client: take a slice instead of a vec of extensionsJim Newsome2023-11-151-5/+3
|
* ntor_v3: replace `impl digest::XofReader` with `NtorV3XofReader`Jim Newsome2023-11-151-15/+20
|
* hs_ntor: fix comment typo INTROUDCE1Jim Newsome2023-11-151-1/+1
|
* Precisely cfg-decorate a constantIan Jackson2023-10-311-0/+1
| | | | | | | | | | Peraonally I would prefer | #![cfg_attr(not(all(feature = "full", feature = "experimental")), | allow(dead_code))] but I think that is almost certainly controversial. See tpo/core/arti#704.
* Merge branch 'todos_proto' into 'main'Nick Mathewson2023-10-121-80/+37
|\ | | | | | | | | tor-proto: Resolve a few TODO HSS entries. See merge request tpo/core/arti!1658
| * Remove the (fairly bogus) HsNtorServiceInput type.Nick Mathewson2023-10-121-80/+37
| | | | | | | | This will let avoid some copying inside our HSS code.
* | tor-proto: Add a FIXME about an allowIan Jackson2023-10-121-0/+2
|/
* tor-proto: Fix clippy warning.Gabriela Moldovan2023-10-031-1/+1
|
* Remove direct dependency on generic-arrayNick Mathewson2023-09-282-5/+3
| | | | | | | | | | Instead of tying ourselves to a particular version of the generic-array crate, we now always use the version re-exported by our RustCrypto crates. This lets us avoid the possibility of version mismatch. (Originally I had planned to upgrade to generic-array 1.0, but then I found that we were not actually using it.)
* Merge branch 'pad_intro2' into 'main'Nick Mathewson2023-09-251-7/+41
|\ | | | | | | | | | | | | Accept and transmit padding in introduce2 plaintexts Closes #1031 See merge request tpo/core/arti!1602
| * Generate padding in Introduce1 messages.Nick Mathewson2023-09-181-7/+41
| | | | | | | | | | | | Closes #1031. This padding ensures that the introduction point doesn't learn the length of the plaintext being sent to the onion service.
* | hs_ntor: replace "32" with a const.Nick Mathewson2023-09-211-1/+1
| |
* | hs_ntor: rename get_{introduce,rendezvous}1_key_material.Nick Mathewson2023-09-211-6/+6
| |
* | hs_ntor: improve several comments.Nick Mathewson2023-09-211-3/+10
| |
* | hs_ntor: rename enc_key to dec_key in service code.Nick Mathewson2023-09-211-5/+5
| |
* | hs_ntor: allow attempting handshake with a set of subcredentials.Nick Mathewson2023-09-201-27/+45
| | | | | | | | | | | | | | Since we are using the same introduction point circuits for multiple time periods, we need the ability to provide a set of subcredentials and see which of them acually works. Fortunately, we "only" have to do digest operations here, which are much faster than public key.
* | hs_ntor: Take our k_hss_ntor keypair explicitly.Nick Mathewson2023-09-201-18/+18
|/
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-233-0/+3
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-103-0/+3
|
* Back down x25519-dalek to 2.0.0-pre.1 from 2.0.0-rc.2pinkforest2023-06-273-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ========================= Notes from nickm: (This differs from pinkforest's original MR: It removes the Cargo.lock changes and the version bump on tor-llcrypto.) Minimal Cargo.lock changes from downgrade. (These are exactly those changes generated by running "build" and "test".) There are several reasons to do this: * It's best to bump all of our dalek dependencies at once to rc.3 or later, rather than the piecemeal approach we've been stuck with so far. * We don't want to do this bump right now, since there are some tricky questions about clamping we need to figure out (see #808), and we need to make sure we get them right, and we're in a distracted this week. * We _do_ need to move away from 2.0.0-rc.2 right now, since it was causing a failure in `cargo install arti`, and then it got yanked. Thanks to pinkforest for helping us out here and explaining all of this! Fixes #926. Commit-edited-by: Nick Mathewson <[email protected]>
* proto: Put client and service hs_ntor behind individual featuresNick Mathewson2023-06-211-5/+17
| | | | | This lets us keep the service-side hs-ntor handshake experiemental for now.
* proto: Resolve some hs_ntor "TODO HS" comments.Nick Mathewson2023-06-211-10/+7
|
* Lower tor-proto::util::ct::lookup to tor-llcryptoNick Mathewson2023-06-162-3/+4
| | | | | | | | This is mostly code movement; you may want to review it with `--color-moved`. I'm doing this so we can also use the function in netdoc for looking up hsdesc authentication.
* proto: Add a commment about a problem in my hs_ntor plans.Nick Mathewson2023-06-121-0/+4
| | | | | I am pretty sure that C tor works around this somehow; we should figure out how!
* proto: code movement and reindentation in hs_ntorNick Mathewson2023-06-121-86/+75
|