-
Notifications
You must be signed in to change notification settings - Fork 126
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
Start migrating to OpenSSL 3.0 #243
Comments
Initial functional integration of all NIST PQC KEM candidates available in https://github.com/open-quantum-safe/openssl/tree/OQS-OpenSSL3; with tip of the hat to @romen for openssl#13018 : All new KEM APIs worked perfectly. Status and limitations of this WIP documented in README; suggested ToDos in oqsprovider code; PQC-KEM interoperability with OpenSSL_1_1_1 branch validated (required code-generator in |
One could argue to close the issue as we have started the migration :-) Question(s) open to discussion (creation of other issues or maintaining this issue for documentation/decision-making purposes?): How do we want to continue after this start? Below's a first list of options. @christianpaquin , @xvzcf , @dstebila Please edit/amend/comment as you see fit.
Initial thoughts: Edit: 3 done. 2 done by way of extending OSSL testing. |
This should conceptually be doable, speed up build time and make code updates completely independent from upstream changes (unless APIs change there, of course). This would speak for an entirely separate OQS subproject instead of a branch. Drawback: Effort required to create a cross-platform build environment. Alternative: Straight integration of this code into Edit: Done (see below with kudos to @levitte) |
I would strongly recommend that you take this step. All the provider side code should be implementable without forking OpenSSL at all. This gives you libcrypto integration for all the algorithms, as well as libssl integration for all KEMs. AFAICT the main piece that you need an OpenSSL fork for is the libssl integration of signature algs. Am I right? This is mainly because I've simply not had the bandwidth to implement the pluggable signature support into libssl yet and unfortunately its unlikely to happen before 3.0 :-( |
Thanks very much for taking the time to give feedback. Yes, we also identified OSSL issue 10512 as the one that would be worth while resolving most urgently from "our" perspective (of adding PQC to OpenSSL with the least pain to everyone, i.e., without the need to retain/maintain an OpenSSL fork). I'd like to try to give 10512 a go, unless you think this is way too complex or too late for getting into a stable OSSL3.0 (@mattcaswell, @romen)? |
I think such a PR would be highly desirable, but we cannot commit to hold beta1 release in case the PR is not mergeable when we reach the moment to release beta1. At the moment beta1 does not seem too close (the list of open issues for the beta1 milestone can give some idea of the amount of work still left to do). So I would personally commit to try and prioritize my reviews to help shape it up and bring such a PR to a point where it is ready, but we can't make guarantees regarding it being included in 3.0 if it misses the cutoff date. There might be the need for an OTC or OMC decision on the matter (as we did for the pluggable KEM feature, against feature creep). |
Pluggable signatures is definitely going to be complex to implement. I did pluggable kex because the changes I needed to make to enable that to work weren't that much more than the changes I needed to do to make libssl provider aware for kex. The kem support that @romen implemented was simply an extension of the existing kex work. Signatures OTOH are going to require more extensive changes. I haven't looked too closely at it yet, but one issue that springs to mind is that, until now, we've always had fixed "slots" for different certificate types. So you get one slot for an RSA cert, one for an ECDSA cert, one for DSA, and so on. With pluggable signatures we're going to have to support a varying number of algorithms and so we'll have to dynamically allocate the slots in some way. Another thing that springs to mind is that we're going to have to support X509 certs with arbitrary signature algs. I haven't looked at what would be required to support that. It might be straightforward....but it might not. With all that said I don't want to put you off having a go. I'd be delighted if you could get it working and I'd be more than happy to offer what advice and assistance I can given my limited bandwidth. In terms of the timescale, that is unclear. At the moment there seems like a long list of things we need to fix before beta1 is ready, so we certainly have some time. But we haven't got a definitive target date at the moment. Strictly speaking beta1 is the feature freeze point, but for a feature as significant as this I think @romen is right, there would have to at least be an OTC decision to approve it. Partly it might depend on how invasive and extensive the changes end up being. |
Thanks for your willingness to help this along! Clearly understood there are no guarantees. Your caveats scare me a bit as you know much better what's involved, but I think we'd give it a shot (or two or three)... I implemented the OQS-CMS integration so have some idea what may be "lurking" there. Also, we managed to get OQS-x509 certs working -- and extended the cert type slots (but that wasn't me). So let's see whether we have enough collective insight to get this going in time. Thanks again for all your pointers and help (so far and possibly in the future)! |
I got interested in the OQS provider, and wanted to see how hard it would be to turn it into an external provider. I have the result in a personal repository, https://github.com/levitte/tmp-oqsprov |
Thank you very much! This also again confirms the utility of the effort @mattcaswell put into guiding us to "dis-entangle" internal APIs. We'll probably put this into its own open-quantum-safe repo and maintain it there at latest when OpenSSL3 goes beta to immediately "PQC-enable" OSSL3: OK for you? At first glance, I fail to see the KEM tests, though: Was there a reason to not bring those over or do I overlook them? Final question: What'd be your recommendation as to where to maintain OQS provider code for "the long run"? Background: We'd eventually be interested in achieving all the same OQS-OSSL functionality in 3.0 that the 1.1.1 fork has (incl. certs, CMS, etc.). The present state of things means that we probably best maintain the provider in an OSSL3 fork until pluggable signatures are available and we can make do with a fully external provider and don't need "upstream patches" any more. The latter clearly would be our preference. I guess the real question is: How soon do you see the latter (full provider support for keys, X509, signatures, ...) come to pass? @mattcaswell already stated the OTC decision to not rush this before 3.0 release; but maybe there's a guesstimate as to the timeline you'd (all together) be looking at for this? In turn, would you'd consider work on our side to replicate in OSSL3 core what we did in 1.1.1 to be futile and quickly superfluous as full provider-enablement/"legacy-disablement" is your goal probably? |
If it was me, I would separate the provider from your 3.0 fork. The provider is useful standalone with standard OpenSSL 3.0. It gives you full integration to the "EVP" level crypto - so users could start using OQS algorithms in their code immediately just by dropping in the OQS provider without having to have a "custom" OpenSSL. Separate to that are the additional changes you need to OpenSSL to support full integration for things like TLS/CMS/whatever. Users that want that can download your fork. By having the two things separate it gives people a higher degree of flexibility depending on what they want to achieve.
I personally would like to see TLS pluggable signature support in 3.1. I expect and hope for X509 support in 3.0. I think the main thing preventing it at the moment is openssl#13893. Not sure what you mean by "keys" and "signatures" support...those things should be possible now. TLS pluggable signature support is of course missing, but you can do libcrypto signatures now. Not sure what is required for CMS.
3.0 won't be out until later this year. No timeline has yet been discussed for 3.1, but I'd be surprised if it was quicker than a year after the 3.0 release so we're talking 2022 at the earliest.
It would be nice if any work you did could be used as the basis for adding the missing features upstream once we start accepting patches for 3.1, e.g. rather than just hacking in OQS TLS signature support - actually adding pluggable signatures which could be used as the basis for that feature in mainline OpenSSL. |
@mattcaswell ninjaed me: I was writing exactly the same recommendations! |
If it were me, I'd go one step further and have the oqsprovider as a separately installable package... that's where I was going with what I did. Then, applications would only have to load it and use it. I don't see why it would need to be dropped into another application's source code (I assume that's what @mattcaswell meant). |
No. I meant what you said. |
Er, KEM tests? In |
Keys have support, at least in principle. There are corners where we haven't quite fulfilled that yet, but provider backed are meant to be possible to use (almost) everywhere, and transparently. X509 have some corners that we need to look at. "signatures"... I'm honestly mystified by this, because you already have that, per se. I assume it's this "pluggable signatures", which I've honestly not dived into, that you're talking about. |
Yes: That one's testing all OQS-KEMs.
ACK:
I know -- I already banged my head into/over those.
Yes. |
Thanks for this rather unanimous vote, @mattcaswell @romen @levitte : We'll then move this work to an OSSL-external project. Should also make work on a provider-encoder/decoder "strictly separate" from the start. @dstebila Would you please create an open-quantum-safe/oqs-provider repo? I'll manage it, clone https://github.com/levitte/tmp-oqsprov/ into it, add templating and KEM testing as per the above as well as CI-enablement, too (this one without docker auth to also allow non-OQS-core PRs). |
Done. Once there's a .circleci/config.yml I can enable the Circle CI integration as well. |
@baentsch, I ended up adding a groups test too. It's a bit of a hack, as it requires copying stuff from the OpenSSL source, and has patches for ssltestlib.c and ssltestlib.h. It builds, though, but doesn't test properly. |
@levitte , much appreciated. I'll take it from there. |
All work items as per the above complete with open-quantum-safe/oqs-provider#1. Further discussions regarding OQS-OpenSSL provider to occur in https://github.com/open-quantum-safe/oqs-provider/issues |
New APIs that we'll be able to make use of, including an EVP API for KEMs and forthcoming pluggable KEMs in TLS 1.3 (#233, openssl#13018).
The text was updated successfully, but these errors were encountered: