tests: make 'make check' pass on the source-only (WITH_SDK=0) build
Some checks failed
CI / packaging-syntax (push) Has been cancelled
CI / build-and-test (clang) (push) Has been cancelled
CI / build-and-test (gcc) (push) Has been cancelled
CI / strict-warnings (clang, -Wall -Wextra -Wpedantic -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnull-dereference -O2 -std=c11 -Werror) (push) Has been cancelled
CI / strict-warnings (gcc, -Wall -Wextra -Wpedantic -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnull-dereference -Wformat-security -Wlogical-op -Wjump-misses-init -Wdouble-promotion -O2 -std=c11 -Werror) (push) Has been cancelled
CI / sanitizers (push) Has been cancelled
CI / pie-hardening (push) Has been cancelled
CI / cross-aarch64 (push) Has been cancelled
CI / dist-reproducibility (push) Has been cancelled
CI / release (push) Has been cancelled

The SDK-mode regression tests (audit, F-08/F-10/F-11/F-12, pq-box, KDF
transparency) now skip cleanly when built without libzuptsdk, and the
constant-time test links libzuptsdk only when present (its primitives are
native). Also drop a dead 'seqs_decoded' variable in vv_ans.c that failed
the exact-size test's -Werror=unused-but-set-variable. 'make check' is
green source-only, so the openSUSE %check no longer blocks the build.
This commit is contained in:
Cristian Cezar Moisés 2026-07-08 16:15:04 -03:00
commit 31fa4028aa
9 changed files with 64 additions and 3 deletions

View file

@ -24,12 +24,19 @@ else
fi
TMP=$(mktemp -d)
# This test uses only native CT primitives (zupt_ct_memeq, ML-KEM CT compare);
# the libzuptsdk linkage is vestigial. Link it only when the vendored library
# is present (WITH_SDK builds); source-only builds compile+run without it.
SDK_LINK=""
if ls "$SDK_DIR"/libzuptsdk.so* >/dev/null 2>&1; then
SDK_LINK="-L$SDK_DIR -lzuptsdk -Wl,-rpath,$(cd "$SDK_DIR" && pwd)"
fi
if gcc -Iinclude -Isrc -I"$SDK_DIR/include" -Wall -Wextra -Werror $SHANI -O2 -std=c11 \
tests/test_ct_timing.c \
src/zupt_crypto.c src/zupt_sha256.c src/zupt_sha256_shani.c src/zupt_aes256.c \
src/zupt_xxh.c src/zupt_keccak.c src/zupt_x25519.c src/zupt_mlkem.c \
src/zupt_cpuid.c src/zupt_mlock.c \
-L"$SDK_DIR" -lzuptsdk -Wl,-rpath,"$(cd "$SDK_DIR" && pwd)" -lm \
$SDK_LINK -lm \
-o "$TMP/t" 2>"$TMP/cc.log"; then
"$TMP/t"; rc=$?
else