-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the post-quantum x25519+ML-KEM-768 TLS 1.3 ciphersuite by default #4305
base: master
Are you sure you want to change the base?
Conversation
503d8df
to
ee8f6c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Nice! The PQ-era is here!
As a side note: This points at an open tech debt regarding the management of ciphersuites (also noted for a long time in #2990). As it is now, there's a lot of if {} else if {} else
scattered around many places in the TLS implementation. Whenever algorithms are added, there's a lot of potential to miss something.
Something is wrong - I know I tested that our client connecting to our server would negotiate Kyber (highly relevant since Botan being on both sides of the connection is very common) but now this doesn't work .... |
Oh I see. I tested us<->us in my initial attempt which put Kyber at the absolute top of the preference list. However I realized later this caused us to send a large keyshare that is ignored much of the time, which is non-optimal. But it seems - unlike the stacks in |
OK I think we just need to adjust the logic in |
... I was about to say that. Currently, the code there optimizes for round-trips and avoids sending a HelloRetryRequest whenever it can. I.e.: it will go for the non-PQ group if it is offered and fits with our supported groups. |
I'll take a look at that BoringSSL and co do here. I expect it looks something like a 2-tier selection
|
Sounds reasonable to me as a default policy. I was thinking to propose an additional policy setting like |
|
OTOH we already have a lot of fucking policy toggles 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BoGo isn't happy about our new cleverness in selecting KEX algos, I guess. Probably, we'll just have to override the policy with the old logic there.
18b58a2
to
83a05cc
Compare
ec0d301
to
a354031
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not start offering Kyber by default anymore.
7d241d6
to
9a1a4d8
Compare
9a1a4d8
to
2ea7092
Compare
2ea7092
to
5cd6c61
Compare
0956fe7
to
f48192c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that tls13_kex_to_string
will need to be adapted when merged with #4393, due to the introduction of is_pure_ml_kem()
in there. It's probably a good idea to merge that first and then rebase this PR onto it.
75f32bb
to
c5fbcba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to split Kyber and ML-KEM explicitly in tls_algos.h
. Otherwise, this looks good to me. Thanks, and Merry Christmas! 🎄
d9ca4c6
to
19f3479
Compare
This adjusts the default logic for both which groups to offer and which group to select during negotiation. For offering, we send the first pure ECC group in the preference list. This avoids sending large PQ shares to servers that don't support them. If the client for whatever reason does not have any pure ECC groups, then we send a share of whatever their top preference is. On the server side, if the client indicated support for any mutually supported PQ algorithm, we always select it, even if the client sent some other type of keyshare. Previously we would always prefer to select a group that the client sent a share of, to reduce round trips. This also rearranges the default list, and removes some of the most expensive FFDHE groups. Expose which group was used for key exchange in the Session_Summary, since otherwise there is no way to know if PQ exchange occurred or not. Co-authored-by: René Meusel <[email protected]>
Tested with cloudflare.com, google.com and ourselves.
This adjusts the default logic for both which groups to offer and which group to select during negotiation.
For offering, we send the first pure ECC group in the preference list. This avoids sending large PQ shares to servers that don't support them. If the client for whatever reason does not have any pure ECC groups, then we send a share of whatever their top preference is.
On the server side, if the client indicated support for any mutually supported PQ algorithm, we always select it, even if the client sent some other type of keyshare. Previously we would always prefer to select a group that the client sent a share of, to reduce round trips.