Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a2dd59d
test: add React and WASM tests
Manuthor Feb 8, 2026
fa8b1ea
chore: fix Nix expected hashes
Manuthor Feb 8, 2026
5a6816c
ci: fix React tests
Manuthor Feb 9, 2026
87ffa84
set up environment
p0wline Feb 16, 2026
0d1fcfc
fix(linux): upgrade glibc from 2.28 to 2.34 - support Debian 12+, Ubu…
Manuthor Feb 12, 2026
e5388e9
docs: update OpenSSL versions (#713)
Manuthor Feb 12, 2026
c49c5e4
feat(ui): clear Cosmian theme and make it post-build-configurable (#704)
Manuthor Feb 13, 2026
4df61e5
feat: add KMIP restricting algorithms policy (#700)
Manuthor Feb 15, 2026
465c1a2
build: release 5.16.0
Manuthor Feb 15, 2026
fb967cc
chore: update sbom reports
Manuthor Feb 15, 2026
52a6602
build: release 5.16.1
Manuthor Feb 15, 2026
bc90649
chore: fix Nix expected hashes
Manuthor Feb 16, 2026
06d71e3
remove useless code
p0wline Feb 13, 2026
639458f
fix recursive revocation
p0wline Feb 17, 2026
cc507f3
chore: fix Nix expected hashes
Manuthor Feb 8, 2026
2070a17
ci: fix React tests
Manuthor Feb 9, 2026
21108ec
Merge branch 'develop' into test/add_ui_tests
p0wline Feb 17, 2026
d8d7233
chore: fix Nix expected hashes
p0wline Feb 17, 2026
06c2573
fix branding error in tests
p0wline Feb 18, 2026
f7e8edf
add integration tests
p0wline Feb 18, 2026
df825f2
increase time waiting for kms server
p0wline Feb 19, 2026
4d73b88
update packages and fix eslint error
p0wline Feb 19, 2026
36a1afe
update npm packages
p0wline Feb 19, 2026
eba348c
update npm packages
p0wline Feb 19, 2026
a9e9d65
fix: test wasm
Manuthor Feb 19, 2026
73dfbf6
fix: test wasm
Manuthor Feb 19, 2026
7e8ddff
fix: test wasm
Manuthor Feb 19, 2026
3eb7050
fix: packaging
Manuthor Feb 20, 2026
6fd238b
chore: update Nix expected hashes
Manuthor Feb 20, 2026
f947c2e
fix: audit problem
Manuthor Feb 20, 2026
1b445c6
test: regenerate package-lock.json
Manuthor Feb 20, 2026
8dea593
fix: test wasm
Manuthor Feb 20, 2026
98648cb
fix: npm warnings
Manuthor Feb 21, 2026
4bd8137
fix: non-FIPS deterministic build (#720)
Manuthor Feb 21, 2026
1d9bf9a
fix: remove dead Nix code
Manuthor Feb 22, 2026
fb3687d
chore: update Nix expected hash
Manuthor Feb 22, 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
38 changes: 34 additions & 4 deletions .github/scripts/build_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,40 @@ cp -R pkg "$WASM_DIR"
# Build UI
cd ../../ui # current path: ./ui
rm -rf node_modules
npm install
npm run build
npm run lint
npm audit

if [ -f pnpm-lock.yaml ]; then
if ! command -v pnpm >/dev/null 2>&1; then
if command -v corepack >/dev/null 2>&1; then
corepack enable || true
corepack prepare pnpm@9 --activate || true
fi
fi
if ! command -v pnpm >/dev/null 2>&1; then
if ! npm install -g pnpm@9; then
PREFIX_DIR="${PNPM_PREFIX_DIR:-$HOME/.local}"
npm install -g pnpm@9 --prefix "$PREFIX_DIR"
export PATH="$PREFIX_DIR/bin:$PATH"
fi
fi

pnpm install --frozen-lockfile
pnpm run build
pnpm run test
pnpm run lint
pnpm audit
elif [ -f package-lock.json ]; then
npm ci
npm run build
pnpm run test
npm run lint
npm audit
else
npm install
npm run build
npm run test
npm run lint
npm audit
fi

# Deploy built UI to root
cd .. # current path: ./
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ ensure_macos_frameworks_ldflags() {

# Unified nixpkgs pin (used by all scripts)
# Keep a single source of truth for the pinned nixpkgs URL.
# Pin nixpkgs for a stable toolchain; Linux builds target GLIBC <= 2.34.
export PIN_URL="https://github.com/NixOS/nixpkgs/archive/24.11.tar.gz"
# IMPORTANT: Use an immutable commit tarball to ensure builds are deterministic across machines.
export PIN_URL="https://github.com/NixOS/nixpkgs/archive/8b27c1239e5c421a2bbc2c65d52e4a6fbf2ff296.tar.gz"
# Backward-compatible alias used by some scripts
export PINNED_NIXPKGS_URL="$PIN_URL"

Expand Down
51 changes: 23 additions & 28 deletions .github/scripts/nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ usage() {
-l, --link <static|dynamic> OpenSSL linkage type (default: static)
static: statically link OpenSSL 3.6.0
dynamic: dynamically link system OpenSSL
--enforce-deterministic-hash <true|false>
When true, enforce expected hashes (fail on mismatch).
When false (default), relax expected-hash enforcement.

For testing, also supports environment variables:
REDIS_HOST, REDIS_PORT
Expand Down Expand Up @@ -163,7 +160,6 @@ parse_global_options() {
PROFILE="debug"
VARIANT="fips"
LINK="static"
ENFORCE_DETERMINISTIC_HASH="false"

# Parse global options before the subcommand
while [ $# -gt 0 ]; do
Expand All @@ -182,10 +178,6 @@ parse_global_options() {
LINK_EXPLICIT=1
shift 2 || true
;;
--enforce-deterministic-hash | --enforce_deterministic_hash)
ENFORCE_DETERMINISTIC_HASH="${2:-}"
shift 2 || true
;;
docker | test | package | sbom | update-hashes)
COMMAND="$1"
shift
Expand All @@ -208,17 +200,7 @@ parse_global_options() {
# Validate command argument
[ -z "${COMMAND:-}" ] && usage

# Normalize boolean-ish inputs
case "${ENFORCE_DETERMINISTIC_HASH}" in
true | TRUE | 1) ENFORCE_DETERMINISTIC_HASH="true" ;;
false | FALSE | 0 | "") ENFORCE_DETERMINISTIC_HASH="false" ;;
*)
echo "Error: --enforce-deterministic-hash must be true/false" >&2
exit 1
;;
esac

export PROFILE VARIANT LINK ENFORCE_DETERMINISTIC_HASH
export PROFILE VARIANT LINK
REMAINING_ARGS=("$@")
}

Expand Down Expand Up @@ -265,6 +247,14 @@ resolve_command_args() {
export WITH_DOCKER=1
fi

# WASM/UI integration tests start a KMS server via `cargo run` and poll for
# readiness before launching vitest. The poll loop requires curl to avoid
# falling back to a bare `sleep 2` that is far too short for a cold debug
# build on CI. Wire it in here so shell.nix includes it when WITH_WASM=1.
if [ "$COMMAND" = "test" ] && [ "${TEST_TYPE:-}" = "wasm" ]; then
export WITH_CURL=1
fi

# In strict mode (`set -u`), expanding an unset array triggers an error.
# Use the nounset-safe idiom so CI invocations without trailing args work.
COMMAND_ARGS=("${args[@]+"${args[@]}"}")
Expand Down Expand Up @@ -492,6 +482,10 @@ test_command() {
if [ "$TEST_TYPE" = "hsm" ] || [ "$TEST_TYPE" = "all" ]; then
export WITH_HSM=1
fi
# For WASM/UI tests, ensure shell.nix includes Node.js + wasm-pack (+ pnpm).
if [ "$TEST_TYPE" = "wasm" ] || [ "$TEST_TYPE" = "all" ]; then
export WITH_WASM=1
fi
# For PyKMIP tests, ensure Python tooling is present inside the Nix shell
if [ "$TEST_TYPE" = "pykmip" ]; then
export WITH_PYTHON=1
Expand Down Expand Up @@ -548,7 +542,7 @@ sbom_command() {
args+=("$1" "$2")
shift 2
;;
-h|--help)
-h | --help)
args+=("$1")
shift
;;
Expand Down Expand Up @@ -683,7 +677,7 @@ package_command() {
echo "Note: Building DMG via nix-shell to allow macOS system tools (cargo-packager path)."
# shellcheck disable=SC2086
nix-shell -I "nixpkgs=${PIN_URL}" $KEEP_VARS --argstr variant "$VARIANT" "$REPO_ROOT/shell.nix" \
--run "ENFORCE_DETERMINISTIC_HASH='${ENFORCE_DETERMINISTIC_HASH}' bash '$SCRIPT' --variant '$VARIANT' --link '$LINK' --enforce-deterministic-hash '${ENFORCE_DETERMINISTIC_HASH}'"
--run "bash '$SCRIPT' --variant '$VARIANT' --link '$LINK'"
OUT_DIR="$REPO_ROOT/result-dmg-$VARIANT-$LINK"
dmg_file=$(find "$OUT_DIR" -maxdepth 1 -type f -name '*.dmg' | head -n1 || true)
if [ -n "${dmg_file:-}" ] && [ -f "$dmg_file" ]; then
Expand Down Expand Up @@ -738,7 +732,7 @@ package_command() {
echo "Missing $SCRIPT_LINUX" >&2
exit 1
}
nix-shell -I "nixpkgs=${NIXPKGS_ARG}" -p curl --run "ENFORCE_DETERMINISTIC_HASH='${ENFORCE_DETERMINISTIC_HASH}' bash '$SCRIPT_LINUX' --variant '$BUILD_VARIANT' --link '$BUILD_LINK' --enforce-deterministic-hash '${ENFORCE_DETERMINISTIC_HASH}'"
nix-shell -I "nixpkgs=${NIXPKGS_ARG}" -p curl --run "bash '$SCRIPT_LINUX' --variant '$BUILD_VARIANT' --link '$BUILD_LINK'"
REAL_OUT="$REPO_ROOT/result-deb-$BUILD_VARIANT-$BUILD_LINK"
echo "Built deb ($BUILD_VARIANT-$BUILD_LINK): $REAL_OUT"

Expand Down Expand Up @@ -771,7 +765,7 @@ package_command() {
echo "Missing $SCRIPT_LINUX" >&2
exit 1
}
nix-shell -I "nixpkgs=${NIXPKGS_ARG}" -p curl --run "ENFORCE_DETERMINISTIC_HASH='${ENFORCE_DETERMINISTIC_HASH}' bash '$SCRIPT_LINUX' --variant '$BUILD_VARIANT' --link '$BUILD_LINK' --enforce-deterministic-hash '${ENFORCE_DETERMINISTIC_HASH}'"
nix-shell -I "nixpkgs=${NIXPKGS_ARG}" -p curl --run "bash '$SCRIPT_LINUX' --variant '$BUILD_VARIANT' --link '$BUILD_LINK'"
REAL_OUT="$REPO_ROOT/result-rpm-$BUILD_VARIANT-$BUILD_LINK"
echo "Built rpm ($BUILD_VARIANT-$BUILD_LINK): $REAL_OUT"

Expand Down Expand Up @@ -810,7 +804,7 @@ package_command() {
ATTR="kms-server-${BUILD_VARIANT}-dmg"
OUT_LINK="$REPO_ROOT/result-dmg-$BUILD_VARIANT-$BUILD_LINK"
fi
nix-build -I "nixpkgs=${NIXPKGS_ARG}" --arg enforceDeterministicHash "$ENFORCE_DETERMINISTIC_HASH" "$REPO_ROOT/default.nix" -A "$ATTR" -o "$OUT_LINK"
nix-build -I "nixpkgs=${NIXPKGS_ARG}" "$REPO_ROOT/default.nix" -A "$ATTR" -o "$OUT_LINK"
REAL_OUT=$(readlink -f "$OUT_LINK" || echo "$OUT_LINK")
echo "Built dmg ($BUILD_VARIANT-$BUILD_LINK): $REAL_OUT"

Expand Down Expand Up @@ -914,10 +908,11 @@ run_in_nix_shell() {
EXTRA_PKGS=""
else
if [ "$COMMAND" = "test" ] && [ "$TEST_TYPE" = "wasm" ]; then
PURE_FLAG=""
KEEP_ARGS=""
EXTRA_PKGS="-p nodejs wasm-pack"
SHELL_PATH="<nixpkgs>"
# Use the project shell.nix so the server build uses nix/openssl.nix.
PURE_FLAG="--pure"
KEEP_ARGS="$KEEP_VARS"
EXTRA_PKGS=""
SHELL_PATH="$REPO_ROOT/shell.nix"
elif [ "$COMMAND" = "test" ] && [ "$TEST_TYPE" = "otel_export" ]; then
PURE_FLAG=""
else
Expand Down
49 changes: 31 additions & 18 deletions .github/scripts/smoke_test_dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ if [[ "$DMG_FILE" == *"fips"* ]] && [[ "$DMG_FILE" != *"non-fips"* ]]; then
IS_FIPS=true
fi



[ -f "$DMG_FILE" ] || error "DMG not found: $DMG_FILE"

info "Starting smoke test for: $DMG_FILE"
Expand All @@ -62,16 +60,12 @@ for i in $(seq 1 "$ATTACH_RETRIES"); do
done

if [ "$attached" != true ]; then
# GitHub-hosted macOS runners sometimes fail with:
# hdiutil: attach failed - Resource temporarily unavailable
# Treat this as non-blocking in CI: packaging artifacts are still produced.
if [ "${CI:-}" = "true" ] || [ -n "${GITHUB_ACTIONS:-}" ]; then
warn "Failed to attach DMG (non-blocking in CI)."
warn "hdiutil error: Resource temporarily unavailable"
warn "Skipping DMG smoke test for: $DMG_FILE"
exit 0
fi
error "Failed to attach DMG"
# hdiutil attach can fail on both CI runners and local machines
# (e.g. "Resource temporarily unavailable"). The DMG artefact was already
# produced successfully, so treat this as non-blocking everywhere.
warn "Failed to attach DMG after ${ATTACH_RETRIES} attempt(s)."
warn "Skipping DMG smoke test for: $DMG_FILE"
exit 0
fi
[ -d "$MOUNT_POINT" ] || error "Mount point not found"
info "Mounted at: $MOUNT_POINT"
Expand Down Expand Up @@ -131,8 +125,8 @@ if [ "$IS_FIPS" = true ]; then
fi
info "\xe2\x9c\x93 OpenSSL config free of Nix paths"
# Accept either absolute include to /usr/local path or a relative include
if grep -q '^.include /usr/local/cosmian/lib/ssl/fipsmodule.cnf' "$OSSL_CONF" || \
grep -q '^.include\s\+fipsmodule.cnf' "$OSSL_CONF"; then
if grep -q '^.include /usr/local/cosmian/lib/ssl/fipsmodule.cnf' "$OSSL_CONF" ||
grep -q '^.include\s\+fipsmodule.cnf' "$OSSL_CONF"; then
info "\xe2\x9c\x93 openssl.cnf include directive present"
else
warn ".include directive missing or unexpected in openssl.cnf"
Expand Down Expand Up @@ -167,10 +161,26 @@ if [ "$IS_FIPS" = true ]; then
ENV_OPENSSL_MODULES="$CHECK_DIR/usr/local/cosmian/lib/ossl-modules"
fi

# For non-FIPS builds, set OPENSSL_MODULES to point to bundled provider modules
# so the legacy provider can be loaded during smoke test execution.
if [ "$IS_FIPS" != true ]; then
NON_FIPS_OSSL_MODULES="$CHECK_DIR/usr/local/cosmian/lib/ossl-modules"
if [ -d "$NON_FIPS_OSSL_MODULES" ]; then
ENV_OPENSSL_MODULES="$NON_FIPS_OSSL_MODULES"
fi
NON_FIPS_OSSL_CONF="$CHECK_DIR/usr/local/cosmian/lib/ssl/openssl.cnf"
if [ -f "$NON_FIPS_OSSL_CONF" ]; then
ENV_OPENSSL_CONF="$NON_FIPS_OSSL_CONF"
fi
fi

# Use `env` to set variables for the run
CMD=("$BINARY_PATH" --version)
if [ "$IS_FIPS" = true ]; then
VERSION_OUTPUT=$(env OPENSSL_CONF="$ENV_OPENSSL_CONF" OPENSSL_MODULES="$ENV_OPENSSL_MODULES" "${CMD[@]}" 2>&1 || true)
if [ -n "$ENV_OPENSSL_CONF" ] || [ -n "$ENV_OPENSSL_MODULES" ]; then
ENV_ARGS=()
[ -n "$ENV_OPENSSL_CONF" ] && ENV_ARGS+=(OPENSSL_CONF="$ENV_OPENSSL_CONF")
[ -n "$ENV_OPENSSL_MODULES" ] && ENV_ARGS+=(OPENSSL_MODULES="$ENV_OPENSSL_MODULES")
VERSION_OUTPUT=$(env "${ENV_ARGS[@]}" "${CMD[@]}" 2>&1 || true)
else
VERSION_OUTPUT=$("${CMD[@]}" 2>&1 || true)
fi
Expand All @@ -189,8 +199,11 @@ info "\xe2\x9c\x93 Binary executed successfully"
# - FIPS dynamic builds bundle 3.1.2 runtime libs to match the FIPS provider
EXPECTED_VER="3.6.0"
info "Verifying OpenSSL runtime version (expected ${EXPECTED_VER})…"
if [ "$IS_FIPS" = true ]; then
INFO_CMD=(env OPENSSL_CONF="$ENV_OPENSSL_CONF" OPENSSL_MODULES="$ENV_OPENSSL_MODULES" "$BINARY_PATH" --info)
if [ -n "$ENV_OPENSSL_CONF" ] || [ -n "$ENV_OPENSSL_MODULES" ]; then
INFO_CMD=(env)
[ -n "$ENV_OPENSSL_CONF" ] && INFO_CMD+=(OPENSSL_CONF="$ENV_OPENSSL_CONF")
[ -n "$ENV_OPENSSL_MODULES" ] && INFO_CMD+=(OPENSSL_MODULES="$ENV_OPENSSL_MODULES")
INFO_CMD+=("$BINARY_PATH" --info)
else
INFO_CMD=("$BINARY_PATH" --info)
fi
Expand Down
8 changes: 4 additions & 4 deletions .github/scripts/test_hsm_utimaco.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ UTIMACO_LIB_DIR="$(dirname "$UTIMACO_PKCS11_LIB")"

# Utimaco integration test (KMS)

env -u LD_PRELOAD -u OPENSSL_CONF -u OPENSSL_MODULES \
env -u LD_PRELOAD \
PATH="$PATH" \
LD_LIBRARY_PATH="${UTIMACO_LIB_DIR}:${NIX_OPENSSL_OUT:+$NIX_OPENSSL_OUT/lib:}${LD_LIBRARY_PATH:-}" \
HSM_MODEL="utimaco" \
Expand All @@ -80,7 +80,7 @@ env -u LD_PRELOAD -u OPENSSL_CONF -u OPENSSL_MODULES \

# Utimaco loader test (pure Nix, scoped runtime)

env -u LD_PRELOAD -u OPENSSL_CONF -u OPENSSL_MODULES \
env -u LD_PRELOAD \
PATH="$PATH" \
LD_LIBRARY_PATH="${UTIMACO_LIB_DIR}:${NIX_OPENSSL_OUT:+$NIX_OPENSSL_OUT/lib:}${LD_LIBRARY_PATH:-}" \
HSM_MODEL="utimaco" \
Expand All @@ -98,7 +98,7 @@ env -u LD_PRELOAD -u OPENSSL_CONF -u OPENSSL_MODULES \
# Optionally run Google CSE CLI tests if environment is provided
if [ -n "${TEST_GOOGLE_OAUTH_CLIENT_ID:-}" ] && [ -n "${TEST_GOOGLE_OAUTH_CLIENT_SECRET:-}" ] && [ -n "${TEST_GOOGLE_OAUTH_REFRESH_TOKEN:-}" ]; then
# shellcheck disable=SC2086
env -u LD_PRELOAD -u OPENSSL_CONF -u OPENSSL_MODULES "PATH=$PATH" \
env -u LD_PRELOAD "PATH=$PATH" \
LD_LIBRARY_PATH="${UTIMACO_LIB_DIR}:${NIX_OPENSSL_OUT:+$NIX_OPENSSL_OUT/lib:}${LD_LIBRARY_PATH:-}" \
HSM_MODEL="utimaco" \
HSM_USER_PASSWORD="$HSM_USER_PASSWORD" \
Expand All @@ -114,7 +114,7 @@ if [ -n "${TEST_GOOGLE_OAUTH_CLIENT_ID:-}" ] && [ -n "${TEST_GOOGLE_OAUTH_CLIENT
-- --nocapture kmip_2_1_xml_pkcs11_m_1_21 --ignored

# shellcheck disable=SC2086
env -u LD_PRELOAD -u OPENSSL_CONF -u OPENSSL_MODULES "PATH=$PATH" \
env -u LD_PRELOAD "PATH=$PATH" \
LD_LIBRARY_PATH="${UTIMACO_LIB_DIR}:${NIX_OPENSSL_OUT:+$NIX_OPENSSL_OUT/lib:}${LD_LIBRARY_PATH:-}" \
HSM_MODEL="utimaco" \
HSM_USER_PASSWORD="$HSM_USER_PASSWORD" \
Expand Down
1 change: 0 additions & 1 deletion .github/scripts/test_otel_export.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail


SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
source "$SCRIPT_DIR/common.sh"

Expand Down
9 changes: 6 additions & 3 deletions .github/scripts/test_pykmip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ FEATURES_FLAG=(--features non-fips)
: "${COSMIAN_KMS_CONF:=$REPO_ROOT/scripts/kms.toml}"
export COSMIAN_KMS_CONF

# Ensure Python's ssl module can initialize: avoid custom OpenSSL config used by Rust OpenSSL.
# Do NOT clear LD_LIBRARY_PATH; keep Nix-provided runtime consistent to avoid GLIBC mismatches.
unset OPENSSL_CONF OPENSSL_MODULES || true
# Note: OPENSSL_CONF and OPENSSL_MODULES are intentionally kept set here so the KMS
# server process can find the OpenSSL providers (e.g. legacy.dylib) in the Nix store.
# The compiled-in MODULESDIR is /usr/local/cosmian/lib/ossl-modules (production path),
# which does not exist in the nix-shell dev environment.
# All Python invocations below already use `env -u OPENSSL_CONF -u OPENSSL_MODULES`
# to isolate Python's ssl module from the Rust/KMS OpenSSL configuration.

# Ensure Python is available (nix.sh sets WITH_PYTHON=1 which adds python311 + virtualenv)
require_cmd python3 "Python 3 is required. Re-run via 'bash .github/scripts/nix.sh test pykmip' so nix-shell can provide it."
Expand Down
Loading
Loading