-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Fully Pluggable TLSv1.3 KEM #13018
Fully Pluggable TLSv1.3 KEM #13018
Conversation
@bbbrumley if you have the extra cycles, you might want to chime in here! |
@romen although I applaud your enthusiasm, we need to start locking stuff down for beta. This is feature creep :) |
@slontis Yes, I opened this mostly as a follow-up to the discussion in the last weekly meeting, to have an actual user of the KEM API. I still really really wish we could manage to get this in before beta1, but I know it is tough and I don't expect it.
It seems like the current API is flexible enough to implement this, so I don't think there is a need for a separate PR to change something in the KEM API. |
I am hoping there is a discussion about what beta is - and how we get there soon.. |
Maybe I phrased my answer ambiguously: I meant that, considering this PR just as a test of the usability of the existing KEM API, I believe the work done in #12750 does not require further changes that I can foresee. Regarding the second part, i.e. my wish to have this merged in 3.0, I have no high expectations, and I understand and appreciate the "no feature creep" angle. |
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.
An awesome piece of work!!!
However, I'm placing an OTC hold on it because its unclear whether this should go in before beta 1 or not.
Thanks @mattcaswell for the feedback, 51b8d41dc12ae808ea96ed0b844238c10fd969fd should address all the issues. Regarding the |
FWIW, this is the sort of thing I had in mind when I suggested that "potentially destabilizing changes" should not go into master until after 3.0 branches. |
We share concerns about merging this PR before 3.0-beta1, because it is coming very late in the development cycle and because we all want to avoid "feature creep". In favor of inclusionMy argument in favor of inclusion is that from a technical risk profile #13018 is not adding any significant amount of risk to the current 3.0 state and is, on the other hand, fulfilling long-standing requests from our users. More in detail:
|
Call for commentsTo build support for my argument for inclusion, I'd like to seek endorsement by members of the community, especially among the expert practitioners that are using OpenSSL —or forks of OpenSSL— as a toolkit as part of their ongoing efforts in the NIST PQC process. I encourage you to share your view on the capability added by this PR, suggest improvements if it is lacking in some fundamental regard, and weight in with your expertise in favor or against the inclusion of this change in the 3.0 timeframe, and its impact on the evolution of the KEM software ecosystem. I'd jumpstart this by pinging, in no particular order, @thomwiggers, @henrydcase, @cryptojedi, @christianpaquin, @baentsch, @xvzcf, @dstebila, @bbbrumley. |
I do not see this as a mainstream feature. Folks can always fork it themselves and experiment. Or it can go into the 3.1 release. I do not see any pressure to have every downstream user be able to plug in their own key exchange. It's neat, but not worth it to most. |
I updated the description adding a summary written targeting users that have not been following the latest developments in 3.0, and adding a link to my argument for inclusion. |
I fully support the idea of KEM API. I don't see any reason to wait for it until NIST PQC to be finished, as whatever will be chosen it will be a KEM. "Fully pluggable" will help the community to experiment with PQ crypto and will help companies to prepare for migrations. |
Thanks @richsalz for the feedback, I appreciate it! I don't expect to change your opinion on the matter, which is perfectly fine and agreeable for many, but I want to counterargument it to stimulate debate.
True, and people have been doing so, but I believe this is also preventing the users that have to maintain their fork to be able to conduct their experiments directly in OpenSSL and devote more energies in improving OpenSSL directly. Regarding delay to 3.1, what I argue is that now is the time to include this to avoid alienating a valuable part of our community, because now is when the focus of the NIST PQC is shifting more and more on experiments on real-world deployments, now national standardization bodies outside NIST are updating their recommendations to include a selection of PQC KEM.
That is not under discussion, that feature is already in, and I would say required by many users outside of US that have a recommendation or requirement to use different groups than P-256 or X25519, or the FFDHE without having to replace the OpenSSL version provided by the maintainers of their distribution: if someone had a requirement to use FourQ or NationalGroup42 they could do so with a provider, without patching OpenSSL. On this matter, this PR only adds an extra flag to signal that the group is modeled according to KEM rather than DH-KEX. I agree that at the moment the latter feature is useful almost exclusively to people experimenting about real-world deployments. The likelihood that some organization today wants/needs to deploy PQC KEM for TLSv1.3 is also quite low, but my expectation is that even this likelihood is bound to increase before we will be ready for a 3.1 release. And I would still argue that this might not be motivation enough if this was a major new feature potentially causing further delays for 3.0 or with a moderate/high risk of biting us in the foreseeable future, but this is not the case for this PR.
Under these conditions I would argue that the pressure of unnecessarily alienating some of our users is the pressure I am seeing to get this in. |
Sorry, I used the wrong term and that led you to go onto a larger rebuttal than necessary. I made most of my point and will not otherwise get into a debate to that others can contribute. |
Thanks @henrydcase for your feedback!
The KEM API is already in (thanks to #12750 work), so that already allows authors of OpenSSL Providers to inject such functionality in
This PR further improves the mechanism that lets It would be up to the OpenSSL Provider to plug a group |
Excellent write-up, @romen! |
yep, that sounds very useful, would be great to have it. makes integration of PQ into TLS much simpler. After looking at a code a bit closer, it seems like that's a relatively small change, comparing to #12750). |
I realize only now that answering point by point to feedback as I did above, might come across as off-putting. I can do better and I'll try to, in the meantime I think it is important to extend my apologies if anyone felt annoyed by it, and to remark that I truly do welcome all feedback, not just the answers that are more or less clearly in favor of my argument for inclusion in 3.0! |
I support this PR and the reasons are exactly those mentioned by Kris. Having personally hacked Since others being tagged might feel a bit blindsided, I can summarize quickly -- at least for one project. @dstebila and @christianpaquin for OQS this would mean your OpenSSL fork goes away entirely -- cryptosystems load dynamically in |
Having a more direct method to add key exchange methods in libssl would be welcome. The goal of our fork is to be able to experiment with and demonstrate post-quantum algorithms prior to widespread adoption. We're able to do so by modifying the libcrypto and libssl code in many places, but would be happy to have a simpler route. Our fork will probably go away eventually after the end of the NIST standardization and OpenSSL's eventual incorporation of those algorithms, and we're okay with that -- although it will take more than just pluggable KEMs in libssl, as we also do PQ and hybrid signatures in libssl, S/MIME & CMS signing, and a few more things. Currently all our work has been on 1.1.1, and we haven't touched 3.0 yet, but are looking forward to experimenting with it when the time is right. |
I didn't review the details of this PR or the KEM integration strategy, but to echo @dstebila's comments, I also fully agree with the addition of KEM support in OpenSSL. NIST will standardize a post-quantum KEM; doesn't matter which one, OpenSSL can proactively add support for the mechanism. In fact, OpenSSL's integration feedback would be helpful to the NIST competition, and the project would benefit if its preferred (from an integration's perspective) finalist is selected, rather than being forced later to integrate a scheme that's not as well suited for TLS or OpenSSL. Early integration would also encourage people to experiment with real-world deployments. Hybrid (classical+PQ) is critical, and a good strategy should be implemented (see this paper for example). There is this chicken and egg problem of people wanting the feature but also wanting to use official OpenSSL code to conduct quantum-safe pilots. I, as many of my OQS colleagues I'm sure, would be happy to work with the OpenSSL team to make this happen. OQS's goal is to provide post-quantum features on top of OpenSSL; if none exist, then we declare victory as the library would be quantum safe! |
Note that with this commit the optional parameter is introduced, but libssl still ignores it.
Documentation improvements based on @mattcaswell feedback.
Address latest feedback from Matt
Address latest feedback from Matt
Address latest feedback from Matt
51b8d41
to
74ac213
Compare
Just rebased.
Are the ones addressing latest feedback from @mattcaswell (last listed is latest) The commits from 1574d6f up to 55a6890 (both included) are just the result of an automatic rebase with not conflicts. |
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.
LGTM
This pull request is ready to merge |
Reviewed-by: Matt Caswell <[email protected]> (Merged from #13018)
Reviewed-by: Matt Caswell <[email protected]> (Merged from #13018)
Reviewed-by: Matt Caswell <[email protected]> (Merged from #13018)
Note that with this commit the optional parameter is introduced, but libssl still ignores it. Reviewed-by: Matt Caswell <[email protected]> (Merged from #13018)
Reviewed-by: Matt Caswell <[email protected]> (Merged from #13018)
Reviewed-by: Matt Caswell <[email protected]> (Merged from #13018)
Reviewed-by: Matt Caswell <[email protected]> (Merged from #13018)
Merged on
Thanks everyone for the feedback and the review. |
Fully Pluggable TLSv1.3 KEM
This PR is extending the work done in changes recently merged for OpenSSL 3.0:
EVP
layer, backed by implementations provided by internal or external OpenSSL Providers.libssl
for key exchange in TLSv1.3.This PR would extend #11914 to:
libssl
to act on this optional capability:Key Share
extension on the client and the server checks the new capability so that, if set to true, the API introduced in Add RSASVE from SP800-56Br2 #12750 is called, as an alternative to the traditional "DH-like scheme", that remains unchanged.The combination of these 2 items would allow OpenSSL Providers to model the "plugged-in" groups either under the key exchange scheme (both sides do a Diffie-Hellman_-like_ exchange) or the key encapsulation method scheme (client sends KEM pubkey in
Key Share
, server encapsulates under given pubkey and send back the ciphertext as itsKey Share
, client decapsulates the received ciphertext using the paired privkey).Given that a key exchange scheme can trivially be described as a KEM scheme, this also allows the authors of OpenSSL Providers to optionally describe DH-like primitives in terms of KEM, which also simplifies the design and deployment of hybrid schemes composing traditional-computing-resistant and quantum-computing-resistant primitives.
Edit: I edited the original description in favor of one that is hopefully slightly more useful for readers that have not been closely following the latest developments in 3.0; the original description is still available, collapsed immediately after this line.
Original description
Fully Pluggable TLSv1.3 KEM
This PR builds upon #11914 and the recent KEM support introduced with #12750, to further expand the "capabilities" approach to support KEM.
The
libssl
TLSv1.3 handling of the key share extensions is slightly tweaked, to support running KEM instead of DH-like KEX, if a provider signals so for a group using the newOSSL_CAPABILITY_TLS_GROUP_IS_KEM
boolean parameter.This would open the way to have providers implementing schemes that are fully compatible with the current TLSv1.3 spec yet using the KEM paradigm rather than KEX.
This would be very useful to implement post-quantum KEM primitives, and test their pure or hybrid deployment in TLS 1.3 with OpenSSL completely self-contained in a provider.
This also serves the purpose of testing the usability of the new
EVP
KEM API.Merge window
I believe it would be possible to merge this already in 3.0, and that it is highly desirable:
Key Share
extension, without further changes as the current definition of the groups is opaque.That being said, it is very late in the 3.0 development cycle, and although the required change to the public API is small, this configures as a new feature, and as such would require to be accepted before beta1.
I am submitting this now, but I am aware that it won't hold back the release of beta1 if it is not approved in time.
Here is a link for the comment further down in the discussion with my argument in favor of inclusion in 3.0.
Checklist