pkey: add support for OpenSSL 3 provider-only pkeys#898
Merged
rhenium merged 4 commits intoruby:masterfrom Jun 25, 2025
Merged
Conversation
Move the #include from ossl_provider.c to ossl.h. As OpenSSL 3 provider functions will be used in multiple source files, having it in the common header file is convenient.
For algorithms implemented solely in an OpenSSL 3 provider, without an associated EVP_PKEY_METHOD, EVP_PKEY_id() returns a special value EVP_PKEY_KEYMGMT. Let OpenSSL::PKey::PKey#oid raise an exception as necessary. Update PKey#inspect to include the string returned by EVP_PKEY_get0_type_name(), if available.
Algorithms implemented only in OpenSSL 3 providers may not have a corresponding NID. The *_ex() variants have been added in OpenSSL 3.0 to handle such algorithms, by taking algorithm names as a string.
Currently, RI2 Ruby 3.2 and ruby-loco mswin builds contain OpenSSL 3.4 DLLs while mingw-w64 and vcpkg provide OpenSSL 3.5 headers. Overwrite the builtin DLLs with 3.5 ones so that we can compile and test using the same OpenSSL version. The root cause has been fixed in RI2 Ruby 3.4.
a1c6de0 to
6b57cf9
Compare
5 tasks
Member
|
Thank you for the PR! I confirmed the |
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.
This includes two changes:
pkey: handle EVP_PKEY_KEYMGMT return by EVP_PKEY_id()
For algorithms implemented solely in an OpenSSL 3 provider, without an associated
EVP_PKEY_METHOD,EVP_PKEY_id()returns a special valueEVP_PKEY_KEYMGMT.Let
OpenSSL::PKey::PKey#oidraise an exception as necessary. UpdatePKey#inspectto include the string returned byEVP_PKEY_get0_type_name(), if available.pkey: use EVP_PKEY_new_raw_{private,public}_key_ex() if available
Algorithms implemented only in OpenSSL 3 providers may not have a corresponding NID. The
*_ex()variants have been added in OpenSSL 3.0 to handle such algorithms, by taking algorithm names as a string.