| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| |
|
|
|
| |
Now `tor-hscrypto` depends on `tor-key-forge`, so we need to update
their ordering in `Cargo.toml`.
|
| |
|
|
|
| |
`tor-key-forge` now depends on `tor-cert` so we need to reorder the deps
in `Cargo.toml` to satisfy `maint/check_toposort`.
|
| |
|
|
| |
See doc/dev/rpc-book/src/rpc-connect-sketch.md for details.
|
| | |
|
| |\
| |
| |
| |
| | |
Extract general::SocketAddr and its unix friends to their own crate.
See merge request tpo/core/arti!2592
|
| | |
| |
| |
| | |
This is mostly code motion.
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
My previous strategy here was to try and centralize hspow in one crate,
writing it like a self-contained feature. That introduced friction in
the data types, prompting the use of simplistic types at the netdoc/cell
layers and full-featured types in the optional modules.
This changes tactics, dissolving the low-level parts of tor-hspow into
tor-hscrypto and the high-level parts into hsclient/hsservice. Full
featured types are used everywhere now, but the tradeoff is that
compile-time configurability is a lot more pervasive. Anything that
knows about PoW types at all needs to be fully configured out. I took
this opportunity to try a more complete set of crate features, allowing
users to configure individual PoW schemes.
Co-authored-by: Micah Elizabeth Scott <[email protected]>
|
| |
|
|
| |
We're going to need this to use tor-memquota.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new crate called tor-relay-crypto which is responsible for
declaring the relay keys and certificate that will be used by a relay
and stored in a KeyMgr.
This is in its own crate and considered pretty low level so other crates
can use it to access the relay keys, like tor-proto, for cryptographic
actions like channel authentication or descriptor signing.
The lower level cryptographic keys are wrapped in a higher level object
in this crate, using tor-key-forge crate, so we can have proper semantic
and strong type check on those keys so they are not misused or confused
with other keys.
At this point, the key declaration might change once the KeyMgr supports
attaching a certificate to a key. We are likely going to see more code
related to certificate creation in this crate in the future.
Part of #1604
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
Everything copied in the previous commits to tor-keys is now removed and
tor-keys crate is used accross the code.
Minor changes to tor-keys to accomodate this change.
Part of #1137
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The derive ed25519 keypair macro now implements the keymgr trait so the
key wrapper can now be used with a keystore without needing to specify
it in the tor-keymgr crate.
For this to work, a slight change to the KeygenRng trait was needed as
in to expect the CryptoRngCore trait which is what ed25519-dalek
requires.
And also, the removal of the Sealed trait since now it is accepted to
implement these traits outside tor-keymgr.
Fixes #1137
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
At this commit, we also add a derive-deftly macro for ed25519 keypair
along a helper macro that can define a wrapper around a lower-level
ed25519::Keypair.
Part of #1137
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having this in the `tor-async-utils` crate prevents us from doing both
of the following without introducing a circular dependency:
* using it in `tor-rtmock` (which we currently do, particularly in
tests).
* using `tor-rtmock` to test things in `tor-async-utils`. We don't do
this yet, but it is generally sensible to do so. In particular we
want to move the `stream_peak` module there, which is currently tested
with `tor-rtmock`.
Moving this into its own crate avoids this circular dependency.
|
| | |
|
| |
|
|
| |
This is needed to satisfy `maint/check_toposort`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This crate works as a drop-in replacement for
the generational arena types
`slotmap::{SlotMap, DenseSlotMap, HopSlotMap}`,
and is implemented a set of wrappers around those types.
The wrappers guarantee that slot versions numbers can never wrap
around by marking as unusable any slot whose version number
would otherwise get too high. (We add some leeway between our max
allowed version number and the largest possible version number,
so that we can detect bugs.)
The code relies on the serde encoding of slotmap key versions.
For notes on stability and (surprisingly good) performance,
see the comments.
Test coverage is around 98% for the lib.rs file; it's lower in
key_data.rs, since the error cases are unreachable given
slotmap's current behavior.
Open questions:
* What further testing is a good idea?
* Will slotmap ever upstream something like this?
See "# Limitations" comment for the parts of slotmap that are not
implemented; I hope that we don't need them.
|
| | |
|
| |
|
|
|
|
| |
This has been obsolete for a very long time.
We have already published a version with a "won't be updated" warning.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Add the optional non default feature flag "relay" that will be used to
enable relay support of arti.
This commit also adds the "relay" subcommand to arti binary conditionnal
on the feature flag in order to have a place holder starting point.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Put it just above tor-rpcbase, which maybe it would want to use for
metrics export via RPC?
For now we have some dead code `#[allow]`s.
|
| | |
|
| |
|
|
|
| |
This requires reordering of workspace members due to new internal
dev-dependency.
|
| |
|
|
|
| |
This ties it into everything, so we run CI on it, have it in our main
lockfile, and so on.
|
| |
|
|
|
| |
Introduce the crate, move the code motion, and make minimal necessary
changes.
|
| |
|
|
|
|
|
| |
This is not yet "correct", since it will rely on
https://github.com/brunoczim/fslock/pull/15
(Conceivably, it might be better to make the `fslock` crate rm-safe.)
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This crate is meant to provide rate-limited log messages
to tell users about problems that can happen too frequently
to log individually.
This version is based off an earlier design, and off of
conversations with @diziet. It still needs tests.
|
| |\
| |
| |
| |
| | |
Begin working on configuration logic for onion services
See merge request tpo/core/arti!1557
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I'm calling this a "reverse proxy" since I think a lot of folks like
that terminology, though I'm not personally a huge fan. Calling it
"`tor-hsproxy`" would IMO confuse people more about what kind of proxy
it was.
This is a separate crate from `tor-hsservice` because it's logically
at a different level: if you're writing a little embedded onion
service, you don't need this code.
Right now there is only configuration logic here.
|
| | | |
|
| |/ |
|
| |
|
|
|
| |
Including full debug symbols makes the benchmark builds useful for
profiling too.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new tor-hspow crate with the first layers of support in
place for onion service client puzzles as described in Proposal 327.
The API here is experimental, and it's currently only implementing
the self-contained parts of the client puzzle. So, it can verify and
solve puzzles, but it has no event loop integration or nonce replay
tracking or prioritization code yet. These things seem like they would
eventually live in the same crate.
Signed-off-by: Micah Elizabeth Scott <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
This is a new pure Rust implementation of the Equi-X algorithm
designed by tevador for Tor's onion service proof of work puzzle v1.
Equi-X is an asymmetric puzzle algorithm based on Equihash, with
N=60, K=3, the XOR replaced with modular addition, a 16-bit index
space, and HashX as the inner hash function.
Signed-off-by: Micah Elizabeth Scott <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a new pure Rust implementation of the HashX algorithm
designed by tevador for Tor's onion service proof of work puzzle v1.
HashX is a lightweight family of randomly generated hash functions.
A seed, via blake2 and siphash, drives a program generation model
which randomly selects opcodes and registers while following some
constraints that avoid timing stalls or insufficient hash mixing.
The execution of these hash funcions can be done using a pure Rust
interpreter, or about 20x faster using a very simple just in time
compiler based on the dynasm assembler crate. This has been
implemented for x86_64 and aarch64.
Signed-off-by: Micah Elizabeth Scott <[email protected]>
|
| |\
| |
| |
| |
| | |
tor-geoip: Add new crate with GeoIP database functionality
See merge request tpo/core/arti!1239
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- This adds a new crate, `tor-geoip`, which can parse and perform
lookups in the GeoIP database C-tor already uses (generated by a
maintenance utility in the C-tor codebase).
- We embed a copy of C-tor's databases with the crate and use
`include_str!` to ship them with the binary, bloating its size
somewhat.
- This does, however, solve the problem of figuring out how to
distribute these.
- The plan is to gate this functionality behind a feature flag anyway,
so the cost should be nil unless explicitly opted into.
Part of tpo/core/onionmasq#47.
|
| | |
| |
| |
| |
| |
| | |
The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to
`tor-hsclient`. The HS service secret key specifier stubs are moved to
`tor-hsservice`.
|
| |/
|
|
|
| |
This adds implementation stubs for `ArtiNativeKeyStore`, and introduces
the traits needed to make the `KeyStore` APIs work.
|
| | |
|