Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
efbb032
Code Base For Cryptoki PKCS#11 Rust Implementaion
oeweda Jun 17, 2026
1fbe4c6
Code Base For Cryptoki PKCS#11 Rust Implementaion
oeweda Apr 30, 2026
a73c01e
Added rust shell Rules to MODULE.bazel
oeweda May 3, 2026
477b6e0
Fix bazel ci errors
oeweda May 3, 2026
ff7af47
Fix Bazel Docs build issue
oeweda May 3, 2026
e89bfe4
Initial Cryptoki integration into ETAS
oeweda Jun 17, 2026
910be16
Initial Cryptoki integration into ETAS
oeweda Jun 10, 2026
1442241
(CI) fix documents
oeweda Jun 10, 2026
609cb83
CI (fix docs)
oeweda Jun 14, 2026
ffc0de4
Fix BUILD alias conflict and apply codebase formatting
oeweda Jun 17, 2026
0968186
Cryptoki: Fix OpenSSL link order and add copyrights
oeweda Jun 17, 2026
bc0b26b
skip SoftHSM token initialization when using Rust PKCS#11
oeweda Jun 22, 2026
b548e3a
Cryptoki: Migrate Rust PKCS#11 library to score/cryptoki
ShoroukRamzy Jul 6, 2026
4786f7b
perf: introduce weak PIN hashing as a temporary optimization workaround
ShoroukRamzy Jun 28, 2026
e80933e
checkpoint: working cryptoki state
ShoroukRamzy Jul 7, 2026
7d7506a
Cryptoki: Refactor PKCS#11 integration to use generic names
ShoroukRamzy Jul 16, 2026
42d6ce8
Test: Add Rust PKCS#11 library into the Docker integration sandbox
ShoroukRamzy Jul 16, 2026
a55e6c0
Test: Rename init_softhsm_token to generic init_pkcs11_token
ShoroukRamzy Jul 16, 2026
3758437
Build: Synchronize MODULE.bazel.lock with rebased dependencies
ShoroukRamzy Jul 19, 2026
253e959
update README
ShoroukRamzy Jul 19, 2026
74bd865
Test: Support dynamic libcryptoki detection in sandbox
ShoroukRamzy Jul 19, 2026
1711631
CI: Trigger rebuild after network timeout
ShoroukRamzy Jul 19, 2026
8e1dc3d
Build: Make OpenSSL version parsing fully dynamic in patch
ShoroukRamzy Jul 20, 2026
478aea9
Build: Align OpenSSL patch with S-CORE version
ShoroukRamzy Jul 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore the submodule
cpp/pkcs11test

# ignore Bazel's own output symlinks
bazel-inc_security_crypto
bazel-bin
bazel-out
bazel-testlogs
33 changes: 33 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
try-import %workspace%/user.bazelrc

build --per_file_copt=external/score_baselibs.*/.*@-Wno-deprecated-declarations
build --per_file_copt=external/score_logging.*/.*@-Wno-deprecated-declarations
common --@score_baselibs//score/json:base_library=nlohmann # TODO : https://github.com/eclipse-score/baselibs/issues/57

build --java_language_version=17
Expand All @@ -28,6 +29,7 @@ common --action_env=QNX_LICENSE_EXTSERVER_DELAY=59
# Disable for the moment as this leads to "warning: Cannot find Build server key, the value of QNX_LICENSE_QUEUE_TIMEOUT will be ignored."

test --test_output=errors
test --test_env=CRYPTOKI_WEAK_PIN_HASHING=1

# Bazel registry configuration
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
Expand All @@ -37,6 +39,7 @@ common --credential_helper=*.qnx.com=%workspace%/.github/tools/qnx_credential_he
common --credential_helper_timeout="60s"

# Shared configuration for simple test execution
common --experimental_isolated_extension_usages
build:shared --incompatible_strict_action_env
build:shared --sandbox_writable_path=/var/tmp
build:shared --host_platform=@score_bazel_platforms//:x86_64-linux
Expand All @@ -53,6 +56,7 @@ build:shared_qnx --cxxopt=-DGRPC_POSIX_SOCKET
build:shared_qnx --cxxopt=-DGRPC_POSIX_SOCKETUTILS
build:shared_qnx --cxxopt=-DGRPC_POSIX_WAKEUP_FD
build:shared_qnx --cxxopt=-DIP_PKTINFO=0
build:shared_qnx --@score_baselibs//score/memory/shared/flags:use_typedshmd=false

# -------------------------------------------------------------------------------
# Config dedicated to host platform CPU:x86_64 and OS:Linux
Expand Down Expand Up @@ -83,6 +87,14 @@ build:x86_64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene
test:x86_64-qnx --run_under=@score_qnx_unit_tests//src:run_under_qnx
test:x86_64-qnx --test_lang_filters=cc,rust

# -------------------------------------------------------------------------------
# Different toolchain configuration for x86_64-qnx
# -------------------------------------------------------------------------------
build:target_config_1 --config=x86_64-qnx
build:target_config_1 --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0
build:target_config_1 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
build:target_config_1 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800

# -------------------------------------------------------------------------------
# Config dedicated to target platform CPU:aarch64 and OS:QNX
# -------------------------------------------------------------------------------
Expand All @@ -95,3 +107,24 @@ build:aarch64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocen
test:aarch64-qnx --run_under=@score_qnx_unit_tests//src:run_under_qnx
test:aarch64-qnx --test_lang_filters=cc,rust
test:aarch64-qnx --test_timeout=180,900,2700,10800 # Increase default test timeout by factor 3

# -------------------------------------------------------------------------------
# Different toolchain configuration for aarch64-qnx
# -------------------------------------------------------------------------------
build:target_config_2 --config=aarch64-qnx
build:target_config_2 --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0
build:target_config_2 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
build:target_config_2 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800


# Clippy linting
build --aspects=@score_rust_policies//clippy:linters.bzl%clippy_strict
build --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
build --output_groups=+rules_lint_human
build:lint --@aspect_rules_lint//lint:fail_on_violation=true
build:lint --config=per-x86_64-linux
test --test_output=errors

# Run Cargo build.rs scripts locally so openssl-sys can access host license files
build:aarch64-qnx --strategy=CargoBuildScriptRun=local
build:host_config_1 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ compile_commands.json

# Devcontainer
.devcontainer/devcontainer-lock.json
# Ignore C++ native build directory
/cpp/build/*

# Rust
# Cargo
target/
**/*.rs.bk
17 changes: 17 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_tooling//:defs.bzl", "copyright_checker", "use_format_targets")
load("//:project_config.bzl", "PROJECT_CONFIG")

docs(
data = [
Expand All @@ -21,6 +23,20 @@ docs(
source_dir = ".",
)

package(default_visibility = ["//visibility:public"])

exports_files([
"Cargo.toml",
"Cargo.lock",
"README.md",
"LICENSE",
"NOTICE",
"CONTRIBUTION.md",
"MODULE.bazel",
"project_config.bzl",
"pyproject.toml",
])

copyright_checker(
name = "copyright",
srcs = [
Expand All @@ -36,4 +52,5 @@ copyright_checker(
visibility = ["//visibility:public"],
)

# Top-level aliases for ergonomic `bazel build/test //:foo` invocations
use_format_targets()
69 changes: 64 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,62 @@ filegroup(
urls = ["https://github.com/softhsm/SoftHSMv2/archive/refs/tags/2.7.0.tar.gz"],
)

# *******************************************************************************
# Valeo - Cryptoki
# *******************************************************************************
git_override(
module_name = "rules_rust",
commit = "2b171a7376e69cb1207eced1f66904ce4ae0c819",
remote = "https://github.com/pawelrutkaq/rules_rust.git",
)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
extra_target_triples = [
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-nto-qnx800",
"x86_64-pc-nto-qnx800",
],
versions = ["nightly/2024-04-16"],
)
use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")

bazel_dep(name = "rules_shell", version = "0.8.0")

bazel_dep(name = "score_rust_policies", version = "0.0.5", dev_dependency = True)

bazel_dep(name = "score_crates", version = "0.0.7")

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", isolate = True)
crate.from_cargo(
name = "crates",
cargo_lockfile = "//score/cryptoki:Cargo.lock",
manifests = ["//score/cryptoki:Cargo.toml"],
supported_platform_triples = [
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
"aarch64-unknown-nto-qnx710",
"x86_64-pc-nto-qnx710",
],
)
crate.annotation(
crate = "openssl-sys",
patch_args = ["-p0"],
patches = ["@@//third_party/patches:openssl_sys_build_rs.patch"],
deps = ["@@//third_party/openssl:openssl"],
)
use_repo(crate, "crates")

# ===============================================================================
# S C O R E M O D U L E S
# ===============================================================================

# tooling
bazel_dep(name = "score_tooling", version = "1.2.0")
bazel_dep(name = "score_rust_policies", version = "0.0.5")
bazel_dep(name = "aspect_rules_lint", version = "2.3.0")
bazel_dep(name = "buildifier_prebuilt", version = "8.5.1.2")

Expand All @@ -278,10 +327,7 @@ bazel_dep(name = "score_docs_as_code", version = "4.6.0")
bazel_dep(name = "score_process", version = "1.6.0")
bazel_dep(name = "score_platform", version = "0.6.0")

# s-core baselibs
bazel_dep(name = "score_baselibs", version = "0.2.7")

# Testing
# GoogleTest
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")

bazel_dep(name = "score_qnx_unit_tests", version = "0.2.0", dev_dependency = True)
Expand All @@ -293,4 +339,17 @@ git_override(
remote = "https://github.com/eclipse-score/qnx_unit_tests.git",
)

# s-core baselibs
bazel_dep(name = "score_baselibs", version = "0.2.7")
bazel_dep(name = "score_baselibs_rust", version = "0.1.2")

# Integration testing
bazel_dep(name = "score_itf", version = "0.1.0", dev_dependency = True)

bazel_dep(name = "score_python_basics", version = "0.3.4")
bazel_dep(name = "score_logging", version = "0.2.0")
single_version_override(
module_name = "score_logging",
patch_strip = 0,
patches = ["//third_party/patches:score_logging.patch"],
)
Loading
Loading