Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4bdbf9e
chore: take last KMS scripts version
Manuthor May 14, 2025
de70a04
fix: move script to root dir
Manuthor May 19, 2025
05b5aad
fix: move script to root dir
Manuthor May 19, 2025
bf1e5b9
test: fix generic loop script
Manuthor Jun 11, 2025
6b1ebeb
add condition in openssl script
p0wline Jul 31, 2025
e0b6280
Revert "add condition in openssl script"
p0wline Jul 31, 2025
35119aa
remove ui from os name list
p0wline Jul 31, 2025
d84bcc9
remove ui from os name list
p0wline Jul 31, 2025
9022b05
remove ui from os name list
p0wline Jul 31, 2025
50c11b1
remove ui from os name list
p0wline Jul 31, 2025
6472ace
Merge branch 'main' into develop
p0wline Jul 31, 2025
a131eb0
add brackets
p0wline Jul 31, 2025
0bd1fbf
build: openssl 3.1.2
Manuthor Oct 17, 2025
8231094
feat: adapt to macos build
Manuthor Oct 18, 2025
7d44227
fix: use curl instead of wget
Manuthor Oct 29, 2025
8aad8be
fix: use python to fetch utimaco tarball
Manuthor Oct 29, 2025
6072d81
ci: install wget on nix
Manuthor Oct 29, 2025
e991bde
fix: wget must be already installed
Manuthor Oct 29, 2025
083a406
fix: no sudo in test_utimaco.sh script
Manuthor Oct 29, 2025
0b78a6c
feat: add proteccio prepare env script
Manuthor Nov 5, 2025
f67b57f
chore: rename utimaco tarball
Manuthor Nov 5, 2025
48f35f4
chore: backup scripts
Manuthor Nov 5, 2025
077ccc0
fix: HSM scripts
Manuthor Nov 5, 2025
55082fd
chore: backup hsm-proteccio.tar.gz
Manuthor Nov 5, 2025
f8cfdf1
fix: proteccio tree creation
Manuthor Nov 6, 2025
3a192d6
fix: clean OpenSSL env on nethsmstatus exec
Manuthor Jan 14, 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
13 changes: 0 additions & 13 deletions .github/scripts/cargo_deny.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/scripts/loop.sh

This file was deleted.

34 changes: 0 additions & 34 deletions .github/scripts/test_utimaco.sh

This file was deleted.

18 changes: 18 additions & 0 deletions check_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

# Install cargo deny if not already installed
# cargo install --version 0.18.2 cargo-deny --locked

find . -name "Cargo.toml" -not -path "./Cargo.toml" -exec dirname {} \; | while read -r dir; do
echo "Running cargo build in $dir"
pushd "$dir"
cargo build
cargo test -- --nocapture
cargo clippy --all-targets -- -D warnings
cargo deny check advisories
popd
done

cargo hack build --all --feature-powerset
6 changes: 6 additions & 0 deletions find_empty_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -ex

# Find all regular files that are empty (size 0)
find . -not -path "./*.cargo_check/**" -not -path "./**target/**" -not -path "./*env/lib/*" -not -path "./*node_modules/**" -not -path "./.git/**" -type f -empty -print
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#!/bin/bash
set -ex

if [ "$1" = "Cosmian/kms" || "$1" = "Cosmian/cli"]; then
export OPENSSL_DIR=/usr/local/openssl
fi

env

if [ -z "$OPENSSL_DIR" ]; then
echo "Error: OPENSSL_DIR is not set."
exit 1
fi

if [ -z "$OS_NAME" ]; then
if [[ -z "$OS_NAME" || "$OS_NAME" == "ui" ]]; then
OS_NAME=ubuntu_22_04
else
OS_NAME=${OS_NAME#fips_}
Expand All @@ -37,5 +33,5 @@ mv "${OPENSSL_VERSION}.tar.gz" "${OPENSSL_DIR}"
echo -n Extracting compressed archive...
cd "${OPENSSL_DIR}"
tar -xf "$OPENSSL_VERSION.tar.gz"
find .
chmod u+x lib*/ossl-modules/*
rm "$OPENSSL_VERSION.tar.gz"
Binary file added hsm-proteccio.tar.gz
Binary file not shown.
Binary file added hsm-utimaco-simulator.tar.xz
Binary file not shown.
17 changes: 17 additions & 0 deletions prepare_proteccio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -ex

wget -q https://package.cosmian.com/ci/hsm-proteccio.tar.gz
tar -xzf hsm-proteccio.tar.gz
rm hsm-proteccio.tar.gz

sudo mkdir -p /etc/proteccio/
sudo cp proteccio/etc/proteccio/* /etc/proteccio/
sudo cp proteccio/lib/* /lib/
sudo cp proteccio/usr/local/bin/* /usr/local/bin/

rm -rf proteccio

# Check HSM connectivity (non-fatal - tests will fail later if HSM is unreachable)
# Temporarily clear Nix OpenSSL environment to use system libraries for Proteccio
env -u LD_PRELOAD -u LD_LIBRARY_PATH -u OPENSSL_CONF -u OPENSSL_MODULES /usr/local/bin/nethsmstatus
37 changes: 37 additions & 0 deletions prepare_utimaco.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -ex

# Fallback to wget if nix is not available (CI environments)
wget -q https://package.cosmian.com/ci/hsm-utimaco-simulator.tar.xz

killall -9 bl_sim5 || true
echo -n Extracting compressed archive...
tar -xf hsm-utimaco-simulator.tar.xz
rm hsm-utimaco-simulator.tar.xz
./hsm-simulator/sim5_linux/bin/bl_sim5 -h -o -d ./hsm-simulator/sim5_linux/devices &

sleep 5

# Place PKCS#11 library and config in a user-writable, persistent location
UTIMACO_ETC="$PWD/.utimaco"
mkdir -p "$UTIMACO_ETC"
cp ./hsm-simulator/libcs_pkcs11_R3.so "$UTIMACO_ETC/libcs_pkcs11_R3.so"
export UTIMACO_PKCS11_LIB="$UTIMACO_ETC/libcs_pkcs11_R3.so"
cp ./hsm-simulator/cs_pkcs11_R3.cfg "$UTIMACO_ETC/"
chmod 644 "$UTIMACO_ETC/cs_pkcs11_R3.cfg"
printf "[Global]\nLogpath = /tmp\nLogging = 3\n[CryptoServer]\nDevice = 3001@localhost\n" >"$UTIMACO_ETC/cs_pkcs11_R3.cfg"
export CS_PKCS11_R3_CFG="$UTIMACO_ETC/cs_pkcs11_R3.cfg"

cd ./hsm-simulator/Administration
# set the SO PIN to 11223344
./p11tool2 Slot=0 login=ADMIN,./key/ADMIN_SIM.key InitToken=11223344
# Change the SO PIN to 12345678
./p11tool2 Slot=0 LoginSO=11223344 SetPin=11223344,12345678
# Set the User PIN to 11223344
./p11tool2 Slot=0 LoginSO=12345678 InitPin=11223344
# Change the User PIN to 12345678
./p11tool2 Slot=0 LoginUser=11223344 SetPin=11223344,12345678
./p11tool2 Slot=0 GetSlotInfo
cd ../..

rm -rf hsm-simulator