Conversation
titouantanguy
approved these changes
Oct 5, 2026
Comment on lines
+1076
to
+1089
| let error = server_result.unwrap_err(); | ||
| assert!( | ||
| matches!( | ||
| error | ||
| .get_ref() | ||
| .and_then(|error| error.downcast_ref::<Error>()), | ||
| Some(Error::PeerIncompatible( | ||
| PeerIncompatible::NoKxGroupsInCommon | ||
| )) | ||
| ), | ||
| "unexpected rejection for {:?}: {error}", | ||
| group.name(), | ||
| ); | ||
| assert!(client_result.is_err(), "client accepted {:?}", group.name()); |
Contributor
There was a problem hiding this comment.
nit, why an assert on the client's error but an unwrap on the server's one ?
|
|
||
| /// Constructs mutually authenticated P2P TLS configurations with hybrid-only key exchange. | ||
| /// | ||
| /// Both endpoints require TLS 1.3 and prefer [`kx_group::X25519MLKEM768`] over [`kx_group::SECP256R1MLKEM768`]. |
Contributor
There was a problem hiding this comment.
Any reason why we support both ? and in that order ?
I reckon compliance frameworks might enforce SECP256R1MLKEM768 as that's what NIST suggests ?
Contributor
Author
There was a problem hiding this comment.
The reason was that rustls supports both, and whatever is the default came out first. Will pin the NIST recommendation, unless someone objects.
| where | ||
| R: ResolvesServerCert + ResolvesClientCert + 'static, | ||
| { | ||
| let mut provider = default_provider(); |
Contributor
There was a problem hiding this comment.
This PR talks about handshake only, but I'm wondering do we want to force AES 256 as well ?
Contributor
Author
There was a problem hiding this comment.
Good point, will restrict session ciphers too.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While
rustlsalready supported PQ key change for a while, and we had enabled in mTLS between parties, we don't forbid explicitly classical key exchange which might lead to a downgrade by a malicious operator. This PR only permits hybrid PQ exchanges, preventing potential downgrades.PR Checklist
Tick all that apply — by ticking I attest the item holds; justify any deviation in the description above.
chore: ...).pubitem and test coverage has not decreased.TODO(#issue).unwrap/expect/paniconly in tests or for invariant bugs (documented if present).devopslabel + infra notified + review requested.!and affected teams notified.Zeroize+ZeroizeOnDropimplemented.unsafe; if unavoidable: minimal, justified, documented, and test/fuzz covered.