Commit Graph

11 Commits (836f65a81872bd97bedbb51488b482fca0d607ed)

Author SHA1 Message Date
Mark Atwood 9a226cd41d fix(cra-kit): clean shellcheck warnings in sbom scripts
generate-wolfssh: add missing _cra_auto_tempfiles init (SC2154). generate-wolfhsm: make CRA_SBOM_BUILD_DIR self-referential so shellcheck sees the sourced-helper use (SC2034). Rewrite pipefail probe as if-then; annotate the sourced-helper (SC1091) and intentional cd-fallback (SC2015) lines. shellcheck cra-kit/scripts/*.sh now exits 0.
2026-07-06 19:04:30 -07:00
Mark Atwood 5f909c6713 refactor: extract shared source-extraction lib _cra-sbom-extract.sh 2026-06-22 19:16:12 -07:00
Mark Atwood c77b4a5ac7 fix(cra-kit): fix two auto-extract bugs found in testing
Makefile: add --no-print-directory to suppress make's Entering/Leaving
directory banners, which leaked into the source list when the Makefile
directory path contained "wolfssl".

Keil CMSIS Pack: when the wolfSSL pack .pdsc is not installed locally
(~/.arm/Packs/wolfSSL/), fall back to enumerating wolfcrypt/src/*.c
and src/*.c from WOLFSSL_DIR. The full library is what the pack ships.
2026-06-22 16:12:03 -07:00
Mark Atwood 4104e2712c feat(cra-kit): auto-extract wolfssl srcs in embedded mode
Adds _auto_extract_srcs() to generate-wolfssl-sbom.sh. When
CRA_SBOM_SRCS_FILE is not set, the embedded path now tries four
methods in order:

1. compile_commands.json (CMake/Zephyr/ESP-IDF) via jq — triggered
   when WOLFSSL_BUILD_DIR is set; detects ESP-IDF managed_components
   layout automatically.
2. Makefile via CRA_SBOM_MAKEFILE_DIR — tries print-wolfssl-srcs
   target first, falls back to make -n grep.
3. Keil .uvprojx via CRA_SBOM_KEIL_PROJECT — handles both CMSIS
   Pack RTE and explicit FilePath layouts.
4. IAR .ewp via CRA_SBOM_IAR_PROJECT — resolves $PROJ_DIR$,
   skips excluded entries.

All methods set CRA_SBOM_SRCS_ONLY_FROM_FILE=true automatically so
the demo watermark is suppressed. Temp files are collected into a
single global trap. SRCS-FILE-HOWTO.md gains an Automatic extraction
subsection for each build system.
2026-06-22 15:59:38 -07:00
Mark Atwood ef5164926d fix: grep CMakeCache.txt for version; cmake -L omits :STATIC (SBOM-1j1)
cmake -L and -LA both exclude :STATIC (internal) cache entries, so
CMAKE_PROJECT_VERSION:STATIC was never matched and the version mismatch
check was dead code. Grep CMakeCache.txt directly instead.
2026-06-22 14:40:28 -07:00
Mark Atwood 4d5a033edf fix: omit --srcs when SRCS_ONLY_FROM_FILE=true (SBOM-t9t)
When CRA_SBOM_SRCS_ONLY_FROM_FILE=true no demo srcs are added to $@,
so passing --srcs "$@" fed --cdx-out as the first --srcs argument,
causing argparse to error. Capture _srcs_flag before output flags are
appended; emit it only when positional srcs are present.
2026-06-22 14:28:12 -07:00
Mark Atwood ac78b1c555 feat(cra-kit): add cmake mode and embedded srcs-file/no-hash options
Add CRA_SBOM_MODE=cmake with WOLFSSL_BUILD_DIR for out-of-source builds.
Add CRA_SBOM_SRCS_FILE and CRA_SBOM_NO_HASH for embedded path.
Update auto-detection order: cmake (WOLFSSL_BUILD_DIR) > autotools > embedded.
2026-06-22 12:50:02 -07:00
Sameeh Jubran 924c3d228b cra-kit: fix commercial-license SBOM generation and refresh samples
Plumb CRA_LICENSE_TEXT through generate-wolfssl-sbom.sh (gen-sbom/make
sbom hard-fail on a LicenseRef-* override without it); scope the
commercial relicense to the wolfssl package only; correct the stale
pkg:generic PURL claim; validate the embedded output dir; regenerate
pinned samples against gen-sbom 1.1 and re-pin product checksums.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-06-22 13:40:11 +03:00
Sameeh Jubran 8cb188f127 cra-kit: address Atwood review (shell safety, validation, samples)
Quote "$@" in gen-sbom --srcs (drop SC2068 disables), pass JSON paths to
python via env var in validate.sh to prevent filename injection, and fail
non-zero instead of warning when SBOM post-processing breaks. Rename the
user_settings.h guard to CRA_KIT_USER_SETTINGS_H, clarify the serialNumber
regex accepts v4 (product) and v5 (component) UUIDs, untrack the gitignored
embedded sample SBOMs, document the SHA-512 CBOM omission, and note sample
timestamp differences in SAMPLE-PROVENANCE.md.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-06-17 17:27:15 +03:00
Sameeh Jubran 04f19f8b2e cra-kit: address Skoll review findings
Fail early when the wolfSSL tree version differs from the kit's pinned
VERSION instead of a cryptic cp error, trap-clean the embedded temp
defines file on all exit paths, add sh -n + shellcheck CI coverage for
the scripts, and use the standard file:./ relative form in the product
SBOM external references.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-06-15 15:21:49 +03:00
Sameeh Jubran c0032194f9 Add CRA Kit for customer SBOM integration
Self-contained cra-kit/ with glossary,
fictional auditor packet, autotools/embedded SBOM scripts, and CI validation.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-06-04 04:54:45 +03:00