Add PKCS#11 provider compatible with OpenSSL 3.x/4.0#650
Merged
mtrojnar merged 12 commits intoOpenSC:masterfrom Apr 21, 2026
Merged
Add PKCS#11 provider compatible with OpenSSL 3.x/4.0#650mtrojnar merged 12 commits intoOpenSC:masterfrom
mtrojnar merged 12 commits intoOpenSC:masterfrom
Conversation
Using up_ref() shared the same EVP_PKEY instance and unnecessarily increased the reference count of the underlying engine-backed key, leading to incorrect lifetime management.
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.
Pull Request Type
Related Issue
Fix #631
Current Behavior
The existing PKCS#11 integration relies on legacy EVP_PKEY_METHOD-based implementations, which are deprecated and removed in OpenSSL 4.0. As a result, the current implementation is not compatible with OpenSSL 4.0.
EdDSA support is also conditionally guarded using incorrect macros (OPENSSL_NO_EC instead of OPENSSL_NO_ECX), leading to potential build and feature inconsistencies.
New Behavior
This PR introduces a new PKCS#11 provider implementation compatible with OpenSSL 3.x and forward-compatible with OpenSSL 4.0, replacing legacy EVP_PKEY_METHOD usage with provider-based interfaces (KEYMGMT, SIGNATURE, ASYM_CIPHER).
EdDSA support is properly handled using OPENSSL_NO_ECX, and key handling, reference management, and cleanup logic have been corrected.
Scope of Changes
Testing
Additional Notes
License Declaration