Skip to content

sbom: vendor wolfssl-compliance-tooling for make and CMake - #11701

Open
sameehj wants to merge 8 commits into
wolfSSL:masterfrom
sameehj:feat/sbom-compliance-tooling
Open

sameehj wants to merge 8 commits into
wolfSSL:masterfrom
sameehj:feat/sbom-compliance-tooling

Conversation

@sameehj

@sameehj sameehj commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Vendor the pinned wolfssl-compliance-tooling snapshot at tools/sbom/. scripts/gen-sbom forwards to tools/sbom/gen-sbom. scripts/sbom.am includes tools/sbom/sbom.am.
  • make sbom and the CMake sbom target use that snapshot. make bomsh still passes SBOM_LIB_OVERRIDE so the traced library is the hashed file. make advisory is unchanged.
  • The Linux SBOM job accepts pkg:github/wolfssl/wolfssl@v<version>-stable. .gitignore no longer drops tools/sbom/build/.
  • The pin is 27f7a314d9b54c6902391897940d7ef181ee2d84, the tip of sbom: record a traced library, zlib, and explicit dependency versions wolfssl-compliance-tooling#37. Merge this pull request after that one.

Test plan

  • python3 -m unittest scripts/test_gen_sbom.py
  • ./configure --enable-shared --enable-static && make sbom
  • Confirm ntia-checker -c ntia wolfssl-*.spdx.json is conformant and the CycloneDX 1.6 strict validator accepts wolfssl-*.cdx.json.
  • Confirm the SPDX package URL is pkg:github/wolfssl/wolfssl@v<version>-stable.
  • Configure with CMake and confirm tools/sbom/build/sbom.cmake is present in the clone.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 14:22
@sameehj
sameehj requested a review from MarkAtwood October 9, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Driver contract mismatches and CMake portability and embedding defects currently break supported SBOM routes.

5 open findings
What changed in this PR

Vendors pinned SBOM tooling and routes wolfSSL’s Autotools, CMake, and standalone generation through it.

Changes:

  • Adds the pinned generator, drivers, validators, and build-system frontends.
  • Rewires make sbom, CMake, packaging, and legacy entry points.
  • Updates tests, CI, documentation, and wolfSSL PURLs.
File Description
.gitignore Tracks vendored SBOM build helpers.
.github/​workflows/​sbom.yml Updates syntax and PURL checks.
CMakeLists.txt Adds the CMake SBOM target.
Makefile.am Uses and packages vendored tooling.
doc/​CRA.md Documents new paths and PURL.
doc/​SBOM.md Documents vendored generation flow.
scripts/​gen-sbom Forwards to the vendored generator.
scripts/​include.am Packages compatibility entry points.
scripts/​sbom.am Includes the vendored recipe.
scripts/​test_gen_sbom.py Tests vendored behavior and identifiers.
tools/​sbom/​.wolfssl-compliance-tooling-rev Records the pinned revision.
tools/​sbom/​README.md Describes the vendored toolkit.
tools/​sbom/​VERSION Records toolkit version.
tools/​sbom/​build/​sbom.cmake Provides reusable CMake integration.
tools/​sbom/​build/​sbom.mk Provides reusable Make integration.
tools/​sbom/​frontends/​compdb_sbom.py Adds compilation-database extraction.
tools/​sbom/​frontends/​iar_sbom.py Adds IAR project extraction.
tools/​sbom/​frontends/​zephyr_sbom.py Adds Zephyr source extraction.
tools/​sbom/​gen-sbom Implements SBOM generation.
tools/​sbom/​sbom-driver Adds the shell driver wrapper.
tools/​sbom/​sbom-driver.py Coordinates generator inputs.
tools/​sbom/​sbom.am Provides the shared Automake recipe.
tools/​sbom/​validate_sbom.py Adds structural validation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +126 to +128
set(_cmd ${CMAKE_COMMAND} -E env HOSTCC=${SB_HOSTCC}
${_WOLFSSL_COMPLIANCE_TOOLING_DRIVER}
--name ${SB_NAME}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMake helper now runs sbom-driver.py with the Python interpreter. A native Windows generator can start that file. The extensionless sbom-driver shell wrapper remains the Make and shell entry point.

The change is in wolfssl-compliance-tooling 27f7a31. This pull request pins that commit in 3d868e7bf.

Comment thread CMakeLists.txt Outdated
Comment on lines +5563 to +5564
LICENSE ${CMAKE_SOURCE_DIR}/LICENSING
ROOT ${CMAKE_SOURCE_DIR}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LICENSE and ROOT now use CMAKE_CURRENT_SOURCE_DIR. An add_subdirectory() or FetchContent build reads this tree's LICENSING file. The helper already defaulted ROOT to that directory. This call was overriding it.

Fixed in 3d868e7bf.

Comment thread tools/sbom/sbom-driver.py Outdated
Comment on lines +354 to +357
if args.lib:
cmd += ["--lib", args.lib]
if args.no_artifact_hash:
cmd += ["--no-artifact-hash"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failure was real. The driver was sending --lib and --no-artifact-hash together, and gen-sbom accepts one checksum source.

The driver now sends only --no-artifact-hash. --lib or --srcs-file still names the as-built artifact for the caller, and that path is not a second checksum source. gen-sbom is unchanged. scripts/test_gen_sbom.py and doc/SBOM.md still require the two flags together to fail.

The change is in wolfssl-compliance-tooling 27f7a31. This pull request pins that commit in 3d868e7bf.

Comment thread tools/sbom/sbom-driver.py
Comment on lines +366 to +370
if args.user_settings:
if not os.path.isfile(args.user_settings):
sys.exit(f"ERROR: --user-settings '{args.user_settings}' "
f"does not exist.")
cmd += ["--user-settings", args.user_settings]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--user-settings is now the path to wolfssl/wolfcrypt/settings.h. The driver also requires --user-settings-include and --user-settings-define WOLFSSL_USER_SETTINGS, and it forwards all three. A user_settings.h path alone is rejected, because that file does not carry the macros settings.h derives. Make and CMake take the same three values.

The change is in wolfssl-compliance-tooling 27f7a31. This pull request pins that commit in 3d868e7bf.

Comment thread tools/sbom/README.md Outdated
Comment on lines +50 to +51
The shared driver is product-neutral and calls the vendored `share/gen-sbom` by
default. Pass `--gen-sbom` only when you want to override that copy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README now says the driver calls the gen-sbom file in the same directory. That sentence is true in the toolkit tree and in this tree.

The change is in wolfssl-compliance-tooling 27f7a31. This pull request pins that commit in 3d868e7bf.

@sameehj

sameehj commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@MarkAtwood the description now matches the pin in tools/sbom/.wolfssl-compliance-tooling-rev (27f7a314d9b54c6902391897940d7ef181ee2d84).

Please review this after toolkit #37 is on master.

MarkAtwood
MarkAtwood previously approved these changes Oct 20, 2026

@MarkAtwood MarkAtwood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, make sbom, make sbom from the make dist tarball and the cmake sbom target all hash the same lib sha256sum does, default autotools and cmake builds untouched, the -1798 all moved into tools/sbom/sbom.am with nothing dropped. socat is the usual flake, test 23 DUALSYSTEMFDSFLUSH has no tls in it and it's failed on 9 other prs this month. two things before merge, the target name one inline, and re-pin .wolfssl-compliance-tooling-rev to whatever wolfSSL/wolfssl-compliance-tooling#37 lands as, it's 27f7a31 and #37 head is 6536aa0 now. fyi the cdx build properties go from "1" to "" for bare #defines, nothing in wolfssl reads them, just an output change

Comment thread CMakeLists.txt Outdated
set(_sbom_error "")
endif()

if(NOT _sbom_error STREQUAL "")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configure breaks when wolfssl gets pulled in with add_subdirectory by a project that has its own sbom target, wolftpm's -DWITH_WOLFSSL_TREE does exactly that. add_custom_target cannot create target "sbom" because another target with the same name already exists, master configures fine. PROJECT_IS_TOP_LEVEL is 3.21 so it's out, and NOT TARGET sbom doesn't help since wolftpm adds wolfssl before its own sbom. this configures under a parent with its own sbom and standalone sbom still writes both files

Suggested change
if(NOT _sbom_error STREQUAL "")
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# added as a subproject, the parent owns the sbom target name
elseif(NOT _sbom_error STREQUAL "")

@sameehj sameehj Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f9947fb. The sbom target is created only when CMAKE_SOURCE_DIR equals CMAKE_CURRENT_SOURCE_DIR. A parent such as wolfTPM that adds wolfSSL with add_subdirectory() keeps its own sbom target. A standalone build still creates sbom.

b94ed34 moves the tools/sbom pin to 443ef5fc53e1b80809012043890ab182c9bc6b99, current toolkit master. That includes the merge of wolfssl-compliance-tooling #37 and the later commits on master. A top-level wolfSSL build also gets install-sbom and uninstall-sbom from that snapshot. A subproject still does not create those targets.

The library SBOM now comes from the pinned tools/sbom snapshot.
scripts/gen-sbom forwards to that generator, and make bomsh still
passes SBOM_LIB_OVERRIDE so the traced library is the hashed file.
The Linux SBOM job now requires pkg:github/wolfssl/wolfssl@v<version>-stable.
scripts/gen-sbom stays importable and forwards to tools/sbom/gen-sbom.
scripts/sbom.am includes the vendored recipe so the old include path still works.
.gitignore ignored every build/ directory, so a clone omitted
tools/sbom/build. CMake includes those files.
LICENSE and ROOT follow CMAKE_CURRENT_SOURCE_DIR, so an add_subdirectory build reads this project's LICENSING file. The pin moves to the driver that starts under Python, sends one checksum source, and forwards settings.h with its include path and WOLFSSL_USER_SETTINGS.
A parent that already has an sbom target, such as wolfTPM built with
WITH_WOLFSSL_TREE, failed to configure. Create the target only when
wolfSSL is the top project.

Pin tools/sbom to 77296bc, the merge of wolfssl-compliance-tooling
pull request 37.
Move tools/sbom to 443ef5fc. That commit includes the merge of toolkit wolfSSL#37
and the later install-sbom scripts. A subproject still does not create the
sbom target.
WC_LINUXKM_FORCE_SVR_DYNAMIC_AUDITING and the WOLFSSL_TI_AM64X_* entries
were out of order, which fails the known-macro check. The bad order also
caused false "unneeded entries" reports for the entries between them.
The source-text check rejects hard tabs in tools/sbom/build/sbom.mk.
The toolkit now starts each recipe line with $(SBOM_TAB) instead of a
literal tab. Pin the toolkit to that revision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants