summaryrefslogtreecommitdiff
path: root/crates/tor-llcrypto
Commit message (Collapse)AuthorAgeFilesLines
* Bump crate versions in preparation for v1.1.5 release.Nick Mathewson2023-06-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated with the following commands: ``` cargo set-version --bump minor -p tor-cell cargo set-version --bump minor -p tor-linkspec cargo set-version --bump minor -p tor-proto cargo set-version --bump minor -p tor-netdoc cargo set-version --bump minor -p tor-circmgr cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-basic-utils cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-hscrypto cargo set-version --bump patch -p tor-checkable cargo set-version --bump patch -p tor-async-utils cargo set-version --bump patch -p caret cargo set-version --bump patch -p fs-mistrust cargo set-version --bump patch -p safelog cargo set-version --bump patch -p retry-error cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-events cargo set-version --bump patch -p tor-units cargo set-version --bump patch -p tor-rtcompat cargo set-version --bump patch -p tor-rtmock cargo set-version --bump patch -p tor-protover cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-socksproto cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-congestion cargo set-version --bump patch -p tor-persist cargo set-version --bump patch -p tor-chanmgr cargo set-version --bump patch -p tor-ptmgr cargo set-version --bump patch -p tor-guardmgr cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-hsclient cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p arti-rpcserver cargo set-version --bump patch -p arti-config cargo set-version --bump patch -p arti-hyper cargo set-version --bump patch -p arti cargo set-version --bump patch -p arti-bench cargo set-version --bump patch -p arti-testing ```
* llcrypto: Don't take or return "unescorted" ed25519 keys.Nick Mathewson2023-05-182-20/+41
| | | | | | | | | | | | Per #798, we want to make sure that we never pass around an `ed25519::SecretKey`; only an `ed25519::Keypair` (or `ExpandedKeypair`). This is because, when you're computing an ed25519 signature, you have to use the public key as one of your inputs, and if you ever use a mismatched public key you are vulnerable to a nonce reuse attack. (For more info see https://moderncrypto.org/mail-archive/curves/2020/001012.html )
* llcrypto: Add an `ed25519::ExpandedKeypair` type.Nick Mathewson2023-05-181-0/+25
| | | | | | | | This is like an `ed25519::Keypair`, except that instead of a `SecretKey` it contains an `ExpandedSecretKey`. We'll be using this to implement #798, where we impose a rule that there must be no "unescorted" ed25519 secret keys.
* Revise all XXXXs from fixup-featuresNick Mathewson2023-05-151-11/+8
|
* Run fixup-features _with_ annotations.Nick Mathewson2023-05-151-0/+6
| | | | | This litters our Cargo.toml files with "XXX" entries that we should fix.
* Run fixup-features --no-annotate for initial Cargo.toml fixes.Nick Mathewson2023-05-151-0/+1
| | | | | | | | | This does the following: - Gives every crate a `full`. - Cause every `full` to depend on `full` from the lower-level crates. - Makes every feature listed _directly_ in `experimental` depend on `__is_experimental`.
* Merge branch 'better-fixup-features' into 'main'Nick Mathewson2023-05-151-2/+4
|\ | | | | | | | | Revise fixup-features to be closer to something we can use See merge request tpo/core/arti!1180
| * Mark an initial set of non-additive features.Nick Mathewson2023-05-151-2/+4
| |
* | Use non-deprecated *Secret::random_from_rng.Nick Mathewson2023-05-131-1/+1
| | | | | | | | The `new` function is deprecated in x25519-dalek 2.0.0-rc.2
* | llcrypto: upgrade x25519-dalek.Nick Mathewson2023-05-131-1/+1
|/ | | | | | | | This upgrades us to 2.0.0-rc.2, which is the latest in the not-quite-done-yet 2.0 series. The only code change that's absolutely needed is opting into the static_secrets feature.
* update rsa to 0.9.xtrinity-1686a2023-05-082-6/+5
|
* Increment crate versions.Nick Mathewson2023-05-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the errorkind bumps, we're calling this a breaking change in everything lower-level than `arti`. Generated with: ``` cargo set-version -p tor-basic-utils --bump minor cargo set-version -p tor-async-utils --bump minor cargo set-version -p caret --bump minor cargo set-version -p fs-mistrust --bump minor cargo set-version -p safelog --bump minor cargo set-version -p retry-error --bump minor cargo set-version -p tor-error --bump minor cargo set-version -p tor-config --bump minor cargo set-version -p tor-events --bump minor cargo set-version -p tor-units --bump minor cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-rtmock --bump minor cargo set-version -p tor-rpcbase --bump minor cargo set-version -p tor-llcrypto --bump minor cargo set-version -p tor-protover --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-hscrypto --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-checkable --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p tor-consdiff --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-congestion --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-ptmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p tor-hsclient --bump minor cargo set-version -p tor-hsservice --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti-rpcserver --bump minor cargo set-version -p arti-config --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti --bump patch cargo set-version -p arti-bench --bump patch cargo set-version -p arti-testing --bump patch ```
* Upgrade our hex-literal dependencyNick Mathewson2023-04-131-1/+1
|
* Increment MSRV to 1.65 in every crate.Nick Mathewson2023-04-111-1/+1
|
* Merge branch 'x25519' into 'main'Nick Mathewson2023-04-041-2/+2
|\ | | | | | | | | | | | | tor-llcrypto: Pin x25519-dalek version, bump our crate version Closes #807 See merge request tpo/core/arti!1108
| * tor-llcrypto: Pin x25519-dalek version, bump our crate versiontor-llcrypto-v0.4.4Ian Jackson2023-04-041-2/+2
| | | | | | | | Fixes #807
* | Remove semver.md files.Nick Mathewson2023-03-311-2/+0
|/
* Bump crate versions that have breaking changesNick Mathewson2023-03-311-1/+1
| | | | | | | | | | These crates have had breaking changes. They are pre-1.0, so they get a minor bump. ``` tor-basic-utils tor-config ```
* Bump patchlevel on crates with non-breaking changesNick Mathewson2023-03-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For these crates, the changes are nontrivial, so we _do_ bump the versions on which their dependent crates depend. Fortunately, since they are all pre-1.0, we don't need to distinguish semver-additions from other changes. (Except for arti, which _is_ post-1.0, but gets a patchlevel bump anyway.) These are unstable crates with breaking changes: ``` tor-hscrypto tor-hsclient ``` These have new or extended APIs: ``` safelog tor-bytes tor-cell tor-linkspec tor-llcrypto tor-proto tor-cert arti-client ``` These have new unstable APIs or features: ``` tor-netdoc tor-circmgr (also broke some unstable APIs) arti (is post-1.0) ``` These have bugfixes only: ``` caret tor-dirmgr ```
* tor-llcrypto: key blinding: Use consistent terminologyIan Jackson2023-03-281-19/+22
| | | | | | | | | | | | | | | | | | | | Unhelpfully, the spec uses the variable name `h` and the phrase "blinding factor" for both the unclamped and clamped value. The clamped value is internal to the algorithm. In our code: * Don't ever use the word "parameter" or variable name `param`. This doesn't appear in the spec anywhere. * Use `h` for the unclamped blinding factor, and `blinding_factor` for the clamped blinding factor. * Rename `blinding_factor` function to `clamp_blinding_factor`, since in the spec's terminology it takes an (unclamped) "blinding factor" and returns a (clamped) "blinding factor". * State explicitly what thing in the spec the `h` parameters are.
* Use the type system to enforce use of blinded keys.Gabriela Moldovan2023-03-271-0/+12
| | | | | | | | | | | | | | | Hidden services use blinded singing keys derived from the identity key to sign descriptor signing keys. Before this patch, the hidden descriptor builder represented its blinded signing keys (`blinded_id`) as plain `ed25519::Keypair`s. This was not ideal, as there was nothing preventing the caller from accidentally initializing `blinded_id` with an unblinded keypair. This introduces a new `HsBlindKeypair` type to represent blinded keypairs. Signed-off-by: Gabriela Moldovan <[email protected]>
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-242-1/+2
| | | | | | | | | | | | | | This introduces the `NetdocBuilder` trait described in `netdoc-builder.md` and a new `tor-netdoc::doc::hsdesc::build` module, which exports the `HsDescBuilder`. Hidden services will use `HsDescBuilder` to build and encode hidden service descriptors. There are several TODOs in the code that I'm planning to address separately. Partially addresses #745. Signed-off-by: Gabriela Moldovan <[email protected]>
* Update required openssl versionNick Mathewson2023-03-241-1/+1
| | | | cargo-audit is complaining about 0.10.45.
* Suppress a renamed-lint lint.Nick Mathewson2023-03-101-1/+2
| | | | | | | The derive_hash_xor_eq lint was renamed in 1.68, but we can't use it under its new name, since we still need to support back to 1.60. Instead, we suppress the warning about the lint being renamed.
* Expose a little new functionality from tor-llcrypto.Nick Mathewson2023-02-282-0/+11
| | | | | Expose ED25519 signature length; make ValidatableEd25519Signature implement Debug and Clone.
* Remove semver.md files now that 1.1.2 is out.Nick Mathewson2023-02-281-1/+0
|
* Patchlevel bumps for remaining changed crates.Nick Mathewson2023-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have had small code changes, but no API additions: tor-config tor-socksproto tor-cert tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr arti tor-hsservice tor-congestion These crates have had API extensions: fs-mistrust tor-llcrypto tor-bytes tor-checkable tor-linkspec tor-netdoc tor-persist arti-client
* llcrypto: Implement `Into<[u8;32]>` for Ed25519IdentityNick Mathewson2023-02-072-0/+7
|
* llcrypto: Derive zeroize for CtByteArray.Nick Mathewson2023-02-072-1/+3
|
* Bump the patch version of every crate that had API additionsNick Mathewson2023-02-011-2/+2
| | | | | | These crates had API or behavior changes that may affect downstream crates. Fortunately, they're all version 0.x, and don't need minor bumps for this.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-272-0/+2
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-273-0/+5
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Merge branch 'ignore' into 'main'Nick Mathewson2023-01-201-1/+0
|\ | | | | | | | | Do not .gitignore crates/*/fuzz/corpus See merge request tpo/core/arti!982
| * Do not .gitignore crates/*/fuzz/corpusIan Jackson2023-01-201-1/+0
| | | | | | | | | | These are symlinks which are actually checked in. They should not be ignored. (This caused trouble for some of my privsep tooling...)
* | tor-llcrypto: Tolerate some warnings (fmt)Ian Jackson2023-01-201-1/+4
| |
* | tor-llcrypto: Tolerate some warningsIan Jackson2023-01-201-0/+4
|/ | | | | | Without this, cargo +stable clippy -p tor-netdoc --all-features produces warnings.
* Upgrade to latest rsa crate.Nick Mathewson2023-01-202-2/+2
|
* Complete our migration to base64ct.Nick Mathewson2023-01-203-16/+10
| | | | | | | | | This is in lieu of upgrading to the latest base64 crate, which has a different API from the old one. Since we have to migrate either way, we might as well use base64ct everywhere. I don't think that most of these cases _require_ constant-time base64, but it won't hurt.
* Merge branch 'blind_privkey' into 'main'Ian Jackson2023-01-092-17/+161
|\ | | | | | | | | | | | | llcrypto: Implement secret-key blinding. Closes #719 See merge request tpo/core/arti!964
| * llcrypto: Implement secret-key blinding.Nick Mathewson2023-01-062-17/+161
| | | | | | | | | | | | | | | | Closes #719. Due to a difference between ed25519-dalek and ed25519-donna, converting these secret keys directly to public keys does not work. I've documented this in a "Limitations" section.
* | llcrypto: fix a comment.Nick Mathewson2023-01-061-1/+1
| | | | | | | | This described the wrong type of key.
* | llcrypto: clarify meaning of "Identity".Nick Mathewson2023-01-062-8/+17
| | | | | | | | | | | | | | | | | | | | The `Ed25519Identity` and `RsaIdentity` types are not precisely always used as relay identifiers: they are more generally used as _key_ identifiers. This will become relevant as `RsaIdentity` is used for authority keys (as in authorities' VoterInfo blocks), and as `Ed25519Identity` is used as the identifier behind an onion service key.
* | Merge branch 'test-lints' into 'main'eta2023-01-062-0/+16
|\ \ | | | | | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * | test lint blocks: Add many many automaticallyIan Jackson2022-12-122-0/+16
| | | | | | | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | | Merge branch 'ctbytes' into 'main'eta2023-01-064-39/+152
|\ \ \ | |_|/ |/| | | | | | | | Add a new "CtByteArray" type, and use it in Id types. See merge request tpo/core/arti!962
| * | Add a new "CtByteArray" type, and use it in Id types.Nick Mathewson2023-01-054-39/+152
| |/ | | | | | | | | | | This type provides a common implementation for types that are implemented as arrays of bytes that should only be compared with constant-time comparisons.
* / doc: consistent summary line for the READMEsEmil Engler2022-12-201-1/+1
|/ | | | | This commit introduces a consistency to the summary line of all README.md files in each and every crate.
* Remove semver.md files now that 1.1.0 is released.Nick Mathewson2022-11-301-1/+0
|
* Bump the minor version of every crate.Nick Mathewson2022-11-301-3/+3
| | | | | We made this job easy this time around: by incrementing our MSRV, we have forced ourselves to do at least a minor bump everywhere.
* Switch from sha-1 back to sha1.Nick Mathewson2022-11-291-2/+2
| | | | | | | As near as I can tell, the rust-crypto SHA1 crate was called `sha-1` for a while because of a conflict with a different SHA1 crate. Now they apparently have the `sha1` name back and have deprecated the `sha-1` name.