From 404997fdf6289dcfd2c56a2f5a9ad50708c45226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Frauenschl=C3=A4ger?= Date: Fri, 13 Nov 2026 09:28:30 +0100 Subject: [PATCH] Ship the certs, test sources and examples in make dist EXTRA_DIST left out examples/certs, tests/test_static_mem.h, tests/CMakeLists.txt and the examples. From a release tarball, ./configure --enable-tests failed to compile (most unit tests include ../test_static_mem.h), CMake with tests or examples on stopped at the missing subdirectory, and the Zephyr EST sample and test, the host server for the Zephyr test and the README CLI demo lacked the credentials they load from examples/certs. List each tracked file rather than the directories, so a stray local file never ships, and have make distcheck configure with --enable-tests so a test file missing from EXTRA_DIST fails it. The autoconf PR job now runs make distcheck, which keeps that check from going stale. The certs are throwaway test credentials, so the AGENTS.md row now says never deploy them rather than never ship them. The autoconf build now builds the examples too: --enable-examples was accepted but built nothing. They are noinst programs gated on EST and SCEP as in examples/CMakeLists.txt, automake ships their sources, and make distcheck also configures with --enable-examples, so the PR job compiles them from the tarball. No CI job built them before; the cmake-full-werror job now does too, so a warning in an example fails it. .gitignore covers the binaries of an in-tree autoconf build. Fixes F-16526. --- .github/workflows/pr.yml | 15 ++++++++++++++- .gitignore | 5 +++++ AGENTS.md | 2 +- Makefile.am | 37 +++++++++++++++++++++++++++++++++++++ docs/CI.md | 2 +- 5 files changed, 58 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0212ae8d..bad7b017 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,7 +34,7 @@ jobs: os: ubuntu-latest build: cmake wolfssl: full - cmake_extra: -DWOLFCERT_WERROR=ON + cmake_extra: -DWOLFCERT_WERROR=ON -DWOLFCERT_ENABLE_EXAMPLES=ON - name: cmake-full-opensslextra os: ubuntu-latest build: cmake @@ -208,6 +208,19 @@ jobs: exit 1 fi + - name: Release tarball (make distcheck) + if: matrix.build == 'autoconf' + shell: bash + run: | + set -euo pipefail + trap '' PIPE + if ! make distcheck \ + DISTCHECK_CONFIGURE_FLAGS="--with-wolfssl=$WOLFSSL_PREFIX"; then + find wolfcert-* -name '*.log' \ + -exec sh -c 'echo "== $1 =="; cat "$1"' _ {} \; 2>/dev/null + exit 1 + fi + header-only: name: user_settings header-only build runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index e740ab8d..0d27c88e 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,11 @@ cmake/wolfCertTargets.cmake /wolfcert-client /wolfcert-server +# Example binaries from an in-tree autoconf build +/examples/enroll_est +/examples/enroll_cryptocb +/examples/enroll_scep + # make sbom in the source tree /wolfcert-*.cdx.json /wolfcert-*.spdx.json diff --git a/AGENTS.md b/AGENTS.md index db1f6222..d8620a84 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -191,7 +191,7 @@ wolfcert_cleanup(); | `wolfcert/errors.h`, `wolfcert/status.h`, `wolfcert/log.h` | Error codes, last-error detail, log callback | | `wolfcert/memory.h` | Default heap hint, allocation macros | | `examples/` | `enroll_est.c`, `enroll_scep.c`, `enroll_cryptocb.c`, `user_settings.h.example` | -| `examples/certs/` | Test credentials; never ship them | +| `examples/certs/` | Test credentials; never deploy them | | `zephyr/samples/wolfcert_est_client/` | EST client on Zephyr (qemu_x86, FRDM-MCXN947) | | `src/` | Implementation; `src/internal.h` is not for applications | diff --git a/Makefile.am b/Makefile.am index 5b5ae968..26a48672 100644 --- a/Makefile.am +++ b/Makefile.am @@ -104,6 +104,23 @@ WOLFCERT_TEST_SERVER = $(abs_builddir)/wolfcert-server endif endif +noinst_PROGRAMS = + +if WOLFCERT_BUILD_EXAMPLES +if WOLFCERT_HAVE_EST +noinst_PROGRAMS += examples/enroll_est examples/enroll_cryptocb +endif +if WOLFCERT_HAVE_SCEP +noinst_PROGRAMS += examples/enroll_scep +endif +endif +examples_enroll_est_SOURCES = examples/enroll_est.c +examples_enroll_est_LDADD = libwolfcert.la $(WOLFSSL_LIBS) +examples_enroll_cryptocb_SOURCES = examples/enroll_cryptocb.c +examples_enroll_cryptocb_LDADD = libwolfcert.la $(WOLFSSL_LIBS) +examples_enroll_scep_SOURCES = examples/enroll_scep.c +examples_enroll_scep_LDADD = libwolfcert.la $(WOLFSSL_LIBS) + if WOLFCERT_BUILD_TESTS check_PROGRAMS = \ test_smoke test_keygen test_csr test_store test_http test_transport \ @@ -245,15 +262,35 @@ EXTRA_DIST = \ CMakeLists.txt \ wolfcert/options.h.in \ examples/user_settings.h.example \ + examples/CMakeLists.txt \ + examples/certs/README.md \ + examples/certs/gen-certs.sh \ + examples/certs/gen-server-cert.sh \ + examples/certs/ecc/ca-cert.pem \ + examples/certs/ecc/ca-key.pem \ + examples/certs/ecc/client-cert.pem \ + examples/certs/ecc/client-key.pem \ + examples/certs/ecc/server-cert.pem \ + examples/certs/ecc/server-key.pem \ + examples/certs/mldsa/ca-cert.pem \ + examples/certs/mldsa/ca-key.pem \ + examples/certs/mldsa/client-cert.pem \ + examples/certs/mldsa/client-key.pem \ + examples/certs/mldsa/server-cert.pem \ + examples/certs/mldsa/server-key.pem \ cmake/wolfCertConfig.cmake.in \ cmake/Config.cmake.in \ cmake/wolfCertConfigVersion.cmake.in \ cmake/wolfCertTargets.cmake.in \ cmake/wolfcert.pc.in \ + tests/CMakeLists.txt \ + tests/test_static_mem.h \ tests/integration/tls_test_util.h \ tests/integration/est_client_cases.h \ tests/integration/cli_proto_scoping.sh +AM_DISTCHECK_CONFIGURE_FLAGS = --enable-tests --enable-examples + # Zephyr module port include zephyr/include.am diff --git a/docs/CI.md b/docs/CI.md index 4fe270ba..f28026d4 100644 --- a/docs/CI.md +++ b/docs/CI.md @@ -11,7 +11,7 @@ set skips the wolfSSL build entirely. | Workflow | Trigger | What it does | |----------|---------|--------------| -| `pr.yml` | PR + push | Merge gate: CMake (`-Werror`) + autoconf + ASan/UBSan on the canonical config, the same config against the minimum wolfSSL release (`cmake-full-floor`), plus per-PR feature/config gating — EST-only, SCEP-only, server-off, the key-alg variants (NO_RSA, ECC-only, RSA-only, no-3DES), TLS 1.3-only, the three ML-DSA per-level builds, the static-memory and no-malloc constrained builds, the platform-pieces-off build (`cmake-no-builtin-transport`), the freestanding ARM compile and config-resolution check (`no-posix-arm`), the header-only (`WOLFCERT_USER_SETTINGS`) build, a macOS build, and the two cheapest configure-must-fail assertions. | +| `pr.yml` | PR + push | Merge gate: CMake (`-Werror`, examples on) + autoconf (with a `make distcheck` of the release tarball) + ASan/UBSan on the canonical config, the same config against the minimum wolfSSL release (`cmake-full-floor`), plus per-PR feature/config gating — EST-only, SCEP-only, server-off, the key-alg variants (NO_RSA, ECC-only, RSA-only, no-3DES), TLS 1.3-only, the three ML-DSA per-level builds, the static-memory and no-malloc constrained builds, the platform-pieces-off build (`cmake-no-builtin-transport`), the freestanding ARM compile and config-resolution check (`no-posix-arm`), the header-only (`WOLFCERT_USER_SETTINGS`) build, a macOS build, and the two cheapest configure-must-fail assertions. | | `lint.yml` | PR + push | GPL license-header check and CMake↔autoconf parity of both the library and test source lists, plus the Zephyr module's library list and the version in `configure.ac`, `CMakeLists.txt` and `wolfcert/version.h` (`scripts/ci/check-buildsystem-parity.sh`). No wolfSSL build, so it fails in seconds. | | `sbom.yml` | PR + push | Generates the SBOM with `make sbom` and `cmake --build --target sbom` against the `full` wolfSSL config, from `options.h` and from `examples/user_settings.h.example`, checks each with `tools/sbom/validate_sbom.py`, `pyspdxtools` and `scripts/ci/check-sbom.py` (identity, license, hash source, that the library hash matches a real `make install` / `cmake --install`, the `options.h` feature set, the wolfSSL dependency version, no host paths), checks that a second run is byte-identical and that both build systems and both configuration modes record the same configuration, and checks `tools/sbom/` against its pinned wolfssl-compliance-tooling commit. See [`SBOM.md`](SBOM.md). | | `nightly.yml` | schedule + dispatch | Re-runs the wolfSSL-variant build matrix against fresh wolfSSL `master`, the macOS extras, and the full negative-config set. Also **reseeds the wolfSSL prefix caches** so the next day's PRs restore instead of build. The feature/config gating itself now runs per-PR (see `pr.yml`). |