-
-
Notifications
You must be signed in to change notification settings - Fork 766
New OpenSSL 3.* API for managing EVP_PKEY objects #2368
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
Conversation
11c520b
to
2ce1b9b
Compare
a7d1739
to
7d520ac
Compare
The OpenSSL 3.* users now do not have a way to use non-deprecated API by using this rust bindings, which is not sustainable in the long term as either distributions will stop building with the deprecated API or it will be eventually removed. This is now mostly PoC on using RSA and ECDSA keys using the new API in tests. It does not expose all possible API that are available as I did not have a good way to test the unused API yet. I do not know if this API is available in some other *SSL libraries right now so for now all of the additions are marked with #[cfg(ossl300)]. This is partially based on sfackler#2051 which was abandoned. Fixes: sfackler#2047
7d520ac
to
fec04ce
Compare
For the record, there is a draft MR for sequoia to use the new API: https://gitlab.com/sequoia-pgp/sequoia/-/merge_requests/1765 There are still some rough edges that will need to be changed:
|
Simo asked me if I could take a look at this and share some thoughts as to whether this was reasonable. That's what I just did (i.e., I looked at a high level at the new APIs, I didn't really focus on their implementation.) Unfortunately, I think my response is not going to make anyone happy.
For that reason, I'm incredibly loathe to expose it as a public API in rust-openssl. In addition to just being shitty, impossible to document, and error prone, it also (inevitably?) leads to memory corruption issues (e.g. openssl/openssl#22629). Thus far, rust-openssl APIs that require Unfortunately, however, OpenSSL has decided However, merely looking at this makes me want to have nothing to do with OpenSSL. It's not your fault, they just made a bunch of really bad choices, and now I'd much rather put my energy into using some other cryptography library. If there's some direction that allows If, however, that's not possible, and supporting all of OpenSSL's new APIs (and removal of old ones) effectively requires making these public APIs for rust-openssl, then that's probably my cue that it's time to move on. Sorry, it's not for your fault, but unfortunately, those are the consequences of OpenSSL's decisions. |
Thank you for the comment @alex! This was first shot and I agree that this API might not be well suitable for the rust-openssl, see the notes I highlighted in the previous comments. The option to bury the I will try to experiment with one key type to see what can be done here. |
I did give a try to rewrite the RSA operations in #2380. It will likely need some more cleanup, but the basic tests seems to work, I am able to construct the RSA key from parameters, generate keys and extract parameters from the PKey structures like this. The structure is mostly based on the |
Closing this one as this does not look like going to be acceptable. Follow-up discussion is in #2380. |
The OpenSSL 3.* users now do not have a way to use non-deprecated API by using this rust bindings, which is not sustainable in the long term as either distributions will stop building with the deprecated API or it will be eventually removed.
This is now mostly PoC on using RSA and ECDSA keys using the new API in tests. It does not expose all possible API that are available as I did not have a good way to test the unused API yet.
I do not know if this API is available in some other *SSL libraries right now so for now all of the additions are marked with #[cfg(ossl300)].
This is partially based on #2051 which was abandoned.
Opening as a draft. I tried to follow existing logic in the project, but I might have missed some hints. Additionally, there are few TODO comments that point out to possible problematic API, where I would be happy to hear if that is acceptable or if we should try to figure out a better interface and how it should look like.
Fixes: #2047