Skip to content

Commit c305623

Browse files
committed
chore: Merge branch 'release/1.5.0'
2 parents 3aa7921 + e342035 commit c305623

File tree

119 files changed

+3721
-819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+3721
-819
lines changed

.cargo/audit.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
# List of advisory IDs to ignore (extracted from deny.toml)
66
ignore = [
77
"RUSTSEC-2023-0071", # rsa
8-
"RUSTSEC-2024-0436", # unmaintained paste
8+
"RUSTSEC-2025-0052", # async-std has been discontinued
9+
"RUSTSEC-2024-0436" # unmaintained paste crate
910
]

.cargo/config.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# On Windows, the linker may exceed its number of allowed symbols
2-
# This is likely going to require nightly
3-
# see https://github.com/rust-lang/rust/issues/53014#issuecomment-646149774
4-
[target.aarch64-pc-windows-msvc]
5-
rustflags = "-Zshare-generics=off"
1+
# Use rust-lld (LLVM's lld-link) instead of MSVC link.exe to avoid
2+
# LNK1189: library limit of 65535 objects exceeded on large workspaces.
63
[target.x86_64-pc-windows-msvc]
7-
rustflags = "-Zshare-generics=off"
4+
linker = "rust-lld.exe"
5+
6+
[target.aarch64-pc-windows-msvc]
7+
linker = "rust-lld.exe"

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
crate/pkcs11/oracle
1+
.github/scripts/oracle

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ rustup component add clippy rustfmt
256256
### Configuration Files
257257

258258
- Cargo workspace: `Cargo.toml`
259-
- Rust toolchain: `rust-toolchain.toml` (nightly-2025-03-31)
259+
- Rust toolchain: `rust-toolchain.toml` (1.90.0)
260260
- Formatting config: `.rustfmt.toml`
261261
- Docker services: `docker-compose.yml`
262262

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
version: 2
3+
4+
updates:
5+
- package-ecosystem: github-actions
6+
directory: /
7+
schedule:
8+
interval: daily

.github/scripts/build_packages.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
set -exo pipefail
4+
5+
if [ -z "$TARGET" ]; then
6+
echo "Error: TARGET is not set. Examples of TARGET are x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin."
7+
exit 1
8+
fi
9+
10+
if [ -z "$OPENSSL_DIR" ]; then
11+
echo "Error: OPENSSL_DIR is not set. Example OPENSSL_DIR=/usr/local/openssl"
12+
exit 1
13+
fi
14+
15+
ROOT_FOLDER=$(pwd)
16+
17+
if [ "$DEBUG_OR_RELEASE" = "release" ]; then
18+
# First build the Debian and RPM packages. It must come at first since
19+
# after this step `cosmian` is built with custom features flags (non-fips for example).
20+
rm -rf target/"$TARGET"/debian
21+
rm -rf target/"$TARGET"/generate-rpm
22+
cargo build --features non-fips --release --target "$TARGET"
23+
if [ -f /etc/redhat-release ]; then
24+
cargo install --version 0.16.0 cargo-generate-rpm --force
25+
cd "$ROOT_FOLDER"
26+
cargo generate-rpm --target "$TARGET" -p crate/cli
27+
elif [ -f /etc/debian_version ]; then
28+
cargo install --version 2.4.0 cargo-deb --force
29+
cargo deb --target "$TARGET" -p cosmian_cli
30+
fi
31+
fi

.github/scripts/cargo_build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ function BuildProject {
2020
$env:FINDEX_TEST_DB = "sqlite-findex"
2121
if ($BuildType -eq "release")
2222
{
23-
cargo build --features "non-fips" -p cosmian_cli -p cosmian_pkcs11 --release --target x86_64-pc-windows-msvc
24-
cargo test --features "non-fips" -p cosmian_cli --release --target x86_64-pc-windows-msvc -- --nocapture --skip sql --skip redis --skip google_cse --skip hsm --skip kms
23+
cargo build --features "non-fips" -p cosmian_cli -p cosmian_pkcs11 --target x86_64-pc-windows-msvc --release
24+
cargo test --features "non-fips" -p cosmian_cli -p cosmian_pkcs11 --target x86_64-pc-windows-msvc --release -- --skip auth
2525
}
2626
else
2727
{
2828
cargo build --features "non-fips" -p cosmian_cli -p cosmian_pkcs11 --target x86_64-pc-windows-msvc
29-
cargo test --features "non-fips" -p cosmian_cli --target x86_64-pc-windows-msvc -- --nocapture --skip sql --skip redis --skip google_cse --skip hsm --skip kms
29+
cargo test --features "non-fips" -p cosmian_cli -p cosmian_pkcs11 --target x86_64-pc-windows-msvc -- --skip auth
3030
}
3131

3232
# Check binaries

.github/scripts/cargo_build.sh

100644100755
Lines changed: 29 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,55 @@
11
#!/bin/bash
22

3-
set -ex
3+
set -exo pipefail
44

5-
# --- Declare the following variables for tests
6-
# export TARGET=x86_64-unknown-linux-gnu
7-
# export TARGET=aarch64-apple-darwin
8-
# export DEBUG_OR_RELEASE=debug
9-
# export OPENSSL_DIR=/usr/local/openssl
10-
# export SKIP_SERVICES_TESTS="--skip hsm"
11-
12-
ROOT_FOLDER=$(pwd)
13-
14-
if [ "$DEBUG_OR_RELEASE" = "release" ]; then
15-
# First build the Debian and RPM packages. It must come at first since
16-
rm -rf target/"$TARGET"/debian
17-
rm -rf target/"$TARGET"/generate-rpm
18-
19-
if [ -f /etc/redhat-release ]; then
20-
cargo build --features non-fips --target "$TARGET" --release
21-
cargo install --version 0.16.0 cargo-generate-rpm --force
22-
cargo generate-rpm --target "$TARGET" -p crate/cli
23-
elif [ -f /etc/debian_version ]; then
24-
cargo install --version 2.4.0 cargo-deb --force
25-
cargo deb --target "$TARGET" -p cosmian_cli
26-
fi
27-
fi
5+
# export FEATURES="non-fips"
286

297
if [ -z "$TARGET" ]; then
30-
echo "Error: TARGET is not set."
8+
echo "Error: TARGET is not set. Examples of TARGET are x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin."
319
exit 1
3210
fi
3311

3412
if [ "$DEBUG_OR_RELEASE" = "release" ]; then
3513
RELEASE="--release"
3614
fi
3715

38-
if [ -z "$SKIP_SERVICES_TESTS" ]; then
39-
echo "Info: SKIP_SERVICES_TESTS is not set."
40-
unset SKIP_SERVICES_TESTS
16+
if [ -n "$FEATURES" ]; then
17+
FEATURES="--features $FEATURES"
4118
fi
4219

43-
rustup target add "$TARGET"
44-
45-
if [ -f /etc/lsb-release ]; then
46-
bash .github/reusable_scripts/test_utimaco.sh
20+
if [ -z "$FEATURES" ]; then
21+
echo "Info: FEATURES is not set."
22+
unset FEATURES
4723
fi
4824

49-
cd "$ROOT_FOLDER"
50-
5125
if [ -z "$OPENSSL_DIR" ]; then
52-
echo "Error: OPENSSL_DIR is not set."
26+
echo "Error: OPENSSL_DIR is not set. Example OPENSSL_DIR=/usr/local/openssl"
5327
exit 1
5428
fi
5529

30+
rustup target add "$TARGET"
31+
5632
# shellcheck disable=SC2086
57-
cargo build --target $TARGET $RELEASE \
58-
--features non-fips \
59-
-p cosmian_cli \
60-
-p cosmian_pkcs11
33+
cargo build -p cosmian_cli -p cosmian_pkcs11 --target $TARGET $RELEASE $FEATURES
34+
35+
COSMIAN_CLI_EXE="target/$TARGET/$DEBUG_OR_RELEASE/cosmian"
6136

62-
TARGET_FOLDER=./target/"$TARGET/$DEBUG_OR_RELEASE"
63-
"${TARGET_FOLDER}"/cosmian -h
37+
# Test binary functionality
38+
."/$COSMIAN_CLI_EXE" --help
6439

40+
# Check for dynamic OpenSSL linkage
6541
if [ "$(uname)" = "Linux" ]; then
66-
ldd "${TARGET_FOLDER}"/cosmian | grep ssl && exit 1
42+
LDD_OUTPUT=$(ldd "$COSMIAN_CLI_EXE")
43+
echo "$LDD_OUTPUT"
44+
if echo "$LDD_OUTPUT" | grep -qi ssl; then
45+
echo "Error: Dynamic OpenSSL linkage detected on Linux (ldd | grep ssl)."
46+
exit 1
47+
fi
6748
else
68-
otool -L "${TARGET_FOLDER}"/cosmian | grep openssl && exit 1
49+
OTOOL_OUTPUT=$(otool -L "$COSMIAN_CLI_EXE")
50+
echo "$OTOOL_OUTPUT"
51+
if echo "$OTOOL_OUTPUT" | grep -qi ssl; then
52+
echo "Error: Dynamic OpenSSL linkage detected on macOS (otool -L | grep openssl)."
53+
exit 1
54+
fi
6955
fi
70-
71-
find . -type d -name cosmian-findex-server -exec rm -rf \{\} \; -print || true
72-
rm -f /tmp/*.json /tmp/*.toml
73-
74-
export RUST_LOG="fatal,cosmian_cli=error,cosmian_findex_client=debug,cosmian_kms_client=debug"
75-
76-
# shellcheck disable=SC2086
77-
cargo test --target $TARGET $RELEASE \
78-
--features non-fips \
79-
-p cosmian_cli \
80-
-p cosmian_pkcs11 \
81-
-- --nocapture $SKIP_SERVICES_TESTS

.github/scripts/cargo_test.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
set -exo pipefail
4+
5+
# export FEATURES="non-fips"
6+
7+
if [ -z "$TARGET" ]; then
8+
echo "Error: TARGET is not set. Examples of TARGET are x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin."
9+
exit 1
10+
fi
11+
12+
if [ "$DEBUG_OR_RELEASE" = "release" ]; then
13+
RELEASE="--release"
14+
fi
15+
16+
if [ -n "$FEATURES" ]; then
17+
FEATURES="--features $FEATURES"
18+
fi
19+
20+
if [ -z "$FEATURES" ]; then
21+
echo "Info: FEATURES is not set."
22+
unset FEATURES
23+
fi
24+
25+
if [ -z "$OPENSSL_DIR" ]; then
26+
echo "Error: OPENSSL_DIR is not set. Example OPENSSL_DIR=/usr/local/openssl"
27+
exit 1
28+
fi
29+
30+
export RUST_LOG="cosmian_cli=error,cosmian_findex_client=debug,cosmian_kms_client=debug"
31+
32+
# shellcheck disable=SC2086
33+
cargo test --workspace --bins --target $TARGET $RELEASE $FEATURES
34+
35+
# shellcheck disable=SC2086
36+
# cargo bench --target $TARGET $FEATURES --no-run
37+
38+
export RUST_LOG="fatal,cosmian_cli=error,cosmian_findex_client=debug,cosmian_kms_client=debug"
39+
40+
# shellcheck disable=SC2086
41+
cargo test --target $TARGET $RELEASE \
42+
--features non-fips \
43+
-p cosmian_cli \
44+
-p cosmian_pkcs11 \
45+
-- --nocapture
46+
47+
if [ -f /etc/lsb-release ]; then
48+
# Install Utimaco simulator and run tests
49+
bash .github/reusable_scripts/test_utimaco.sh
50+
51+
# Test HSM package directly
52+
# shellcheck disable=SC2086
53+
cargo test -p cosmian_cli --target "$TARGET" $RELEASE -- test_all_hsm_cli --ignored
54+
fi

.github/scripts/cosmian_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -ex
66
docker compose up -d
77
sleep 5
88

9-
export COSMIAN_CLI_FORMAT=json
9+
export COSMIAN_KMS_CLI_FORMAT=json
1010
COSMIAN="cargo run --bin cosmian -- -c test_data/configs/cosmian_for_bash.toml"
1111

1212
# Create the seed key

0 commit comments

Comments
 (0)