Commit Graph

32 Commits

Author SHA1 Message Date
Gabriela Moldovan ddacfef45c
tor-keymgr: Bump ssh-key to 0.6.1 and remove unnecessary dependency.
Now that [ssh-key 0.6.1] is out, we no longer need the explicit sec1
dependency in tor-keymgr.

[ssh-key 0.6.1]: https://github.com/RustCrypto/SSH/pull/155
2023-08-24 11:29:49 +01:00
Ian Jackson 8596d42372 tor-keymgr, tor-hsservice: deser for ArtiPathComponent and HsNickname 2023-08-23 15:35:30 +01:00
Gabriela Moldovan 4b72da73b3
tor-keymgr: Add sec1 0.7.3 dependency. 2023-08-16 10:45:47 +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 3422169ff4 Merge branch 'bump_versions_117' into 'main'
Vesion bumps for 1.1.7.

See merge request tpo/core/arti!1458
2023-08-01 15:40:26 +00:00
Nick Mathewson 3acdf102c7 Increment patchlevel versions of crates with minor changes
These crates are at version 0.x.y, so we don't need to distinguish
new-feature changes from other changes:

```
tor-basic-utils
fs-mistrust
tor-error
tor-geoip
tor-checkable
tor-linkspec
tor-netdoc
tor-netdir
tor-persist
tor-ptmgr
tor-hsservice
```

This crate has a breaking change, but only when the semver-breaking
feature `experimental-api` is enabled:

```
tor-config
```

This crate is at version 1.x.y, but has no new public APIs, and
therefore does not need a minor version bump:

```
arti
```
2023-08-01 10:57:55 -04:00
Nick Mathewson 6f2ae59603 Update minor versions on crates that have had breaking changes
These crates had first-order breaking changes:

```
retry-error
tor-keymgr
tor-proto
tor-hsclient
tor-rtmock
```

Additionally, these broke because they re-exposed RetryError:

```
tor-circmgr
```

Additionally, these broke because they may re-expose something from
tor-proto:

```
    arti-client
    tor-chanmgr
    tor-dirclient
    tor-dirmgr
    tor-guardmgr
```

Additionally, these broke for other fiddly reasons:

`tor-ptmgr` implements traits from tor-chanmgr, which has a breaking
change above.

`arti-hyper` exposes types from arti-client in its API.
2023-08-01 10:51:25 -04:00
Nick Mathewson 9ce6f0a0eb Run "fixup features" in preparation for a release. 2023-08-01 08:32:20 -04:00
Gabriela Moldovan f96298a791
keymgr: Add KeyMgr::generate() for generating new keys. 2023-07-24 13:17:31 +01:00
Gabriela Moldovan 9c326ced81
keymgr: Add function for generating EncodableKeys. 2023-07-24 13:17:23 +01:00
Nick Mathewson 119bb68cbc keymgr: Upgrade to latest itertools.
(Everything else is already on 0.11.0.)
2023-07-17 10:08:38 -04:00
Gabriela Moldovan d8299e8d2f
tor-keymgr: Add ArtiNativeKeystoreConfig.
Previously, the keystore config consisted of a single field in
`StorageConfig`, which encoded 2 bits of information: whether the
keystore is enabled, and its root directory:
```
[storage]
# use this path, fail if compiled out
# keystore = "/path/to/arti/keystore"
#
# use default path, fail if compiled out
# keystore = true
#
# disable
# keystore = false
```

This commit adds `ArtiNativeKeystoreConfig`, which will replace the
multi-purpose `keystore` field. The new config will look like this:
```
#[storage.keystore]
# Whether the keystore is enabled.
#
# If the `keymgr` feature is enabled and this option is:
#     * set to false, we will ignore the configured keystore path.
#     * set to "auto", the configured keystore, or the default keystore, if the
#     keystore path is not specified, will be used
#     * set to true, the configured keystore, or the default keystore, if the
#     keystore path is not specified, will be used
#
# If the `keymgr` feature is disabled and this option is:
#     * set to false, we will ignore the configured keystore path.
#     * set to "auto", we will ignore the configured keystore path.
#
# Setting this option to true when the `keymgr` feature is disabled is a
# configuration error.
#enabled = "auto"
# The root directory of the arti keystore
#path = "${ARTI_LOCAL_DATA}/keystore"
```

While `ArtiNativeKeystoreConfig` currently only has 2 fields, `enabled`
and `path`, future versions of the keystore might require additional
config options.
2023-07-13 12:13:59 +01:00
Gabriela Moldovan 9cde64c2c8 keymgr: Use Box<dyn EncodableKey> instead of Box<dyn Any>.
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1337#note_2917701

This will make it harder to accidentally return the wrong value from
`Keystore::get` (the returned value is now at least guaranteed to
implement `EncodableKey`).

Closes #937
2023-07-10 14:41:30 +01:00
Nick Mathewson de13a7319b Bump patchlevel versions on crates with smaller changes
Done with the commands below.

The following crates have had various changes, and should get a
patchlevel bump. Since they are pre-1.0, we do not need to
distinguish new APIs from other changes.

```
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-circmgr
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p tor-linkspec
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-netdoc
cargo set-version --bump patch -p tor-proto
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-socksproto
```

This crate has new features, but no new non-experimental Rust APIs.
So even though it is post-1.0, it gets a patchlevel bump.

```
cargo set-version --bump patch -p arti
```
2023-06-30 08:42:21 -04:00
Nick Mathewson 65e81bf0ca Bump minor versions on crates with breaking changes
Done with:
```
cargo set-version --bump minor -p tor-hsclient
cargo set-version --bump minor -p arti-rpcserver
cargo set-version --bump minor -p tor-hscrypto
cargo set-version --bump minor -p tor-cell
```
2023-06-30 08:38:16 -04:00
Nick Mathewson a88fa71f25 Resolve XXXs from fixup-features.
Some of these seem spurious: it looks like fixup-features resolved
an issue and then complained about it too.  I'll investigate further.
2023-06-29 17:14:00 -04:00
Nick Mathewson f8ee830a94 Run "cargo sort". 2023-06-29 17:10:27 -04:00
Nick Mathewson 23c67d92e6 Run "fixup-features". 2023-06-29 17:09:52 -04:00
Ian Jackson 3c85863aa1 Merge branch 'exp' into 'main'
tor-error: Make KeystoreFsPermissions experimental for now

See merge request tpo/core/arti!1350
2023-06-29 19:55:06 +00:00
Ian Jackson 9ef65775c9 Merge branch 'validate-client-spec' into 'main'
keymgr: Validate ArtiPaths, replace HsClientSpecifier with generic ArtiPathComponent

See merge request tpo/core/arti!1262
2023-06-29 19:49:30 +00:00
Ian Jackson effded7728 tor-keymgr: When keymgr enabled, enable tor-error's experimental too 2023-06-29 19:51:04 +01:00
Gabriela Moldovan b5e190d05d keymgr: Remove ArtiPath normalization, introduce additional restrictions. 2023-06-29 19:28:22 +01:00
Ian Jackson eb12a6e665 tor-keymgr features: Make "keymgr" disabled by default 2023-06-29 17:43:25 +01:00
gabi-250 9407fe1ab5 Merge branch 'keymgr-tests' into 'main'
keymgr: Add tests for ArtiNativeKeyStore

See merge request tpo/core/arti!1337
2023-06-29 13:02:07 +00:00
Gabriela Moldovan bc447524c2 keymgr: Add tests for ArtiNativeKeyStore::key_path. 2023-06-29 11:54:54 +01:00
Gabriela Moldovan 7732ac131b keymgr: Add support for x25519 keys. 2023-06-27 20:11:07 +01: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
Gabriela Moldovan e46d4fe66f keymgr: Remove blank line to satisfy maint/cargo_sort. 2023-06-22 18:34:20 +01:00
Gabriela Moldovan 273cd70021 keymgr: Define a `keymgr` feature.
The dummy key manager impl from `arti-client` will be moved to
`tor-keymgr` soon. This commit adds a `keymgr` feature flag to
`tor-keymgr` which will eventually be used to choose between the real
key manager API and the dummy one.
2023-06-22 18:07:57 +01: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
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
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