| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| | |
Closes #1455 [PATCH 4(v2)/4]
|
| | |
| |
| |
| | |
Part of #1455 [PATCH 3(v2)/4]
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Part of #1455 [PATCH 2(v2)/4]
- Rework sshkeygen::ed25519_encoded to also work as replacement for
sshkeygen::exists
- Drop sshkeygen::exists
- Rename sshkeygen::{ed25519_encoded -> sshkeygen_ed25519_strings}
- Pull out sshkeygen_ed25519_strings from mod sshkeygen
- Drop mod sshkeygen
|
| | |
| |
| |
| | |
_sigh_
|
| | |
| |
| |
| | |
Closes #1455 [PATCH 4/4]
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Part of #1455 [PATCH 3/4]
Abstract of the test(s):
Encoded (key) A -> Decoded (key) A
Decoded A -> Encoded B
Encoded B -> Decoded B
Assert that Decoded A == Decoded B
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Part of #1455 [PATCH 2/4]
Utils include:
- mod sshkeygen
- sshkeygen::exists - check if ssh-keygen is available
- sshkeygen::ed25519_encoded - generate encoded Ed25519 keys
|
| |/
|
|
|
|
|
| |
TestSpecifier::new(prefix: ...) -> new(suffix: ...)
Prefix is given by TestSpecifier::path_prefix() which returns
const TEST_SPECIFIER_PATH = "..."
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
We want to require that whenever we generate a key that's persistent
(stored in KeyMgr), it's going to be made from a stronger-than-usual
Rng. This trait helps us enforce that.
We also add a FakeEntropicRng struct to use for testing.
Note that this turned up a case that we'd missed, which required
an internal change in tor-hsservice.
|
| |
|
|
| |
- `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
|
| |\
| |
| |
| |
| |
| |
| | |
tor-keymgr: Resolve TODOs from key_specifier::tests
Closes #1889
See merge request tpo/core/arti!2849
|
| | | |
|
| |/ |
|
| |
|
|
|
| |
This took a little refactoring, since derive_more::Foo
no longer re-exports std::ops::Foo.
|
| | |
|
| |
|
|
| |
Closes #1396
|
| |
|
|
| |
Part of #1396
|
| |
|
|
|
|
|
| |
This helps us get rid of our uses of `KeyUnknownCert`. Needed because
`KeyUnknownCert` can't readily be converted back to `EncodedEd25519Cert`
(while `ParsedEd25519Cert` *can* -- see the `certs` module from
`tor-relay-crypto`).
|
| |
|
|
|
|
| |
This updates and reenables the cert management tests.
Part of #1768
|
| | |
|
| |
|
|
|
|
|
| |
This will soon be used, when we modify the `ArtiNativeKeystore` cert
lookup code to actually parse certificates before returning them.
Part of #1768
|
| |
|
|
|
|
|
|
| |
This is necessary because `ParsedCert`s will not be `EncodableItem`s.
This is because we cannot (and don't want to) write certificates that
have not yet been validated to the keystore. They do need to be
retrievable from the keystore though, so we also change `ErasedKey`
to be `Box<dyn ItemType>` instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need two different types to represent
* certs that have been parsed, but not yet validated
(`KeyUnknownCert`)
* newly generated encodable certs (`EncodedEd25519Cert`)
Currently, we don't use `KeyUnknownCert` anywhere, and instead use
`EncodedEd25519Cert` to represent "parsed" but not-yet-validated certs.
This approach is wrong and relies on a broken (no-op)
`EncodedEd25519Cert::from_bytes` implementation. A future commit will
address this problem by replacing `EncodedEd25519Cert::from_bytes` with
`Ed25519Cert::decode` to actually parse the cert upon retrieving it from
the keystore.
|
| |
|
|
|
|
|
|
| |
In practice, we won't be able to obtain an `ToEncodableCert` type from
an `EncodableItem` cert without validating it first, so we need to
collapse `validate` into `from_encodable_cert`.
Part of #1768
|
| |\
| |
| |
| |
| | |
clippy: deny `mod_module_files`
See merge request tpo/core/arti!2689
|
| | |
| |
| |
| |
| |
| | |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |/ |
|
| |
|
|
|
| |
This replaces a placeholder error with a concrete
`KeystoreCorruptionError` variant.
|
| | |
|
| | |
|
| |
|
|
|
| |
This makes `ArtiNativeKeystore::get` deserialize the keystore item as a
cert, if its `KeystoreItemType` is `Cert`.
|
| |
|
|
|
| |
We'll soon use this in `ArtiNativeKeystore`'s `Keystore` implementation
for parsing certs read from disk.
|
| | |
|
| |
|
|
|
| |
We're about to reuse TestKey as our test key "certificate",
so let's preemptively rename it to something more fitting.
|
| |
|
|
| |
This is about to be used in a couple of places.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
These aren't needed anymore now that `KeySpecifierComponent` is in
scope.
|
| |
|
|
| |
This will be used for looking up certificates in the keystore.
|
| |
|
|
|
| |
We're soon going to need the "raw" version of the function (the one that
returns the key as `K::Key`).
|
| |
|
|
|
| |
These will be soon be returned by
`KeyMgr::{get_key_and_cert,get_or_generate_key_and_cert}`.
|
| |
|
|
|
| |
This will enable us to store `tor_cert::EncodedEd25519Cert`s in the
keystore.
|
| | |
|
| | |
|
| | |
|