| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
This lets us paramaterize types and functions by a particular relay cell
format. We use this e.g. to statically parameterize the cell crypto
functions, thereby removing some run-time branching in the hot path.
|
| | |
|
| | |
|
| |
|
|
|
| |
Different formats will use different ranges for the `recognized` and
`digest` fields.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Resolves clippy complaints about needless fallible conversions.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
tor-proto: Resolve a few TODO HSS entries.
See merge request tpo/core/arti!1658
|
| | |
| |
| |
| | |
This will let avoid some copying inside our HSS code.
|
| |/ |
|
| |\
| |
| |
| |
| | |
tor-proto: Refactor the key derivation
See merge request tpo/core/arti!1629
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit refactors the key derivation, by applying the following:
- The spaghetti slice creation with the hard-to-read boundaries got
replaced by a closure, which accepts a length, advances the seed slice
by n bytes as a side-effect, and returns the just advanced bytes
- The use of `.except` got replaced by an `.or`, with the use of the
already existing `InvalidKDFOutputLength` error, thereby removing a
potential panic (probably not reachable in runtime though)
- The conversion from a slice to a `CircuitBinding` got moved into a
`TryFrom` trait of the appropriate data structure
|
| |/ |
|
| |\
| |
| |
| |
| | |
Upgrade several dependencies
See merge request tpo/core/arti!1626
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.)
|
| |/
|
|
|
|
|
|
|
| |
This commit replaces a repeating code pattern in the `set_digest`
function for setting the 'Recognized' and Digest field to zero with a
slice fillment.
Besides this, it also adds comments explaining which fields are
currently getting zeroized.
|
| |\
| |
| |
| |
| |
| |
| | |
Accept and transmit padding in introduce2 plaintexts
Closes #1031
See merge request tpo/core/arti!1602
|
| | |
| |
| |
| |
| |
| | |
Closes #1031. This padding ensures that the introduction point
doesn't learn the length of the plaintext being sent to the onion
service.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| |/ |
|
| |
|
|
|
| |
Fixes
cargo clippy -p tor-hsclient --all-features --all-targets
|
| |
|
|
|
| |
This removes the `Display` impl of `HopNum` and replaces its usage with
`HopNum::display`.
|
| |
|
|
|
|
|
|
|
| |
This function can be used to display a more user-friendly representation
of a `HopNum`. This will print hop numbers as 1-indexed values: #1,
#2, etc..
We will soon remove HopNum's Display implementation in favour of
`.display()`.
|
| |
|
|
|
|
|
|
|
|
| |
This makes `HopNum`s display as 1-indexed values. This will make error
messages more intuitive, because when talking about an N-hop circuit, we
generally speak in terms of hops 1..N (rather than 0..N-1).
Internally, our `HopNum` indices are still 0-based.
Closes #996
|
| | |
|
| |
|
|
| |
Closes #993
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
`HopNum` will be used in `ClientCirc`'s public API when we refactor
`ClientCirc::start_conversation_last_hop` to use the provided hop rather
than always using the last one.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
=========================
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]>
|