summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'fix-nightly-ci' into 'main'Nick Mathewson2022-08-091-1/+1
|\ \ \ | | | | | | | | | | | | | | | | fix nighly ci See merge request tpo/core/arti!668
| * | | fix nighly citrinity-1686a2022-08-081-1/+1
| | |/ | |/|
* | | Merge branch 'fix-android-runtime' into 'main'eta2022-08-093-12/+45
|\ \ \ | | | | | | | | | | | | | | | | fix fs-misstrust on android See merge request tpo/core/arti!667
| * | | fix fs-misstrust on androidtrinity-1686a2022-08-083-12/+45
| |/ / | | | | | | | | | | | | | | | it would fail to link at runtime due to missing getgrnam_r in bionic and then it would fail again because some directory is group writeable
* | | Merge branch 'shellexpand' into 'main'eta2022-08-092-27/+6
|\ \ \ | |/ / |/| | | | | | | | Update shellexpand, and switch to non-fork See merge request tpo/core/arti!661
| * | Update shellexpand, and switch to non-forkIan Jackson2022-08-052-27/+6
|/ / | | | | | | | | | | | | | | Now we have bus>1 ownership of the crate name `shellexpand`. I have made a release, and retired `shellexpand-fork`. The new shellexpand release switches to a (quite similarly) unforked version of `dirs`.
* | Merge branch 'establish-rendezvous' into 'main'Ian Jackson2022-08-053-1/+80
|\ \ | | | | | | | | | | | | Implement establish rendezvous cell See merge request tpo/core/arti!651
| * | Implement establish rendezvous cellYuan Lyu2022-08-053-1/+80
|/ /
* | Merge branch 'zeroize' into 'main'Nick Mathewson2022-08-0418-84/+306
|\ \ | | | | | | | | | | | | | | | | | | Revise our handling of the zeroize trait Closes #254 See merge request tpo/core/arti!655
| * | ZeroizeStrategy.md: Clarify which list we're referring to.Nick Mathewson2022-08-041-4/+4
| | |
| * | tor-proto: Use correct SecretBuf in handshakes.Nick Mathewson2022-08-014-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | Everything that is a secret encryption key, or an input that is used to produce a secret encryption key, has to get zeroized. And that's all! Closes #254.
| * | tor-proto: Replace SecretBytes with SecretBuf.Nick Mathewson2022-08-018-63/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does not yet make sure that `SecretBuf` is used where it _should_ be, but at least it ensures that most uses of `SecretBytes` will indeed act as intended, and make sure that whatever they contain is zeroized. It requires some corresponding changes to method calls for correctness and type conformance.
| * | New SecretBuf type in tor-bytesNick Mathewson2022-08-015-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | This Writer is a simple wrapper around `Vec<u8>` that makes sure that its contents are cleared whenever they are dropped _or reallocated_. The reallocation is the important part here: without that, we risk not zeroizing the first allocation of the buffer.
| * | Add TODO comments about unwanted copies.Nick Mathewson2022-08-011-0/+2
| | |
| * | tor-llcrypto: make AES key objects ZeroizeOnDrop when using opensslNick Mathewson2022-08-011-0/+3
| | | | | | | | | | | | Part of #254.
| * | Stop deriving Zeroize for RsaIdentity.Nick Mathewson2022-08-011-2/+1
| | | | | | | | | | | | These are not secret.
| * | Use the `zeroize` feature in several cratesNick Mathewson2022-08-013-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using `zeroize` here tells these crates that they should make various structures zeroize-on-drop. (This is not yet implemented in `aes` 0.8.1, but support has been merged in the repository for `aes`, so it should go out in the next release.) No corresponding feature flag is needed to enable zeroize-on-drop for `rsa` and `*25519-dalek` private keys.
| * | Initial document describing our plans for zeroizeNick Mathewson2022-08-011-0/+76
| | |
* | | Merge branch 'delete-unused-import' into 'main'Nick Mathewson2022-08-041-2/+1
|\ \ \ | | | | | | | | | | | | | | | | Delete unused Enum and fileinput in maint file See merge request tpo/core/arti!660
| * | | Delete unused Enum and fileinput in maint fileFAMASoon2022-08-041-2/+1
| | | |
* | | | Merge branch 'provide_params_too' into 'main'Nick Mathewson2022-08-045-0/+61
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Add params() method to NetDirProvider Closes #528 See merge request tpo/core/arti!658
| * | | Finish implementation of params() for DirMgr.Nick Mathewson2022-08-023-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it maintains an up-to-date set of default parameters to be handed out if there is no directory. Closes #528.
| * | | Add params() method to NetDirProvider, and partial implementationNick Mathewson2022-08-022-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | This method will let users get the latest `NetParameters`, with user-configured overrides, even if there is no current directory at all. Part of #528
* | | Merge branch 'inc-rename' into 'main'Ian Jackson2022-08-024-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Rename `.inc` and other included files to end in `.rs` Closes #381 See merge request tpo/core/arti!645
| * | | Rename `.inc` and other included files to end in `.rs`eta2022-07-264-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to mitigate syntax highlighting issues and a rust-analyzer bug (https://github.com/rust-analyzer/rust-analyzer/issues/10178), rename files that are included with the `include!` macro to have a `.rs` extension. Make sure the included files are outside `src/`, in order to not confuse humans and automated editing tools that might mistake them for valid Rust modules. fixes arti#381
* | | | Merge branch 's-micros-millis' into 'main'Ian Jackson2022-08-021-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tor-rtcompat: s/micros/millis inside a flaky test Closes #515 See merge request tpo/core/arti!644
| * | | | tor-rtcompat: s/micros/millis inside a flaky testeta2022-07-261-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The other tests wait for 100 milliseconds; this one waits for 100 *microseconds* for some reason, which meant it was understandably flaky if run on anything less than perfect conditions (arti#515). This is probably a typo, so just change it. fixes arti#515
| | | * tor-proto: Unify the check_match code in channel and handshakeNick Mathewson2022-08-104-46/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This had to become a new internal function, since at the point that the handshake needs this code, it does not yet have a Channel to use. This change made the error messages in the handshake code more informative: and now they require a regex to check. Later, we might want to defer formatting these strings, but I don't think we need to do it now.
| | | * tor-netdir: Add a static assertion about RelayIdType::COUNTNick Mathewson2022-08-104-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing this will make sure that we fix a correctness issue in netdir that will be caused if we add more IDs. (Also add RelayIdType::COUNT in tor-linkspec.)
| | | * Implement `Into<RelayIdRef>` for `&RelayId`.Nick Mathewson2022-08-101-0/+6
| | | | | | | | | | | | | | | | | | | | This will let us use `&RelayId` in all the places that take `Into<RelayIdRef>`.
| | | * Make sure all HasRelayIds constaints allow ?Sized.Nick Mathewson2022-08-102-16/+25
| | | |
| | | * netdir: remove long-unused missing_descriptor_for codeNick Mathewson2022-08-102-23/+2
| | | |
| | | * tor-netdir: Remove or hide some no-longer-used accessors.Nick Mathewson2022-08-101-29/+13
| | | | | | | | | | | | | | | | | | | | The hidden ones are only used to implement higher-level accessors; the others are not used at all.
| | | * tor-netdir: Collapse by_id and by_relay_id into a single fn.Nick Mathewson2022-08-105-58/+71
| | | | | | | | | | | | | | | | | | | | | | | | There are some downstream changes required for this to work, but they are all just unit tests that could no longer infer the type of an Ed25519 key.
| | | * Final (?) API revisions for tor-linkspecNick Mathewson2022-08-1022-223/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, each individual identity type becomes optional. The functions that expose them unconditionally are now in a "legacy" trait that only some downstream types are expected to implement. There are new convenience APIs in HasRelayIds: * to return Option<&keytype>, * to see if one identity-set contains another. This commit will break several downstream crates! For the reviewer's convenience, I will put the fixes for those crates into a series of squash! commits on this one. tor-netdir ---------- Revise tor-netdir to accept optional identities. This required some caveats and workarounds about the cases where we have to deal with a key type that the tor-netdir code does not currently recognize at all. If we start to add more identity types in the future, we may well want more internal indices in this code. tor-proto --------- In order to make tor-proto support optional identities, there were fewer changes than I thought. Some "check" functions needed to start looking at "all the ids we want" rather than at "the two known IDs"; they also needed to accommodate that case where we don't have an ID that we demand. This change will also help with bridges, since we want to be able to connect to a bridge without knowing all of its IDs up front. The protocol currently _requires_ the two current ID types in some places. To deal with that, I added a new `MissingId` error. I also removed a couple of unconditional identity accessors for chanmgr; code should use `target().identity(...)` instead. tor-chanmgr ----------- This is an incomplete conversion: it does not at all handle channel targets without Ed25519 identities yet. It still uses those identities to index its internal map from identity to channel; but it gives a new `MissingId` error type if it's given a channel target that doesn't have one. We'll want to revise the map type again down the road when we implement bridges, but I'd rather not step on the channel-padding work in progress right now. tor-guardmgr ------------ This change is mostly a matter of constructing owned identity types more sensibly, rather than unwrapping them directly. There are some places marked with TODOs where we still depend on particular identity types, because of how the directory protocol works. This will need revisiting when we add bridge support here. tor-circmgr ----------- These changes are just relatively simple API changes in the tests.
| | | * linkspec: Add more accessors (some internal) for ids.Nick Mathewson2022-08-101-0/+68
| | | | | | | | | | | | | | | | These will all be used shortly.
| | | * Remove get_ed_identity_key as unused.Nick Mathewson2022-08-101-23/+0
| | | |
| | | * Introduce a RelayIdSet and use it in place of HashSet<RelayId>.Nick Mathewson2022-08-107-20/+167
| | | | | | | | | | | | | | | | | | | | This makes lookups a little more efficient. I do with that HashSet just supported this use-case, but for now this seems our best option.
| | | * Teach guard restrictions about RelayId.Nick Mathewson2022-08-105-16/+60
| | | | | | | | | | | | | | | | | | | | This implementation is (sadly) too copy-heavy or now, because HashSet<RelayId> can't be indexed with RelayIdRef.
| | | * Parsing, encoding, and serde for RelayId.Nick Mathewson2022-08-104-5/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formats used here are backward-compatible with those used by C tor and those used elsewhere in our code. We need a way to encode _both_ current kinds of identities as a string that tells you what kind of ID they are. Traditionally we have used hexadecimal, sometimes with a $, for RSA ids, and we have used base64 for Ed25519 IDs. We also introduce a new forward-compatible format for new identity keys in the future. (The new format is the key identity type, a colon, and the id encoded as base64.) We will use this new format _only_ when we need to encode identities in a way where it would be otherwise unclear what kind of key we are dealing with.
| | | * Use accessors in two places where tests look at specific keys.Nick Mathewson2022-08-102-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | (It's safe to require these specific keys, since we constructed the objects for testing, and we know for certain that they contain given keys.)
| | | * Add a set of Identity-related types and accessors.Nick Mathewson2022-08-106-2/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I wonder if these types are correct. I think it makes sense to have a Ref type like this, rather than just using `&RelayId`, but it doesn't seems that I can make `RelayId` and `RelayIdRef` implement Borrow and ToOwned for one another, so maybe I've messed up.
| | | * Define a constant for ED25519 identity length.Nick Mathewson2022-08-102-3/+8
| | | |
| | | * guardmgr: Avoid a case of using HasRelayIds key methods.Nick Mathewson2022-08-021-1/+1
| | | |
| | | * netdir: Add and use a new ids_listed() function.Nick Mathewson2022-08-022-1/+10
| | | |
| | | * Avoid a simple usage of ed_identity() in circmgr testsNick Mathewson2022-08-021-2/+1
| | | |
| | | * Introduce HasRelayIds::same_relay_ids.Nick Mathewson2022-08-026-23/+33
| | | | | | | | | | | | | | | | | | | | This method tells if two HasRelayIds contain exactly the same set of Relay identities, and is generally useful for debugging.
| | | * guardmgr: Change APIs that used to take IDs.Nick Mathewson2022-08-023-24/+19
| | | | | | | | | | | | | | | | These are the other inspiration for #428.
| | | * guardmgr: Replace IdPair with RelayIdsNick Mathewson2022-08-024-30/+31
| | | | | | | | | | | | | | | | I believe that this was the original motivation behind #428.
| | | * Implement serde traits on RelayIds.Nick Mathewson2022-08-023-2/+7
| | | | | | | | | | | | | | | | | | | | This will allow RelayIds to replace IdPair in tor-guardmgr. (The fields are named accordingly with `serde(rename)`.)