Commit Graph

598 Commits

Author SHA1 Message Date
gabi-250 dece1bec6c Merge branch 'upgrade-itertools' into 'main'
Upgrade to itertools 0.11.0

See merge request tpo/core/arti!1306
2023-06-26 14:42:02 +00:00
Nick Mathewson 0bffdf23a4 Upgrade to itertools 0.11.0
The breaking changes here do not seem to affect us.
2023-06-26 09:30:54 -04:00
Gabriela Moldovan 7c023f2ec2 keymgr: Create a KeyStoreError trait for keystore errors.
The new `BoxedError` type will replace `tor_keymgr::Error`.

Part of #901
2023-06-26 13:13:15 +01:00
Nick Mathewson 90f653f582 netdoc: Use a dev-dependency on anyhow to fix a doc example 2023-06-22 13:42:40 -04:00
Nick Mathewson 610ed2d457 Merge branch 'socks_errorkinds' into 'main'
Generate correct-ish socks5 errors for onion service errors.

Closes #736

See merge request tpo/core/arti!1279
2023-06-22 16:15:55 +00:00
Nick Mathewson 967cae6ced New ErrorKind for invalid onion addresses
Use this to emit HS_BAD_ADDRESS as appropriate.
2023-06-22 10:57:08 -04:00
Ian Jackson 1e5004eba7 Merge branch 'hsdesc-accessors' into 'main'
netdoc: Use derive amplify::Getters for HsDesc accessors.

Closes #909

See merge request tpo/core/arti!1266
2023-06-21 15:11:05 +00:00
Nick Mathewson 16a07a8f63 Upgrade to memmap2 0.7 2023-06-21 09:13:55 -04:00
Nick Mathewson 0505579497 Upgrade to strum 0.25. 2023-06-21 09:12:36 -04:00
Nick Mathewson 107fbb05de Merge branch 'geoip-nullity-fromstr' into 'main'
Followups wrt country-code robustness

See merge request tpo/core/arti!1268
2023-06-21 12:32:23 +00:00
Ian Jackson 0c18de656f Bump openssl because RUSTSEC-2023-0044 2023-06-21 11:57:34 +01:00
Nick Mathewson cf9d902320 geoip: Make ?? a little more bullet-proof
We want to make sure that ?? is always None, never a CountryCode.
2023-06-20 16:22:21 -04:00
gabi-250 db7f46265e Merge branch 'keymgr-refactor-fs-ops' into 'main'
keymgr: Move FS operations out of KeyType impl

See merge request tpo/core/arti!1263
2023-06-20 18:41:33 +00:00
Nick Mathewson 17fab6e913 netdoc: Use derive amplify::Getters for HsDesc accessors.
Closes #909.
2023-06-20 14:00:41 -04:00
Nick Mathewson 8d4ca94e19 Merge branch 'add-tor-geoip' into 'main'
tor-geoip: Add new crate with GeoIP database functionality

See merge request tpo/core/arti!1239
2023-06-20 17:59:15 +00:00
Gabriela Moldovan abdf854547 keymgr: Move FS operations out of ssh.rs
This moves the filesystem calls from the `ssh` module to
`ArtiNativeKeyStore`. While `ArtiNativeKeyStore` shouldn't be concerning
itself with filesystem operations either, that refactoring will be
tackled separately (see arti#899).
2023-06-20 18:54:35 +01:00
eta d5632eacb2 tor-geoip: Add new crate with GeoIP database functionality
- 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.
2023-06-20 16:57:58 +01:00
Gabriela Moldovan 6837dbce58 keymgr: Add an error variant for fs_mistrust errors.
This will be useful later, when `KeyMgr` will start validating
permissions and paths.
2023-06-20 13:29:10 +01:00
Alexander Færøy f55187e065 Merge branch 'arti-client' into 'main'
Sort out .onion handling in arti-client

See merge request tpo/core/arti!1257
2023-06-19 14:44:55 +00:00
Nick Mathewson b9500c6f3d Merge branch 'netdoc-todos' into 'main'
Resolve many TODO HS items in tor-netdoc

See merge request tpo/core/arti!1251
2023-06-16 17:31:31 +00:00
Nick Mathewson 6edcca7df3 netdoc: use ct_lookup for rend descriptor cookie lookup
(I doubt that there is a viable side channel here, but still we
might as well get in the habit of doing these things properly.)
2023-06-16 12:24:05 -04:00
Ian Jackson 18291cb001 arti-client: Provide ErrorDetailDiscriminants for convenient testing
ErrorDetail isn't PartialEq so we can't assert_eq! it.
But the discriminants will be.
2023-06-16 16:18:02 +01:00
Gabriela Moldovan eda974cd34 keymgr: Move the HS client and service key specifiers out of tor-keymgr.
The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to
`tor-hsclient`. The HS service secret key specifier stubs are moved to
`tor-hsservice`.
2023-06-15 18:16:33 +01:00
Gabriela Moldovan 61f37b1b5c keymgr: Add key manager implementation stub. 2023-06-15 18:15:30 +01:00
Gabriela Moldovan a2d0ee63cc keymgr: Add ArtiNativeKeyStore implementation skeleton.
This adds implementation stubs for `ArtiNativeKeyStore`, and introduces
the traits needed to make the `KeyStore` APIs work.
2023-06-15 18:15:30 +01:00
Nick Mathewson ac90cb7500 Upgrade async-trait requirement to 1.54
We need the fix from [82d69902], which first appeared in async-trait
version 1.54.  (Technically we only need this fix in tor-hsclient,
but we may as well update our minimal async-trait version everywhere.)

[82d69902]: 82d6990253
2023-06-12 13:15:59 -04:00
Ian Jackson c2952a5b20 tor-hsclient: Implement rendezvous setup, and retry framework
This contains code to:

 * Iterate over introduction points
 * Make multiple attempts to connect
 * Apply timeouts to the various phases of each attempt
 * Establish a rendezvous point
 * Represent errors that occur during the above

It provides places to add:

 * Implementation of the INTRODUCE1/INTRODUCE_ACK handshake
 * Reception of RENDEZVOUS2 and actual end-to-end circuit establishment
 * Recording of the outcome of connection attempts via particular IPTs
 * Using previous IPT outcome information for selecting IPTs to try
 * Tests of the new code (although more mocking will probably be needed)

Much of this code works with a fixed type ClientCirc rather than going via
the Mockable traits.  That is wrong, and it will be fixed later.
2023-06-09 17:36:48 +01:00
Ian Jackson a50016b3da tor-hscrypto: implement Rng.gen() for RendCookie 2023-06-09 12:24:24 +01:00
Nick Mathewson 924dbf7d8f Merge branch 'ipt_to_circtarget' into 'main'
Construct a CircTarget from an IntroPointDesc.

See merge request tpo/core/arti!1221
2023-06-07 12:35:26 +00:00
Nick Mathewson 618ed48cea hsclient: Create a CircTarget from an IntroPointDesc.
The main body of this function is written so that we can later use
it to create a CircTarget from an INTRODUCE2 message.
2023-06-07 07:55:45 -04:00
Nick Mathewson e7ebb31009 Merge branch 'remove_arrayref' into 'main'
Remove use of arrayref

Closes #872

See merge request tpo/core/arti!1214
2023-06-06 00:37:31 +00:00
Nick Mathewson 362a1f8ac1 arti: Interpret socks request to mean "lookup an RPC session"
The actual decoding here is just a placeholder.  The important part
is that we can get either a (SessionId, StreamId) tuple out of the
request, or we treat it as part of an isolation token.

This commit has a few TODOs for additional things that we'll need
in order to build out our design.
2023-06-05 14:47:38 -04:00
Nick Mathewson 71e98b1a12 RPC: Implement a "global identifier" for non-session-bound IDs
These identifiers are actually only "global" with respect to a given
`RpcMgr`, but they should not be forgeable or reusable across RpcMgr
objects.  We're going to use them so that we have a kind of identifier
for `TorClient`s that we can expose to SOCKS.
2023-06-05 14:46:51 -04:00
Nick Mathewson 545984b095 rpc: Give RpcMgr a registry of connections.
We're going to use this to implement arti#863, which requires that
some RPC objects be globally nameable.
2023-06-05 14:45:42 -04:00
Nick Mathewson 0bf44b1393 tor-cell: remove use of arrayref
Closes #872
2023-06-01 11:14:48 -04:00
Nick Mathewson dfcbd7d4ee tor-llcrypto: remove use of arrayref 2023-06-01 10:50:25 -04:00
Nick Mathewson 744d32d554 tor-netdoc: remove use of arrayref. 2023-06-01 10:36:35 -04:00
Nick Mathewson 46d2a768a1 tor-proto: Remove use of arrayref. 2023-06-01 10:32:00 -04:00
Nick Mathewson daf5ecc153 Bump crate versions in preparation for v1.1.5 release.
Generated with the following commands:

```
cargo set-version --bump minor -p tor-cell
cargo set-version --bump minor -p tor-linkspec
cargo set-version --bump minor -p tor-proto
cargo set-version --bump minor -p tor-netdoc
cargo set-version --bump minor -p tor-circmgr

cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-basic-utils
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-hscrypto
cargo set-version --bump patch -p tor-checkable
cargo set-version --bump patch -p tor-async-utils
cargo set-version --bump patch -p caret
cargo set-version --bump patch -p fs-mistrust
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p retry-error
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-events
cargo set-version --bump patch -p tor-units
cargo set-version --bump patch -p tor-rtcompat
cargo set-version --bump patch -p tor-rtmock
cargo set-version --bump patch -p tor-protover
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-socksproto
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-congestion
cargo set-version --bump patch -p tor-persist
cargo set-version --bump patch -p tor-chanmgr
cargo set-version --bump patch -p tor-ptmgr
cargo set-version --bump patch -p tor-guardmgr
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-hsclient
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p arti-rpcserver
cargo set-version --bump patch -p arti-config
cargo set-version --bump patch -p arti-hyper
cargo set-version --bump patch -p arti
cargo set-version --bump patch -p arti-bench
cargo set-version --bump patch -p arti-testing
```
2023-06-01 10:03:05 -04:00
Nick Mathewson 65be721f46 Run "cargo update" in preparation for Thursday release. 2023-05-30 10:37:24 -04:00
Nick Mathewson 244ec5dce2 tor-bytes: Remove use of arrayref
Part of #872: Now that const generics are in, we have better ways to
express converting slices into array-references.
2023-05-25 14:48:57 -04:00
Nick Mathewson 45b4845f3a rpc: Remove fake_generational_arena
Now that generation-arena has merged [@diziet's patch] to clarify
their license, we no longer need to disable it.

[@diziet's patch]: https://github.com/fitzgen/generational-arena/pull/56
2023-05-23 13:58:08 -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 cf06933d95 Run "cargo update". 2023-05-22 07:47:20 -04:00
Nick Mathewson 9d5dd813c0 hs_ntor: Use Subcredential type from tor-hscrypto 2023-05-17 16:18:55 -04:00
Nick Mathewson 2e1115acc3 rpc: Change the formatting of object IDs
We want each ID to have a unique form every time it is given out,
so that you can't use ID==ID to check whether Object==Object.  (See
discussions leading to #848.)

We'd also like the form of object IDs to be a little annoying to
analyze, to discourage people from writing programs that depends on
their particular format.  (We are reserving the right to change the
format whenever we want.)

We _don't_ want to use any cryptography here (yet), lest somebody
think that this is an actual security mechanism.  (This isn't for
security; it's for encouraging developers to treat IDs as opaque.)

With that in mind, we now lightly obfuscate our generational indices
before returning them.
2023-05-15 15:59:58 -04:00
Nick Mathewson bedc47afe7 llcrypto: upgrade x25519-dalek.
This upgrades us to 2.0.0-rc.2, which is the latest in the
not-quite-done-yet 2.0 series.

The only code change that's absolutely needed is opting into the
static_secrets feature.
2023-05-13 16:46:47 -04:00