Skip to content

Add OpenSSL 4.x support and switch to provider-only mode#634

Merged
mtrojnar merged 6 commits intoOpenSC:masterfrom
olszomal:noengine
Feb 1, 2026
Merged

Add OpenSSL 4.x support and switch to provider-only mode#634
mtrojnar merged 6 commits intoOpenSC:masterfrom
olszomal:noengine

Conversation

@olszomal
Copy link
Collaborator

@olszomal olszomal commented Jan 21, 2026

Pull Request Type

  • Bug fix
  • New feature
  • Code style / formatting / renaming
  • Refactoring (no functional or API changes)
  • Build / CI related changes
  • Documentation
  • Other (please describe): Enable OpenSSL 4.x support

Related Issue

Issue number: #631

Current Behavior

libp11 does not build correctly with OpenSSL 4.x.

New Behavior

libp11 builds cleanly with OpenSSL 4.x

Scope of Changes

  • Detect OpenSSL 4.x and enable provider mode in the build system.
  • Guard ENGINE-related code with OPENSSL_NO_ENGINE.
  • Disable legacy custom EVP_PKEY_METHOD handling for OpenSSL 4.x.
  • Adjust or skip ENGINE-based tests when running against OpenSSL 4.x.

Testing

  • Existing tests
  • New tests added
  • Manual testing
    Tested with OpenSSL 3.x (all tests passing).
    Some OpenSSL 4.0.0-dev test failures are expected at this stage and will be handled in subsequent PRs.

Additional Notes

Behavior for OpenSSL ≤ 3.x is preserved.
In OpenSSL 4.x, the OPENSSL_NO_ENGINE macro is always defined. ENGINE-based code paths are therefore intentionally disabled.

License Declaration

  • I hereby agree to license my contribution under the project's license.

@mtrojnar
Copy link
Member

I think returning 0 (success) in tests that are never supposed to be executed could be confusing. Should we return something else, such as 1 or 77, just in case someone decides to execute this code anyway? Printing an error message would be a good idea as well.

@mtrojnar mtrojnar merged commit 1282b4c into OpenSC:master Feb 1, 2026
10 checks passed
@olszomal olszomal deleted the noengine branch February 5, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants