Skip to content

Add OpenSSL 3.5 support to provider build and CI#333

Open
jenstopp wants to merge 4 commits intomainfrom
azihsm-sdk-ossl-3-5
Open

Add OpenSSL 3.5 support to provider build and CI#333
jenstopp wants to merge 4 commits intomainfrom
azihsm-sdk-ossl-3-5

Conversation

@jenstopp
Copy link
Copy Markdown
Collaborator

Summary

  • Add OpenSSL 3.5.0 as a second supported version alongside 3.0.3
  • CI now matrix-tests the provider against both versions
  • Fix a latent LD_LIBRARY_PATH bug in the CAPI test harness
  • Add infrastructure for future 3.5-only test gating

Motivation

OpenSSL 3.5 brings features we need for new features of the HSH lib.
This PR prepares the build and test infrastructure so that 3.5-specific
provider features can be added incrementally without breaking 3.0 support.

What changed

CI (.github/workflows/rust.yml)

  • provider_integration job uses matrix.openssl-version: ['3.0.3', '3.5.0']
  • 3.5 runs with continue-on-error while stabilising
  • All env vars (OPENSSL_DIR, OPENSSL_BIN, OPENSSL_LIB) parameterised
  • Bug fix: added missing OPENSSL_LIB to the CAPI test step (was the only
    step without it — masked on 3.0 because system libs are ABI-compatible)

CAPI test harness (openssl_capi_integration_tests.rs)

  • Added find_openssl_lib_dir() to resolve the OpenSSL shared library path
  • All Command::new(&openssl) calls in setup_keymat() now set
    LD_LIBRARY_PATH so the correct libcrypto.so.3 is found regardless
    of what the system provides

xtask

  • openssl_install.rs: parameterised to accept a version string
  • integration_tests.rs: added --openssl-version CLI argument
    (default 3.0.3; ignored when OPENSSL_DIR is already set)

Version gating (for future 3.5-only tests)

  • Shell tests: require_ossl_version + skip_below_ossl_3_5 helpers in env.sh
  • C++ tests: use existing #if OPENSSL_VERSION_MINOR >= 5 pattern (matches provider code)
  • No Cargo features needed — gating happens naturally in each test layer

Documentation (plugins/ossl_prov/README.md, xtask/README.md)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the OpenSSL provider build/test tooling so the repository can build and run provider integration tests against both OpenSSL 3.0.3 and 3.5.0, including CI matrix coverage and local xtask support.

Changes:

  • Add an OpenSSL-version selector to cargo xtask integration-tests and parameterize OpenSSL auto-install/build paths.
  • Update provider integration test harnesses/scripts to reliably load the intended OpenSSL shared libraries (especially for CAPI tests).
  • Expand GitHub Actions CI to matrix-test provider integration against OpenSSL 3.0.3 and 3.5.0 (3.5 allowed to fail while stabilizing), plus documentation updates.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
xtask/src/precheck.rs Passes an explicit OpenSSL version into the integration-test xtask when running full precheck.
xtask/src/openssl_install.rs Generalizes OpenSSL auto-install to accept a version string and parameterizes install/cache paths.
xtask/src/integration_tests.rs Adds --openssl-version CLI flag and wires it into OpenSSL resolution for integration tests.
xtask/README.md Documents the new integration-tests command and --openssl-version usage.
plugins/ossl_prov/integration-tests/openssl-cli/testfiles/env.sh Adds shell helpers to skip tests when OpenSSL is below a required version.
plugins/ossl_prov/integration-tests/openssl-capi/cpp/openssl_capi_integration_tests.rs Ensures OpenSSL subprocesses use the correct OpenSSL shared libs by setting LD_LIBRARY_PATH.
plugins/ossl_prov/README.md Documents supported OpenSSL versions and adds a comprehensive integration testing guide.
.github/workflows/rust.yml Adds OpenSSL version matrix for provider integration testing and wires env vars for each version.

Comment thread xtask/src/openssl_install.rs Outdated
Comment thread plugins/ossl_prov/README.md
@jenstopp jenstopp force-pushed the azihsm-sdk-ossl-3-5 branch from f320a96 to ae7cc25 Compare April 20, 2026 16:48
Copilot AI review requested due to automatic review settings April 20, 2026 20:19
@jenstopp jenstopp force-pushed the azihsm-sdk-ossl-3-5 branch from ae7cc25 to e34011b Compare April 20, 2026 20:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread xtask/src/openssl_install.rs Outdated
Comment thread xtask/src/integration_tests.rs
Copilot AI review requested due to automatic review settings April 21, 2026 09:32
@jenstopp jenstopp force-pushed the azihsm-sdk-ossl-3-5 branch from 0a0b521 to 6865a76 Compare April 21, 2026 09:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread xtask/src/integration_tests.rs Outdated
@jenstopp jenstopp added the ossl label Apr 21, 2026
Enable the provider to be built and tested against both OpenSSL 3.0.3
and 3.5.0 in parallel. No new provider features — this lays the
structural groundwork for upcoming 3.5-only functionality.

The provider's existing version guards (#if OPENSSL_VERSION_MINOR == 0)
already handle the polyfill exclusion correctly on 3.5. All 69
integration tests (27 CLI + 42 CAPI) pass on both versions.

Key changes:
- CI matrix on provider_integration job (3.0.3 + 3.5.0)
- xtask --openssl-version flag for local multi-version testing
- Fix: CAPI harness now sets LD_LIBRARY_PATH on openssl subprocesses
  (was relying on system libs being ABI-compatible — breaks on 3.5)
- Version gating helpers for future 3.5-only tests (C++ preprocessor
  guards, shell skip_below_ossl_3_5 helper)

Signed-off-by: Jens Topp <jens.topp@9elements.com>
Signed-off-by: Jens Topp <jens.topp@9elements.com>
Signed-off-by: Jens Topp <jens.topp@9elements.com>
Copilot AI review requested due to automatic review settings April 23, 2026 10:19
@jenstopp jenstopp force-pushed the azihsm-sdk-ossl-3-5 branch from 9cc2083 to 8ea8242 Compare April 23, 2026 10:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread xtask/src/integration_tests.rs
Signed-off-by: Jens Topp <jens.topp@9elements.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread xtask/src/precheck.rs
Comment on lines +229 to +232
integration_tests::IntegrationTest {
openssl_version: "3.0.3".to_string(),
}
.run(ctx.clone())?;
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates the default OpenSSL version already declared on the IntegrationTest CLI struct (default_value = \"3.0.3\"). To avoid drift if the default changes later, prefer constructing via a shared constant/default (e.g., a DEFAULT_OPENSSL_VERSION constant or impl Default for IntegrationTest).

Suggested change
integration_tests::IntegrationTest {
openssl_version: "3.0.3".to_string(),
}
.run(ctx.clone())?;
integration_tests::IntegrationTest::parse_from(["integration-test"])
.run(ctx.clone())?;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants