Commit Graph

3041 Commits

Author SHA1 Message Date
Daniel McCarney 074ced1fd5 deps: base64 0.21.7 -> 0.22.0 2024-03-25 16:15:36 +00:00
Daniel McCarney 46bd6916c8 deps: regex 1.10.3 -> 1.10.4 2024-03-25 16:15:36 +00:00
Daniel McCarney 69dacfe7c7 deps: rustls-pki-types 1.10.3 -> 1.10.4 2024-03-25 16:15:36 +00:00
Daniel McCarney 737a24e038 deps: rayon 1.9.0 -> 1.10.0 2024-03-25 16:15:36 +00:00
Daniel McCarney 8b43f23382 deps: async-trait 0.1.78 -> 0.1.79 2024-03-25 16:15:36 +00:00
Joseph Birr-Pixton 1dee8b1313 Prepare 0.23.4 2024-03-25 14:57:41 +00:00
Joseph Birr-Pixton 3a03df6a34 Correct further `dead_code` warnings 2024-03-25 13:33:09 +00:00
Joseph Birr-Pixton d8a0f94aa7 Fix new `clippy::use_self` warnings
Seems this has improved when the explicit lifetime bound is
the same as the one implied in `Self`.
2024-03-25 13:33:09 +00:00
Daniel McCarney 3185d7f315 examples: fix server acceptor alert write behaviour
The `AcceptedAlert::write` fn may return having only written some of the
alert buffer. We could either repeatedly call `write` until it
returns `Ok(0)` or an error, or use the new `write_all` fn. This commit
does updates the acceptor example to do the latter.
2024-03-22 18:59:00 +00:00
Daniel McCarney b5a8cef58c server: add AcceptedAlert::write_all
This is a convenient helper for blocking contexts where the caller
simply wants to ensure all bytes are written in a single call.
2024-03-22 18:59:00 +00:00
Daniel McCarney e06c9fea99 server: improve AcceptedAlert::write documentation
The `wr: &mut dyn io::Write` provided to `AcceptedAlert::write` may
return from a short write without having written the entire alert
contents. To avoid dropping the remaining data in this circumstance
the caller should make sure to repeatedly call `AcceptedAlert::write`
until it returns `Ok(0)` or an error.
2024-03-22 18:59:00 +00:00
Joseph Birr-Pixton a7d2ad61a8 Test that reproduces the problem
Prior to the fix this fails with:

```
called `Result::unwrap()` on an `Err` value: PeerMisbehaved(SignedKxWithWrongAlgorithm)
```
2024-03-22 17:04:45 +00:00
Joseph Birr-Pixton 9f3adc7e08 Map `SignatureScheme::ECDSA_SHA1_Legacy` to `SignatureAlgorithm::ECDSA` 2024-03-22 17:04:45 +00:00
Joseph Birr-Pixton d633942e74 Move `MockServerVerifier` to tests::common 2024-03-22 17:04:45 +00:00
Joseph Birr-Pixton 667482a17f Add path dependency for rustls-post-quantum
This avoids our Cargo.lock containing a previous version of this
crate, and means a local `cargo build` is sufficient to check
rustls-post-quantum/ builds against the current rustls/.
2024-03-21 17:58:37 +00:00
Joseph Birr-Pixton 46454a98c1 ClientKeyExchangeParams: widen feature gate to avoid clippy lint 2024-03-21 16:51:05 +00:00
Joseph Birr-Pixton 5ce0a17128 Prepare 0.23.3 2024-03-20 16:56:05 +00:00
Joe Birr-Pixton 03e44999a5 admin/coverage: pass script args to all llvm-cov calls
This allows the new, nightly-only, `--branch` argument to
get everywhere it needs to.  That enables branch coverage
tracking.

Example use:

$ ./admin/coverage --branch --html --open
2024-03-20 16:28:08 +00:00
Yuxiang Cao a3d21f24da fix: ffdhe no common cipher suite bug
- Fix the bug that when both FFDHE and DHE ciphersuites are available on
  client and server, no ciphersuite is choose.
- Add missing test cases.
2024-03-20 16:11:06 +00:00
Daniel McCarney fb67f01456 tests: fix implied_bounds_in_impls clippy warn
```
error: this bound is already specified as the supertrait of `DerefMut`
   --> rustls/tests/./common/mod.rs:596:35
    |
596 |     client: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls
help: try removing this bound
    |
596 -     client: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
596 +     client: &mut (impl DerefMut<Target = ConnectionCommon<impl SideData>>),
```
2024-03-19 17:43:08 +00:00
Daniel McCarney 9c4974515e tests: fix assigning-clones clippy warn
```
error: assigning the result of `Clone::clone()` may be inefficient
  --> rustls/tests/api.rs:64:9
   |
64 |         client_config.alpn_protocols = client_protos.clone();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `client_config.alpn_protocols.clone_from(&client_protos)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
   = note: `-D clippy::assigning-clones` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::assigning_clones)]`
```
2024-03-19 17:43:08 +00:00
Simon Tate b3750ee835 Add auto build to bench-measure
To allow for easy running and simplification of benchmarking, add cargo
build to the bench measure.

Also add .PHONY for recipes with no output that are always expected to
run.
2024-03-19 08:41:19 +00:00
Daniel McCarney 8f5ebbb43c deps: clap 4.5.2 -> 4.5.3, clap_derive 4.5.0 -> 4.5.3 2024-03-18 14:37:43 +00:00
Daniel McCarney 848d9021af deps: async-trait 0.1.77 -> 0.1.78 2024-03-18 14:37:43 +00:00
Daniel McCarney 71e1d657cc deps: anyhow 1.0.80 -> 1.0.81 2024-03-18 14:37:43 +00:00
Joseph Birr-Pixton 38573b26d5 rustls-post-quantum: correct formatting 2024-03-14 16:06:02 +00:00
Joseph Birr-Pixton 134e43f9a3 Enable lto for `bench` profile
Gives:

- 11-12% improvement on bulk receiving benchmarks.
- 2-5% improvement on handshake benchmarks

Use this when building the `bench` tool.
2024-03-14 15:59:09 +00:00
Joseph Birr-Pixton c64d0b54b1 bench: use jemalloc 2024-03-14 15:59:09 +00:00
Joseph Birr-Pixton 2278226559 ci-bench: use jemalloc 2024-03-14 15:59:09 +00:00
Daniel McCarney d7aad5970b provider-example: conditionally enable rusts std feat
Previously the `std` feature was in the explicit rustls dependency
feature list, and not opted-in by the provider's own `std` feature.
I believe this means when building the provider with
`--no-default-features` we were still using Rustls w/ the `std` feature.
2024-03-14 13:14:57 +00:00
Daniel McCarney b4722053c2 ci: fix typo in no-std run name
It uses `--no-default-features` but the name described using default
features.
2024-03-14 13:14:57 +00:00
Joseph Birr-Pixton 9a911841cd Prepare rustls-post-quantum 0.1.0 2024-03-13 17:18:59 +00:00
Joseph Birr-Pixton 92cb23e6e5 Add bare-bones README.md 2024-03-13 17:18:59 +00:00
Joseph Birr-Pixton bbef4b3ea7 Prepare 0.23.2 2024-03-13 16:41:33 +00:00
Joseph Birr-Pixton 295cfdef46 Mention rustls-post-quantum in providers docs 2024-03-13 16:41:33 +00:00
Joseph Birr-Pixton 62e154cb99 Add example client 2024-03-13 15:45:16 +00:00
Joseph Birr-Pixton 092f3b569a Implement X25519Kyber768Draft00 key exchange 2024-03-13 15:45:16 +00:00
Joseph Birr-Pixton d4ec42ec1c Switch to using `SupportedKxGroup::start_and_complete()`
This isn't really compatible with the plumbing to allow a HKDF
implementation to do the key exchange completion, so unpick this.
2024-03-13 15:45:16 +00:00
Joseph Birr-Pixton 96f07d7e20 Support KEM-shaped key exchange algorithms
In these, the server's share has a data dependency on the
client's share.  Therefore, fuse the start() and complete()
operations in this case.

This is only supported for TLS1.3.  TLS1.2 does not allow this
arrangement.
2024-03-13 15:45:16 +00:00
Joseph Birr-Pixton 6304e8f24c Introduce rustls-post-quantum "crate" skeleton 2024-03-13 15:45:16 +00:00
Daniel McCarney 0398ac50fe deps: log 0.4.20 -> 0.4.21 2024-03-11 19:32:05 +00:00
Daniel McCarney 7588262aac deps: rustls-pki-types 1.3.0 -> 1.3.1 2024-03-11 19:32:05 +00:00
Daniel McCarney 811d55eda4 deps: asn1 0.16.0 -> 0.16.1 2024-03-11 19:32:05 +00:00
Daniel McCarney f4ba5341d6 deps: rustls-pemfile 2.1.0 -> 2.1.1 2024-03-11 19:32:05 +00:00
Daniel McCarney afedcfe733 deps: rayon 0.8.1 -> 1.9.0 2024-03-11 19:32:05 +00:00
Daniel McCarney 479aec0a9a deps: clap 4.5.1 -> 4.5.2 2024-03-11 19:32:05 +00:00
Josh Triplett 700028200a Add an `aws-lc-rs` feature as an alias for `aws_lc_rs`
The vast majority of Cargo features in the crates ecosystem use dashes
to separate words, rather than underscores. The fact that `aws_lc_rs`
uses underscores, and some crates depending on rustls naturally use the
same name for the feature that rustls does, has led some crates to end
up with inconsistent feature naming that throws people off (e.g. using
the wrong feature name and being surprised at the resulting compilation
failures), and has led other crates to use `aws-lc-rs` for consistency
with their other features which causes inconsistency with rustls.

Add an alias, so that it works either way, and people can reference
either one.
2024-03-11 19:31:27 +00:00
Joseph Birr-Pixton 52efdc99c9 Avoid `clippy::std_instead_of_core` false positive
This is complaining about the import of the `env` module from
`std::env`, instead of `core::env`.

However, `core::env` is a completely different item -- it is
the `env!` macro.
2024-03-11 13:59:00 +00:00
Joseph Birr-Pixton 7a9d9788c8 Address `clippy::mixed_attributes_style` 2024-03-11 13:59:00 +00:00
Joseph Birr-Pixton db4b6c8069 Address `clippy::multiple_bound_locations` 2024-03-11 13:59:00 +00:00