| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Accidentally left out in the previous commit.
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit implements support for extra-info requests in tor-dirclient.
It is gated behind the already existing `routerdesc` feature flag,
because entities building upon router descriptors most likely also need
extra-info, namely directory mirrors and directory authorities.
The implementation is largely based upon the existing one for router
descriptors, as they are of a very similar request format, most likely
due to simply being closely related anyways.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This way we get the whole task job to be aligned on one single now value
to avoid potential inconsistencies between expiry and key generation.
Fixes #2404
Signed-off-by: David Goulet <[email protected]>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Tests the key rotation code.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This way we can unit tests properly.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is almost a full rewrite of the crypto task which was needed in
order to support our relay signing certificate to be put in the keystore
which will be needed for the offline key feature.
Instead of having rotate_key() do all the things, we now instead do two
pass:
1. Remove all expired keys and certs.
2. Generate any missing keys.
This still results in using the minimum valid_until of all our keys for
the task sleep time.
We can know cleanup the local trait used for this gymnastic and trade it
for some more KeyMgr gymnastic.
Fixes #2404
Signed-off-by: David Goulet <[email protected]>
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We documented our SystemTime-to-expiry conversion as always rounding
_up_, but we did not account for fractional seconds when doing so.
Therefore, if the requested expiration was set partway through the
first second of an hour, the conversion would round down.
This patch fixes that, and adds a regression test. I've confirmed
that the test fails without this patch.
Closes #2407
|
| | |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
These certificates use a weird expiration format: counting hours
since the unix epoch. Previously we had it implemented in two
different places. This patch centralizes it, since we are about to
become slightly more complicated.
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This moves the logic for retrieving a public key from its corresponding
keypair into `get_from_store()`.
Fixes a bug which made it impossible to retrieve a public key using the
key specifier of its keypair type with any function other than
`KeyMgr::get()`.
|
| | | | |
| | | |
| | | |
| | | | |
This will be fixed in the next commit.
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
I am about to repurpose this test helper for other item types too.
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
This will enable us to test the provenance of public keys.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is needed now that `get_or_generate_key_and_cert()`
uses the keypair specifier when generating the subject key.
Without this the cert retrieval tests fail because
`get_or_generate_key_and_cert()` now requires the subject key specifier
to have an associated keypair specifier ("KeyCertificateSpecifier has no
keypair specifier for the subject key?").
Note that even with this patch, the `get_cert_entry()` test still fails
because of a bug in the `get_*()` family of functions. This will be
fixed in a future commit.
|
| | |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
When generating a new keypair, we want to use the keypair specifier of
the subject key. Fixes a bug where this code was incorrectly generating
a keypair using the specifier of the public key type (the resulting
generated key had a `kp_` prefix instead of `ks_`).
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Upstream `ssh-key` is missing some important features we need for
arti-relay:
* a bug fix without which we can't convert deserialized RSA keys to
their rsa counterparts: https://github.com/RustCrypto/SSH/pull/318
* @wesleyac 's patch https://github.com/RustCrypto/SSH/pull/412 for
allowing insecure (1024 bits long) RSA keys (needed because the
relay KS_relayid_rsa identity keys are 1024 bits long)
We plan to switch back to mainline `ssh-key` when `ssh-key 0.7.0` comes
out.
See the discussion in #2398 for more details.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
proto: Add more logging to the new circuit reactors
See merge request tpo/core/arti!3776
|
| | | | | |
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Fix various typos
See merge request tpo/core/arti!3781
|
| | | | | | |
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
RPC: Provide superuser mode
Closes #2285
See merge request tpo/core/arti!3743
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is not exactly the most _urgent_ superuser functionality,
but it is probably the easiest to implement.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When connection point provides superuser support, provide a
(currently inert) RpcSuperuser object to the RPC session.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Currently does nothing.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
This makes it a little easier to drop unwanted capabilities.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The Connection will know the options that the listener was created
with, as opposed to RpcMgr, which is the same for every listener.
|
| | | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
(For now, the su capability doesn't actually do anything,
and there is no ability to actually have a session start with one.)
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Disable use-statements which are only needed for unix.
|
| | |/ / /
|/| | |
| | | |
| | | | |
Fix a typo in use-statement for windows.
|
| |/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This may help fix our CI cross compilation tests on platforms
without a C compiler install. In any case, it may speed up non-test
builds by a tiny bit.
Possible solution for #2366.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
arti-relay: Log relay identities
See merge request tpo/core/arti!3773
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
This tests that the `KeyMgr` returns an error if you try to retrieve an
invalid cert.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is a bit of a hack, but we need it to make the tests pass.
The issue is that our test keystore stores `TestItem`s, and all our
other test used `TestItem` as their key types. Now that we have certs,
we have this concept of a `ToEncodableCert::ParsedCert`, which is what
the keymgr downcasts the retrieved certs to before validating them and
returning the final cert result (which is usually going to be of a
different type than `ParsedCert`).
This wrapper ensures that the keystore returns the expected `ParsedCert`
type, so that validation doesn't fail.
Before this change, we were hackily returning `TestItem` in the tests,
even for certificates, but that doesn't work anymore, because the
`ItemType` impl of `TestItem` returns `KeyType::Ed25519Keypair`, which
is obviously not a `CertType`. Using it resulted in an error because
there is a mismatch between the cert `ItemType` (`Ed25519Keypair`) and
the `ItemType` of the `KeystoreItem::Cert` entry (`Ed25519TorCert`).
Normally this wouldn't happen, but the whole test keystore
implementation is funky and inconsistent.
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This will enable us to test against other keymgr APIs (e.g.
`list_matching()`), which require some extra trait impls that get
generated for free by our new `CertSpecifier` macro.
|
| | | | | |
|