summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge branch 'insert' into 'main'Nick Mathewson2023-06-161-23/+65
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | rpc: Make CastTable::insert be more type-safe See merge request tpo/core/arti!1253
| * | | | rpc: Remove some verbiage about 'static, and demo that it's OK withoutIan Jackson2023-06-151-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's now not actually possible to write code that doesn't work, even if `Tr` *isn't* 'static, because of the bounds on `CastTable::insert`. I tried to produce a non-working setup with a non-static `Simple`, but you can't implement `Object` for such a thing. Removing 'static from Object would stop the downcasts from Any to Object working. Prior to the new typesafe insert, this change - let f: fn(&dyn $crate::Object) -> &(dyn $traitname + 'static) = |self_| { + let f: fn(&dyn $crate::Object) -> &(dyn $traitname) = |self_| { would result in a runtime crash. Now it results in a compiler error.
| * | | | rpc: Give the name `O` to "the type associated with this CastTable"Ian Jackson2023-06-151-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was locally bound to `S` in one place. Bind and use it throughout. Since this is an RPC object, `O` is a better name. In each item, use the description once and thereafter just the name.
| * | | | rpc: Add Simple test case for CastTableIan Jackson2023-06-151-3/+20
| | | | |
| * | | | rpc: Move boxing from macro to CastTable::insert (formatting)Ian Jackson2023-06-151-3/+1
| | | | |
| * | | | rpc: Move boxing from macro to CastTable::insertIan Jackson2023-06-151-4/+4
| | | | |
| * | | | rpc: Make CastTable::insert be more type-safeIan Jackson2023-06-151-6/+21
| | |/ / | |/| | | | | | | | | | This checks the Requirements.
* | | | arti-client: rustfmtGabriela Moldovan2023-06-151-3/+8
| | | |
* | | | arti-client: Fix clippy lints.Gabriela Moldovan2023-06-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | We need to allow some lints in the dummy key manager because its implementation needs to mirror that of `tor_keymgr::KeyMgr` (so we can't apply the API changes suggested by clippy).
* | | | keymgr: Add Diziet's notes about storing public keys in the key store.Gabriela Moldovan2023-06-151-0/+36
| | | |
* | | | arti-client: Use a dummy key manager if the keymgr feature is disabled.Gabriela Moldovan2023-06-157-8/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TorClient now only uses the tor_keymgr::KeyMgr implementation if the keymgr experimental feature is enabled. If the feature is disabled, a dummy key manager implementation is used. The new `keymgr` feature depends on `onion-client`, because the key manager is only used for HS client auth.
* | | | arti-client: Implement From<tor_keymgr::Error> for Error.Gabriela Moldovan2023-06-152-4/+9
| | | |
* | | | keymgr, arti-client: KeyMgr should return Ok(None) if the key is not found.Gabriela Moldovan2023-06-152-28/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies usage quite a bit and will enable us to implement a dummy `KeyMgr` that doesn't depend on the error types from tor-keymgr (which will replace the "real" `KeyMgr` if the keymgr feature is disabled).
* | | | keymgr: Add TODO regarding KeyStore rename.Gabriela Moldovan2023-06-151-0/+4
| | | |
* | | | keymgr: Add TODO about KeyType refactorings.Gabriela Moldovan2023-06-151-0/+3
| | | |
* | | | keymgr: Add the key type to the `arti_extension`.Gabriela Moldovan2023-06-151-1/+2
| | | |
* | | | arti_client: Add TODO about refactoring code around HsClientSecretKeysBuilder.Gabriela Moldovan2023-06-151-0/+4
| | | |
* | | | keymgr: Add TODO regarding some error refactorings.Gabriela Moldovan2023-06-151-0/+14
| | | |
* | | | keymgr: Move the HS client and service key specifiers out of tor-keymgr.Gabriela Moldovan2023-06-1510-123/+123
| | | | | | | | | | | | | | | | | | | | | | | | The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to `tor-hsclient`. The HS service secret key specifier stubs are moved to `tor-hsservice`.
* | | | keymgr: Expand the TODOs regarding HS service key specifiers.Gabriela Moldovan2023-06-151-3/+18
| | | | | | | | | | | | | | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* | | | keymgr: Expand HsClientSpecifier docs, add TODO about refactoring.Gabriela Moldovan2023-06-151-0/+7
| | | | | | | | | | | | | | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* | | | arti-client, keymgr: Initialize KeyMgr with an ArtiNativeKeyStore.Gabriela Moldovan2023-06-151-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The `KeyMgr` is now initialized with an `ArtiNativeKeyStore` built from an invalid key store root dir (this is alright for the purposes of this proof-of-concept, since `ArtiNativeKeyStore::new` won't fail as it doesn't currently validate the keystore root dir).
* | | | keymgr: Introduce ToEncodableKey to simplify lookups.Gabriela Moldovan2023-06-154-20/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This means `KeyMgr` users don't need to specify the underlying key type (e.g. `ed25519::Keypair`) when retrieving keys. Instead, they can just specify the type required (as long as it implements `ToEncodableKey`), e.g. `HsClientIntroAuthKeypair`.
* | | | arti-client: Make the client use the KeyMgr.Gabriela Moldovan2023-06-153-3/+88
| | | | | | | | | | | | | | | | | | | | `TorClient` now uses a `KeyMgr` to retrieve the `HsClientSecretKeys` client auth keys passed to `get_or_launch_connection`.
* | | | keymgr: Add key manager implementation stub.Gabriela Moldovan2023-06-153-1/+116
| | | |
* | | | keymgr: Implement `SshKeyType::read_ssh_format_erased` for `KeyType`.Gabriela Moldovan2023-06-151-4/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a proof-of-concept `SshKeyType::read_ssh_format_erased` implementation for `KeyType`. The implementation decodes an OpenSSH key and converts it to one of the key types used internally by Arti. The value returned is type-erased, and will be downscast later down the line by the `KeyMgr` (note: `KeyMgr` doesn't exist yet). The `SshKeyType::write_ssh_format` will be implemented once these APIs are a bit more stable.
* | | | keymgr: Add ArtiNativeKeyStore implementation skeleton.Gabriela Moldovan2023-06-1510-0/+558
| | | | | | | | | | | | | | | | | | | | This adds implementation stubs for `ArtiNativeKeyStore`, and introduces the traits needed to make the `KeyStore` APIs work.
* | | | hsclient: Change builder error return type to ConfigBuildError.Gabriela Moldovan2023-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It's not perfectly clear what this error type should be, so let's use `ConfigBuildError` for now (it makes things easier in `arti-client`, as we already have an `ErrorDetail` for it).
* | | | tor-hsclient: Make Untried a {}-less unitIan Jackson2023-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1247#note_2912642 It's unlikely this will grow any content, so fine.
* | | | tor-hsclient: Insert a blank linegabi-2502023-06-151-0/+1
| | | |
* | | | tor-hsclient: Docs improvements.gabi-2502023-06-151-2/+2
| | | |
* | | | tor-hsclient: Remove two done TODOsIan Jackson2023-06-151-2/+0
| | | |
* | | | tor-hsclient: provide intro_index accessor for FailedAttemptError (xref)Ian Jackson2023-06-151-1/+2
| | | | | | | | | | | | | | | | Add a cross-reference to docs arising from MR comments in !1246.
* | | | tor-hsclient: Actually store our IPT experiencesIan Jackson2023-06-151-7/+42
| | | |
* | | | tor-hsclient: intro_rend_connect: bind `outcome`Ian Jackson2023-06-151-3/+3
| | | | | | | | | | | | | | | | This will be used in a moment.
* | | | tor-hsclient: Actually choose which intro points to useIan Jackson2023-06-151-3/+75
| | | | | | | | | | | | | | | | | | | | Right now this just always chooses randomly because nothing stores anything in the HashMap.
* | | | tor-hsclient: Introduce RelayIdForExperienceIan Jackson2023-06-151-9/+37
| | | | | | | | | | | | | | | | | | | | Wrap this up in a newtype so we don't accidentally use it for anything else. Provide two constructors, one for storing and one for lookups.
* | | | tor-hsclient: Add random sort key to UsableIptIan Jackson2023-06-151-0/+6
| | | |
* | | | tor-hsclient: provide intro_index accessor for FailedAttemptErrorIan Jackson2023-06-152-1/+24
| | | |
* | | | tor-error: Introduce `LooseCmpRetryTime`Ian Jackson2023-06-152-0/+20
|/ / / | | | | | | | | | | | | Having a newtype for this kind of thing is considerably more convenient. I'm going to use this in a moment.
* | | Merge branch 'pt-snowflake-fix' into 'main'Ian Jackson2023-06-141-5/+13
|\ \ \ | | | | | | | | | | | | | | | | make snowflake example feature-gated See merge request tpo/core/arti!1249
| * | | make snowflake example feature-gatedtrinity-1686a2023-06-141-5/+13
| |/ /
* | | tor-hsclient: InvalidTarget::ImpossibleRelayIds is RetryTime::NeverIan Jackson2023-06-141-1/+1
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1246#note_2912105
* | | tor-hsclient: Correction to HasRetryTime for InvalidTarget docNick Mathewson2023-06-141-1/+2
| | |
* | | tor-hsclient: Add doc for HasKind for FailedAttemptErrorIan Jackson2023-06-141-0/+16
| | | | | | | | | | | | | | | There is a cross-reference here to code (`IptSortKey`) in another branch that I haven't made an MR for yet.
* | | tor-hsclient: Add docs and comments about HasRetryTime for InvalidTargetIan Jackson2023-06-141-0/+18
| | |
* | | tor-cell: HasRetryTime for IntroduceAckStatus: Confirm re CANT_RELAY (fmt)Ian Jackson2023-06-141-1/+1
| | | | | | | | | | | | | | | rustdoc insisted on misindenting this before, and now it insists on un-mis-indenting it.
* | | tor-cell: HasRetryTime for IntroduceAckStatus: Confirm re CANT_RELAYIan Jackson2023-06-141-1/+1
| | | | | | | | | | | | | | | Remove this todo as per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1246#note_2912104
* | | tor-cell: Add a doc comment for impl tor_error::HasRetryTime for ↵Ian Jackson2023-06-141-0/+4
| | | | | | | | | | | | IntroduceAckStatus
* | | tor-hsclient: impl HasRetryTime for FailedAttemptErrorIan Jackson2023-06-142-2/+25
| | |