summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | Revert "keymgr: Require callers to be explicit about which keystore to get ↵Gabriela Moldovan2023-07-214-41/+28
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | keys from." This reverts commit 38a6c74c7894dc96b16c9039cacc2a4023977b05. This also updates some tests to make them compile with the reverted version of the code.
| * | | | keymgr: Require callers to be explicit about where to remove keys from.Gabriela Moldovan2023-07-202-16/+67
| | | | | | | | | | | | | | | | | | | | | | | | | As with `KeyMgr::insert`, only `KeystoreSelector::Id` and `KeystoreSelector::Default` are supported.
| * | | | keymgr: Add tests for KeyMgr.Gabriela Moldovan2023-07-201-0/+213
| | | | |
| * | | | keymgr: Add EncodableKey::to_bytes for encoding keys.Gabriela Moldovan2023-07-202-0/+13
| | | | | | | | | | | | | | | | | | | | We'll need this to implement `Keystore::insert`.
| * | | | keymgr: Add some extra derives to ArtiPath and KeyType.Gabriela Moldovan2023-07-203-4/+5
| | | | |
| * | | | keymgr: Require callers to be explicit about which keystore to get keys from.Gabriela Moldovan2023-07-204-12/+27
| | | | |
| * | | | keymgr: Move KeyMgr::get impl to Keymgr::get_from_store.Gabriela Moldovan2023-07-201-26/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactoring will make more sense later, when we give `KeyMgr::get` an extra parameter that specifies which keystore to retrieve the key from.
| * | | | keymgr: Remove unimplemented/unnecessary has_key_bundle function.Gabriela Moldovan2023-07-203-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The concept of a "key bundle" would introduce a lot of complexity while providing little to no gain. Some context: ``` Originally, "key bundles" were meant to be the answer to the question "which keystore should insert place keys in?": https://gitlab.torproject.org/tpo/core/arti/-/blob/36606a66ddca9abd1595d13c9397bc812bf24cb5/crates/tor-keymgr/src/mgr.rs#L60-69 However, I'm not so sure anymore that "key bundles" are the answer. I don't think there is any way we can "guess" where a key should go. When inserting/generating a new key, we should either: always write to the same, primary key store, OR require the user to be explicit about which key store the new key should go in (by assigning an ID to each key store and expecting the user to provide it when inserting/generating new keys) I prefer the latter option, because it provides more flexibility, which we're going to need when implementing the key management CLI (which I think should allow users to generate keys anywhere they want, e.g. arti keymgr generate <key type> --keystore hsm ...) ``` For more details, see the discussion on #903. Closes #903
| * | | | keymgr: Require callers to specify which keystore to insert keys in.Gabriela Moldovan2023-07-203-28/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The caller uses `KeystoreSelector` to specify which keystore to insert the new key into (only `KeystoreSelector::Id` and `KeystoreSelector::Default` are supported for `insert`). The ability to insert keys in a particular keystore will come in handy when we implement the key management CLI (the CLI will have an option for specifying the keystore to access/modify).
| * | | | keymgr: Add a convenience function for boxing keystore errors.Gabriela Moldovan2023-07-203-7/+8
| | | | |
| * | | | keymgr: Add an error type for misuse errors.Gabriela Moldovan2023-07-203-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This error will be returned by `KeyMgr` if the caller tries to access a keystore that does not exist, or if the requested `KeystoreSelector` cannot be applied.
| * | | | keymgr: Add type for specifying which keystore to access.Gabriela Moldovan2023-07-202-0/+14
| | | | |
| * | | | keymgr: Add a function for looking keystores up by ID.Gabriela Moldovan2023-07-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This will be used by `KeyMgr::insert` after we add an additional argument to `insert` for specifying the keystore it should be using.
| * | | | keymgr: Add an `id` function to `Keystore`.Gabriela Moldovan2023-07-203-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will enable the `KeyMgr` to look up `Keystore`s by ID (which is a requirement for disambiguating the semantics of `insert`, which currently tries to "guess" which keystore it should be using).
| * | | | keymgr: Iterate over all the stores, not just the secondary ones.Gabriela Moldovan2023-07-201-1/+7
| | | | |
| * | | | keymgr: Explicitly specify the default keystore for `KeyMgr`.Gabriela Moldovan2023-07-204-9/+18
| | | | |
| * | | | keymgr: Add a type alias for `Box<dyn Keystore>`.Gabriela Moldovan2023-07-201-2/+5
| | | | | | | | | | | | | | | | | | | | This makes the code slightly less verbose.
| * | | | keymgr-config: Make fields private, add function for checking if keystore is ↵Gabriela Moldovan2023-07-205-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enabled. Hiding the underlying value of `enabled` enables us to give it a different `auto` value depending on whether the `keymgr` feature is enabled or not (it defaults to `true` if `keymgr` is enabled, and `false` otherwise).
| * | | | arti-client: Use a default keystore config if `experimental-api` is disabled.Gabriela Moldovan2023-07-202-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `experimental-api` was only meant to apply to the use of the unstable `ArtiNativeKeystoreConfig` in the Arti config. `experimental-api` was _not_ supposed to be used for enabling/disabling the keystore (that's what the `enabled` flag is for).
| * | | | arti-client: Move variable closer to where it's used (fmt).Gabriela Moldovan2023-07-201-24/+21
| | | | |
| * | | | arti-client: Move variable closer to where it's used.Gabriela Moldovan2023-07-201-2/+1
| | | | |
| * | | | arti-client: Make the `KeyMgr` optional.Gabriela Moldovan2023-07-201-34/+43
| | | | | | | | | | | | | | | | | | | | | | | | | If the Arti keystore is disabled, we have nothing to initialize the `KeyMgr` with, so we might as well make it optional.
* | | | | Merge branch 'access' into 'main'Ian Jackson2023-07-214-0/+19
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Add getters to a couple of config builders See merge request tpo/core/arti!1425
| * | | | | tor-guardmgr: bridges: fix typo in getter docIan Jackson2023-07-211-1/+1
| | | | | |
| * | | | | tor-guardmgr: bridges: getter for ManagedTransportConfigBuilder.protocolsIan Jackson2023-07-202-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a bit of a wart that tor-ptmgr calls these "protocols" and tor-guardmgr calls these "transport names".
| * | | | | tor-guardmgr: bridges: getter for BridgeConfigBuilder.transportIan Jackson2023-07-202-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BridgeConfigBuilder is Serialize so this isn't making any new API promises. Ideally we'd have getters like this everywhere.
* | | | | | Merge branch 'warn' into 'main'gabi-2502023-07-211-1/+1
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | tor-geoip: Fix a doc warning See merge request tpo/core/arti!1430
| * | | | | tor-geoip: Fix a doc warningIan Jackson2023-07-211-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cargo doc --locked --document-private-items --workspace --all-features warning: unclosed HTML tag `CountryCode` --> crates/tor-geoip/src/lib.rs:90:54 | 90 | /// We store these as NonZeroU8 so that an Option<CountryCode> only has to | ^^^^^^^^^^^^^ | = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
* | | | | Merge branch 'access2' into 'main'Ian Jackson2023-07-212-0/+7
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-linkspec: impl AsRef<str> for PtTransportName See merge request tpo/core/arti!1426
| * | | | | tor-linkspec: impl AsRef<str> for PtTransportNameIan Jackson2023-07-202-0/+7
| |/ / / /
* | | | | Merge branch 'pwd-grp' into 'main'Nick Mathewson2023-07-202-33/+6
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Update pwd-grp to 0.1.1 to fix MacOS build etc. See merge request tpo/core/arti!1427
| * | | | | Update pwd-grp to 0.1.1 to fix MacOS build etc.Ian Jackson2023-07-202-33/+6
| |/ / / / | | | | | | | | | | | | | | | This also gets rid of a duplicate copy of derive-adhoc.
* | | | | Merge branch 'rlimit_up' into 'main'gabi-2502023-07-202-3/+3
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | Bump requirement to rlimit 0.10.1 See merge request tpo/core/arti!1423
| * | | | Bump requirement to rlimit 0.10.1Nick Mathewson2023-07-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a bug in 0.10.0 that broke MacOS. Part of #963.
* | | | | Merge branch 'cc_niche' into 'main'Nick Mathewson2023-07-201-5/+37
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | geoip: Enable the niche optimization for CountryCode. See merge request tpo/core/arti!1384
| * | | | geoip: Use from_raw_parts instead of transmute.gabi-2502023-07-131-1/+5
| | | | |
| * | | | geoip: Enable the niche optimization for CountryCode.Nick Mathewson2023-07-071-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we're going to be using `Option<CountryCode>` all over, let's save the extra byte. Sadly this required std::mem::transmute(), which is unsafe, so maybe we should think twice.
* | | | | Merge branch 'chanmgr_rustdoc_links' into 'main'gabi-2502023-07-191-2/+2
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | Fix a pair of rustdoc links in chanmgr. See merge request tpo/core/arti!1419
| * | | | Fix a pair of rustdoc links in chanmgr.Nick Mathewson2023-07-191-2/+2
|/ / / /
* | | | Merge branch 'issue961_01' into 'main'Nick Mathewson2023-07-191-6/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | geoip: Allow ASNs as zeros when creating NetDefn Closes #961 See merge request tpo/core/arti!1417
| * | | | geoip: Add derive macros to GeoipDbjuga2023-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | to be able to debug it, for instance.
| * | | | geoip: Allow ASNs as zeros when creating NetDefnjuga2023-07-181-6/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | so that GeoipDb can be created from files including ASNs generated with tor/scripts/maint/geoip/geoip-db-tool. Closes #961
* | | | Merge branch 'error' into 'main'Ian Jackson2023-07-1911-29/+105
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Print sources for errors in RetryError Closes #958 See merge request tpo/core/arti!1416
| * | | tor-hsclient: Document API break.Ian Jackson2023-07-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would be a break in higher-layer crates which incorproate this error but: 1. That's just arti-client which hides it behind the detailed errors cargo feature 2. I'm hoping cargo-semver-checks would spot it, anyway.
| * | | retry-error: Attempts must be AsRef<dyn Error>; print their sourcesIan Jackson2023-07-194-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The effect is that everywhere a RetryError is used, the error sources for the contained errors will be Display'd. In tor-hsclient we no longer need to explicitly wrap things up in tor_error::Report.
| * | | retry-error: Introduce a Wrapper type in a testIan Jackson2023-07-193-2/+16
| | | | | | | | | | | | | | | | | | | | We're going to require that a RetryError contains things that are AsRef<dyn Error> and ParseIntError isn't so we need a newtype.
| * | | retry-error: Provide fmt_error_with_sources in retry-errorIan Jackson2023-07-196-17/+69
| | | | | | | | | | | | | | | | | | | | This code came from tor-error. So now tor-error depends on retry-error.
| * | | tor-circmgr: impl AsRef<dyn std::error::Error> for some error typesIan Jackson2023-07-182-0/+4
|/ / / | | | | | | | | | We're about to want this.
* | | Merge branch 'lock' into 'main'gabi-2502023-07-181-3/+30
|\ \ \ | | | | | | | | | | | | | | | | Update Cargo.lock for d-a versions See merge request tpo/core/arti!1414
| * | | Update Cargo.lock for d-a versionsIan Jackson2023-07-181-3/+30
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | !1410 and !1412 had a semantic conflict *in the Cargo lockfile*! !1410 added a new indirect dependency on derive-adhoc, which is used in pwd-grp. pwd-grp is still declaring a dependency on d-a 0.6.1. (This ought to be updated there in due course, but isn't a bug.) !1412 updated our direct dependency on derive-adhoc to require 0.7.x. In fact, the breaking change 0.6.x to 0.7.x is minor and we could have written a more relaxed dependency.But cargo's syntax for that is very clumsy - here is an example from derive-adhoc iteself: itertools = ">=0.10.1, <0.12" Fix this for now in our tree with a `cargo update`, to unbreak main.