Skip to content

Feat/decouple dynamic linking switches for PKCS11 and OpenSSL - #456

Open
ShoroukRamzy wants to merge 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:feat/decouple-dynamic-linking-switches
Open

ShoroukRamzy wants to merge 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:feat/decouple-dynamic-linking-switches

Conversation

@ShoroukRamzy

@ShoroukRamzy ShoroukRamzy commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Note stacked on #317 and should be merged after it.
Closes #348
unblocks #173

  • Decouple OpenSSL and PKCS#11 dynamic linking switches.
  • Eliminate OpenSSL dependency pollution from init_pkcs11_token
  • provide static linking parity for Rust Cryptoki.

Note
The rust_cryptoki_selected config group is temporarily maintained because the C++ token parser still uses the legacy #if USE_RUST_PKCS11 macro. This macro has already been removed in PR #420, and these temporary config settings will be cleaned up once #420 is merged.

@ShoroukRamzy

Copy link
Copy Markdown
Contributor Author

Hi @OliverHeilwagen, this PR is stacked on top of #317 and the scope of this PR is only this commit 157cba9

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.8.2) and connecting to it...
INFO: Invocation ID: 6151010a-7313-44e8-9e9a-58104d951ad0
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'rules_python', the root module requires module version rules_python@1.8.5, but got rules_python@1.9.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_bazel_platforms', the root module requires module version score_bazel_platforms@0.1.2, but got score_bazel_platforms@1.3.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.2.22, but got rules_cc@0.2.26 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 1 packages loaded
Loading: 1 packages loaded
    currently loading: 
Loading: 1 packages loaded
    currently loading: 
Loading: 1 packages loaded
    currently loading: 
Loading: 1 packages loaded
    currently loading: 
Loading: 1 packages loaded
    currently loading: 
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/crypto/crypto/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/crypto/crypto/BUILD
INFO: Elapsed time: 14.685s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@ShoroukRamzy ShoroukRamzy changed the title Feat/decouple dynamic linking switches Feat/decouple dynamic linking switches for PKCS11 and OpenSSL Nov 19, 2026
@ShoroukRamzy

Copy link
Copy Markdown
Contributor Author

@OliverHeilwagen, Per your suggestion, I executed local trials across the combinations not covered by CI and all passed
Combination 1: Default Static Build (DR-002 Baseline)

1 bazel build //score/crypto/src/daemon:crypto_daemon //score/tests/integration_tests:init_pkcs11_token

  • Output: INFO: Analyzed 2 targets... Found 2 targets... Build completed successfully, 7 total actions
  • Status: PASS

Combination 2: Dynamic OpenSSL Decoupled (--config=openssl-dynamic)

1 bazel build //score/crypto/src/daemon:crypto_daemon --config=openssl-dynamic

  • Output: INFO: Analyzed target //score/crypto/src/daemon:crypto_daemon... Build completed successfully, 7 total actions
  • Status: PASS (SoftHSM remained static; only openssl_shared was dynamic).

Combination 3: Dynamic PKCS#11 with Enforced Guardrail (--config=pkcs11-dynamic)

1 bazel build //score/crypto/src/daemon:crypto_daemon --config=pkcs11-dynamic

  • Output: INFO: Analyzed target //score/crypto/src/daemon:crypto_daemon... Build completed successfully, 5 total actions
  • Status: PASS (Both dynamically linked to share a single in-memory libcrypto.so).

Combination 4: Dynamic PKCS#11 with OpenSSL Disabled + readelf Check

1 bazel build //score/crypto/src/daemon:crypto_daemon
2 --//score/crypto/src/backend:pkcs11_link_type=dynamic
3 --//score/crypto/src/backend:score_crypto_score_backend_enabled=False
4 readelf -d bazel-bin/score/crypto/src/daemon/crypto_daemon | grep NEEDED

  • Output:

1 0x0000000000000001 (NEEDED) Shared library: [libsofthsm2.so]
2 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
3 0x0000000000000001 (NEEDED) Shared library: [libc.so.6]

  • Status: PASS (libopenssl.so is 100% absent from the binary's direct dependencies!).

Combination 5: Tool Isolation (init_pkcs11_token) + readelf Check

1 bazel build //score/tests/integration_tests:init_pkcs11_token --//score/crypto/src/backend:pkcs11_link_type=dynamic
2 readelf -d bazel-bin/score/tests/integration_tests/init_pkcs11_token | grep NEEDED

  • Output:

1 0x0000000000000001 (NEEDED) Shared library: [libsofthsm2.so]
2 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
3 0x0000000000000001 (NEEDED) Shared library: [libc.so.6]

  • Status: PASS (libopenssl.so is 100% eliminated from the provisioning tool!).

Combination 6: Cryptoki Static Linking Parity (rust_static_library)

1 bazel build //score/crypto/src/daemon:crypto_daemon
2 --//score/crypto/src/backend:pkcs11_backend=//score/cryptoki:cryptoki_static_wrapped --nobuild

  • Output: INFO: Analyzed target //score/crypto/src/daemon:crypto_daemon (29019 targets configured)... Build completed successfully, 0 total actions
  • Status: PASS

Combination 7: Cryptoki Dynamic Plugin Linking (rust_shared_library)

1 bazel build //score/crypto/src/daemon:crypto_daemon
2 --//score/crypto/src/backend:pkcs11_backend=//score/cryptoki:cryptoki_cdylib_wrapped --nobuild

  • Output: INFO: Analyzed target //score/crypto/src/daemon:crypto_daemon (29017 targets configured)... Build completed successfully, 0 total actions
  • Status: PASS

Combination 8: Full Crypto & Integration Test Suites

1 bazel build //score/crypto/... //score/tests/integration_tests/...

  • Output: INFO: Analyzed 211 targets (28645 targets configured)... Build completed successfully, 53 total actions
  • Status: PASS (All 211 targets green!).

@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-456: https://eclipse-score.github.io/crypto/pr-456/

@ShoroukRamzy
ShoroukRamzy force-pushed the feat/decouple-dynamic-linking-switches branch from d9c4701 to 4e33775 Compare November 19, 2026 18:42

This branch is waiting to be deployed

1 waiting deployment
workflow-approval — 4e337756 Waiting Nov 19, 2026 by ShoroukRamzy via Build and Test aarch64-qnx / approval #1149
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant