Skip to content

Use CMake find_package for OpenSSL - #3662

Open
geedo0 wants to merge 1 commit into
feat/provider-errorsfrom
feat/provider-distro
Open

geedo0 wants to merge 1 commit into
feat/provider-errorsfrom
feat/provider-distro

Conversation

@geedo0

@geedo0 geedo0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Context and motivation

The Amazon Linux aws-lc RPM spec could not build the provider as a subpackage. AWSLC_PROVIDER_OPENSSL_ROOT was an install prefix, so a distro passing /usr/include had it searched as /usr/include/include, and the provider had no install() rule, so a %files entry for the module could never be satisfied.

Description of changes

  • OpenSSL is found through CMake's find_package(OpenSSL). AWSLC_PROVIDER_OPENSSL_ROOT is removed in favor of the standard OPENSSL_ROOT_DIR hint. Unset, system paths are searched, which is the openssl-devel case.
  • OPENSSL_ROOT_DIR is treated as exclusive on every CMake. FindOpenSSL honors the root exclusively only on recent CMake. On 3.22 it falls back to system paths and skips lib64, which compiled the provider against pinned 3.5 headers while linking the system 3.0 libcrypto. When the root is set, the provider resolves the include directory and libcrypto under it first and fails if either is missing.
  • The 3.5 version floor reads OPENSSL_VERSION from FindOpenSSL. The previous OPENSSL_VERSION_STR regex could not reject AWS-LC's own headers, which define only the hex number.
  • The module installs to ${CMAKE_INSTALL_LIBDIR}/ossl-modules, overridable through the new AWSLC_PROVIDER_MODULESDIR cache variable. It is relative, so --prefix and DESTDIR work, and it matches OpenSSL's own default modules directory.

Testing

  • Provider CI, both FIPS axes, through tests/ci/run_aws_lc_provider_tests.sh, which now passes -DOPENSSL_ROOT_DIR.
  • The real aws-lc-5.2.0-2.amzn2027 spec with a provider subpackage builds aws-lc-provider, which owns /usr/lib64/ossl-modules/awslc.so and picks up libcrypto-awslc.so.1(AWS_LC_1.0) as an automatic requirement.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@geedo0
geedo0 requested a review from a team as a code owner October 16, 2026 17:21
@geedo0
geedo0 added this pull request to stack #3663 October 16, 2026 17:21
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.71%. Comparing base (8080fe6) to head (e7b1674).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           feat/provider-errors    #3662   +/-   ##
=====================================================
  Coverage                 78.71%   78.71%           
=====================================================
  Files                       705      705           
  Lines                    130757   130757           
  Branches                  17922    17923    +1     
=====================================================
  Hits                     102920   102920           
- Misses                    26857    26858    +1     
+ Partials                    980      979    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

🔒 Security Review — View Report

Please review before merging.

This branch has not been deployed

No deployments
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