Skip to content

feat(cryptoki): multi-slot support, C_initialize optimization and token initialization improvements - #276

Merged
ChansAlive merged 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:feat/cryptoki-init-and-multislot
Oct 13, 2026
Merged

ChansAlive merged 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:feat/cryptoki-init-and-multislot

Conversation

@ShoroukRamzy

@ShoroukRamzy ShoroukRamzy commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Note
This PR is needed before the PR that will be implemented for this issue #177

Changes

1. Multi-Slot Configuration (openssl_provider.rs): Implemented slot_count() on OpenSslEngine to dynamically read CRYPTOKI_NUM_SLOTS (defaults to 1). Enables multi-token isolation tests to run on independent virtual slots.

2. Startup Performance Optimization (lifecycle_and_slot_token.rs, object_store.rs, token.rs):

  • Swapped initialization order to load persisted objects from disk first.
  • Introduced replace_token() to load saved token state directly into RAM, bypassing redundant default Argon2id password hashing (~8.7x faster boot time).

3. Factory Default SO PIN Transition (token.rs, pkcs11_v3_integration.rs):

  • Allowed C_InitToken to format tokens when still in the unconfigured factory default state (b"so-pin"), accepting custom PINs on initial format while strictly enforcing PIN verification thereafter. Added test_init_token_custom_pin_transition.

Next
Implement PR for this issue #177

@github-actions

github-actions Bot commented Oct 6, 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.6.0) and connecting to it...
INFO: Invocation ID: 41325a60-cba3-4ea1-8f1f-37714df4ddac
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'abseil-cpp+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-m3oGQwXp/ZTRJP+mzDWFkutCtdpYj7TgfQklSqQAhts="
DEBUG: Repository abseil-cpp+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:431:31: in <toplevel>
DEBUG: Rule 'protobuf+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-w6Cp7OiTLjHDtzbi2xixxC5wcM2biBOIsm0BqnHiTKI="
DEBUG: Repository protobuf+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:431:31: in <toplevel>
Computing main repo mapping: 
DEBUG: Rule 'grpc+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-CvN7gAlTEwtHwHW1ZoPuYL3D7aPDf8YAQZP1tWl1ggQ="
DEBUG: Repository grpc+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:431:31: in <toplevel>
WARNING: For repository 'score_bazel_platforms', the root module requires module version score_bazel_platforms@0.1.2, but got score_bazel_platforms@1.1.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_process_description', the root module requires module version score_process_description@2.1.1, but got score_process_description@2.1.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 1 packages loaded
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/inc_security_crypto/inc_security_crypto/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/inc_security_crypto/inc_security_crypto/BUILD
INFO: Elapsed time: 14.576s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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

@ShoroukRamzy
ShoroukRamzy force-pushed the feat/cryptoki-init-and-multislot branch from 9466b45 to 3df25ac Compare October 6, 2026 11:19
@ShoroukRamzy
ShoroukRamzy deployed to workflow-approval October 6, 2026 11:19 — with GitHub Actions Active
@ShoroukRamzy
ShoroukRamzy deployed to workflow-approval October 6, 2026 11:19 — with GitHub Actions Active
@ShoroukRamzy
ShoroukRamzy deployed to workflow-approval October 6, 2026 11:19 — with GitHub Actions Active
Comment thread score/cryptoki/pkcs11/token.rs
@ShoroukRamzy ShoroukRamzy mentioned this pull request Oct 12, 2026
1 task
@ChansAlive
ChansAlive merged commit 5e6f64d into eclipse-score:main Oct 13, 2026
16 checks passed

This branch was successfully deployed

1 active deployment
workflow-approval — 3df25ac8 Deployed Oct 6, 2026 by ShoroukRamzy via Build and Test x86_64-qnx-itf / approval #524
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.

3 participants