Commit Graph

2221 Commits

Author SHA1 Message Date
Daniel McCarney 3633152cc5 Cargo: v0.21.11 -> v0.21.12 2024-04-26 14:44:21 +00:00
Daniel McCarney 0baaeba7a8 proj: MSRV 1.61 -> 1.63
We're seeing more of our deps move to this MSRV or higher (e.g.
`webpki`, `rustls-platform-verifier`) and it's shipped in Debian stable.
Time to move our MSRV to 1.63.
2024-04-26 14:44:21 +00:00
Daniel McCarney 6fd691a101 tls13: fix clippy::unnecessary_lazy_evaluations finding
```
error: unnecessary closure used with `bool::then`
  --> rustls/src/tls13/mod.rs:87:9
   |
87 |         (prev.hash_algorithm() == self.hash_algorithm()).then(|| prev)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------
   |                                                          |
   |                                                          help: use `then_some(..)` instead: `then_some(prev)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
   = note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_lazy_evaluations)]`

```
2024-04-26 14:44:21 +00:00
Joseph Birr-Pixton 6da53375a2 Test for illegal IP address in server name extension 2024-04-26 14:44:21 +00:00
Joseph Birr-Pixton 75f8857db7 Ignore server_name extension containing IP address
This works around quality-of-implementation issues in OpenSSL and
Apple SecureTransport: they send `server_name` extensions containing
IP addresses.  RFC6066 specifically disallows that.

It is a similar work-around to that adopted by LibreSSL: ignore
SNI contents if they can be parsed as an IP address.
2024-04-26 14:44:21 +00:00
Joseph Birr-Pixton 7b8d1dbc1e Prepare 0.21.11 2024-04-19 15:01:59 +00:00
Joseph Birr-Pixton ebcb4782f2 complete_io: bail out if progress is impossible
Have a test that demonstrates another route to reaching this
state: a fully & cleanly closed connection.
2024-04-19 15:01:59 +00:00
Joseph Birr-Pixton 20f35dfb6d Regression test for `complete_io` infinite loop bug 2024-04-19 15:01:59 +00:00
Joseph Birr-Pixton 2f2aae15a4 Don't specially handle unauthenticated close_notify alerts 2024-04-19 15:01:59 +00:00
Dirkjan Ochtman e163587b98 Don't deny warnings from nightly clippy
Since these can be added at any time.
2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton 9f864874cf server::handy: fix new nightly clippy lint
"warning: you are explicitly cloning with `.map()`"
2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton 7e0e8ab599 Correct assorted clippy warnings in test code
Subset of 96a7249b54 from main.
2024-04-19 14:43:16 +00:00
Dirkjan Ochtman 3587d98f4e Apply clippy suggestions from Rust 1.72 2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton d082e837b3 Address `clippy::redundant_static_lifetimes` 2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton 5e7a06ca45 Address `clippy::slow_vector_initialization` 2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton e03556ff1e Address `clippy::single_component_path_imports` 2024-04-19 14:43:16 +00:00
Daniel McCarney 3f40e18484 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-04-19 14:43:16 +00:00
Joseph Birr-Pixton 221577fa47 Address `clippy::assigning_clones` 2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton 2dec5b82c2 Fix `clippy::use_self` warnings 2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton 07082c508e Address `clippy::multiple_bound_locations` 2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton 8309f4fe45 API tests: ignore warnings in ClientStorage mock
This is a complete mock for `rustls::client::ClientSessionStore`,
but we don't have tests that use 100% of its abilities.
2024-04-19 14:43:16 +00:00
Joseph Birr-Pixton 3ad7a96240 Fix nightly `unused_qualifications` warnings 2024-04-19 14:43:16 +00:00
Daniel McCarney cf6aa80cbf Cargo: version 0.21.9 -> 0.21.10 2023-12-08 13:46:40 +00:00
Daniel McCarney 4ee33ae942 version: allow manual_non_exhaustive
We've addressed this lint's findings in `main`. For the 0.21.x release
stream, allow the finding and leave the code unchanged for minimal
semver impact.
2023-12-08 13:46:40 +00:00
Geoffroy Couprie f628518b16 remove the TLS 1.2 session ticket on DecryptError
if for some reason the recorded session ticket is invalid or decoded
incorrectly by the server, we can get into a case where the resumption
handshake happens, and right after the ChangeCipherSpec message, the
server sends an encrypted handhsake message using the invalid ticket,
and the client rejects it with the BadRecordMAC alert.
Unfortunately, if the calling code retries the connection, if it will
try again with the same ticket and obtain the same result.
This commit makes sure that if we fail to decrypt the first message, we
will remove the session ticket for this server, to start from cratch on
the next connection.
2023-12-08 13:46:40 +00:00
Daniel McCarney bbd9abca10 Cargo: v0.21.8 -> v0.21.9 2023-11-16 15:23:46 +00:00
Joseph Birr-Pixton 5edc126bcf Use `BorrowedCursor` & `BorrowedBuf` from core::io 2023-11-16 15:23:46 +00:00
Joseph Birr-Pixton 7abd73f7ec Opt in to feature(core_io_borrowed_buf)
This is needed for `BorrowedBuf` now, even if via the std::io reexport.
2023-11-16 15:23:46 +00:00
Daniel McCarney c34477a068 Cargo: 0.21.7 -> 0.21.8 2023-10-24 13:32:34 +00:00
Daniel McCarney 8cf2594dcb sign: fix clippy get-first warning 2023-10-24 13:32:34 +00:00
Robsdedude ecc6cded2a Flush writers before potentially expecting a response 2023-10-24 13:32:34 +00:00
Daniel McCarney 53adb9d2eb docs: adjust *ring* platform compatibility
Updated the README/lib.rs notes about *ring* platform compatibility to
fold in suggestions from Brian Smith.
2023-10-24 13:32:34 +00:00
Daniel McCarney d5d62499f2 upgrade to ring 0.17 2023-10-24 13:32:34 +00:00
Daniel McCarney a659652de0 tls12/tls13: make hash_algorithm crate internal
The `Tls12CipherSuite::hash_algorithm` and
`Tls13CipherSuite::hash_algorithm` functions were meant to be crate
internal, since their return type leaks the `ring::digest::Algorithm`
type. As written today these fns make updates to `*ring*` a breaking
change for the Rustls API.

This commit switches the visibility of both functions to be
crate-internal. Strictly speaking this is a breaking change, but we
don't expect there to be consumers of these functions and it unblocks
a *ring* update that would otherwise be breaking on its own.
2023-10-24 13:32:34 +00:00
Daniel McCarney 3ed39adc3d upgrade to webpki 0.101.7
Brings in the ring 0.17 update.
2023-10-24 13:32:34 +00:00
Dirkjan Ochtman 3e4a72e396 Docstrings on expressions are not a thing 2023-10-24 13:32:34 +00:00
Dirkjan Ochtman e26d1d82ae Bump MSRV to 1.61 2023-10-24 13:32:34 +00:00
Dirkjan Ochtman ab7b0e7a4f Drop rust-version metadata for internal crates 2023-10-24 13:32:34 +00:00
Joseph Birr-Pixton 7bc1dcddd8 Fix new nightly clippy lints
- several `clippy::slow_vector_initialization`
- one `clippy::redundant_guards`
2023-10-24 13:32:34 +00:00
Joseph Birr-Pixton 396478cde1 fuzz: remove unused webpki dependency 2023-10-24 13:32:34 +00:00
Daniel McCarney c9cfe34996 Cargo: bump version v0.21.6 -> v0.21.7. 2023-08-28 20:35:16 +00:00
Joseph Birr-Pixton 41515eabfb client: detect HRR with incorrect session_id
See comment for justification from RFC.
2023-08-28 20:35:16 +00:00
Joseph Birr-Pixton 8bf4671732 Regression test for echoing session id in HRR 2023-08-28 20:35:16 +00:00
Joseph Birr-Pixton 0cc2ad54cd server: echo client's session_id in HRR 2023-08-28 20:35:16 +00:00
Dirkjan Ochtman 0eeac58fb8 Clarify that building configs is not actually expensive
The actually expensive part is mostly the gathering of certificates
from the platform trust root store, and it would be better to document
that in the relevant API (that is, in rustls-native-certs). Apart
from that, I believe that the use of `Arc`-wrapped types is also an
effective signal that the wrapped types should be reused where possible.
2023-08-24 16:37:09 +00:00
Dirkjan Ochtman 9d4ac865c3 Store an Arc<RootCertStore> in WebPkiVerifier 2023-08-24 16:37:09 +00:00
Daniel McCarney 40e4b5d642 Cargo: bump version 0.21.5 -> 0.21.6 2023-08-02 12:15:12 +00:00
Daniel McCarney ea71de282d deps: update to webpki-roots 0.25, fix deprecations.
Updates the rustls project and rustls-examples project to use
webpki-roots 0.25.0 instead of 0.24.0, fixes associated deprecations.
2023-08-02 12:15:12 +00:00
Daniel McCarney 2b97c8dc20 verify: avoid deprecated webpki methods.
webpki 0.101.2 deprecated some methods/types that must be updated.
2023-08-02 12:15:12 +00:00
Daniel McCarney 2ac3cec0e1 anchors: deprecate add_server_trust_anchors.
The `RootCertStore` type is used for both client and server trust
anchors. This commit deprecates the inappropriately named
`add_server_trust_anchors` fn and adds a new `add_trust_anchors` fn to
use in its place.
2023-08-02 12:15:12 +00:00