fix(deps): validate --dep-* as yes/no; normalize make/cmake fragments - #17
Open
MarkAtwood wants to merge 2 commits into
Open
fix(deps): validate --dep-* as yes/no; normalize make/cmake fragments#17MarkAtwood wants to merge 2 commits into
MarkAtwood wants to merge 2 commits into
Conversation
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
gen-sbom built enabled_deps with `flag.lower() == 'yes'`, silently
treating any other value (1, true, on, Y, empty) as 'no'. A build
fragment wiring --dep-wolfssl=$(HAVE_WOLFSSL) to a truthy-but-not-'yes'
value would drop a CVE-bearing dependency from the SBOM with no warning.
Validate each --dep-* against {yes,no} and sys.exit on anything else.
Also normalize the make and cmake fragments to enable a dependency only
on an exact 'yes' (matching sbom.am), instead of forwarding on mere
non-emptiness -- so a 'no'/empty value is no longer forwarded.
Adds tests/test_dep_flags.py (yes records, no omits, bad values fail
loudly), wired into selftest.yml.
There was a problem hiding this comment.
Pull request overview
Tightens SBOM dependency-flag handling to prevent silent dependency omissions by validating gen-sbom --dep-* inputs and aligning build-system fragments to only enable dependencies on an explicit yes. Adds CI coverage for the new validation behavior.
Changes:
- Validate all
--dep-*inputs inshare/gen-sbomagainst{yes,no}and exit on any other value. - Normalize
sbom.mkandsbom.cmaketo only forward dependency flags when explicitly enabled withyes. - Add
tests/test_dep_flags.pyand wire it into.github/workflows/selftest.yml.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_dep_flags.py | Adds unit tests ensuring --dep-* values are strictly validated and affect SBOM component inclusion. |
| share/gen-sbom | Enforces {yes,no} validation for dependency flags and builds enabled_deps from validated inputs. |
| share/build/sbom.mk | Updates Make fragment to only pass --dep-* when the variable is exactly yes. |
| share/build/sbom.cmake | Updates CMake helper to only pass --dep-* when the value is exactly yes. |
| .github/workflows/selftest.yml | Adds the new dep-flag test to syntax-check and unittest execution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+4
to
+6
| A value that is neither (1, true, on, an empty string) must fail loudly rather | ||
| than be silently treated as 'no' -- a silently dropped dependency hides a | ||
| CVE-bearing component from the SBOM.""" |
Comment on lines
+76
to
+77
| $(if $(filter yes,$(SBOM_DEP_WOLFSSL)),--dep-wolfssl yes) \ | ||
| $(if $(filter yes,$(SBOM_DEP_OPENSSL)),--dep-openssl yes) \ |
Comment on lines
+132
to
139
| # Enable only on an exact "yes" (matching sbom.am), so a "no"/empty value | ||
| # is not forwarded as a dependency; gen-sbom validates the value it receives. | ||
| if(SB_DEP_WOLFSSL STREQUAL "yes") | ||
| list(APPEND _cmd --dep-wolfssl yes) | ||
| endif() | ||
| if(SB_DEP_OPENSSL) | ||
| list(APPEND _cmd --dep-openssl ${SB_DEP_OPENSSL}) | ||
| if(SB_DEP_OPENSSL STREQUAL "yes") | ||
| list(APPEND _cmd --dep-openssl yes) | ||
| endif() |
sameehj
force-pushed
the
master
branch
4 times, most recently
from
July 24, 2026 14:09
3ab77f9 to
9bdf5b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gen-sbom built
enabled_depswithflag.lower() == 'yes', silently treating any other value (1,true,on,Y, empty) asno. A fragment wiring--dep-wolfssl=$(HAVE_WOLFSSL)to a truthy-but-not-yesvalue would drop a CVE-bearing dependency from the SBOM with no warning — exactly the failure a CRA tool must not make quietly. Now validates each--dep-*against{yes,no}and exits on anything else.Also normalizes
sbom.mkandsbom.cmaketo enable a dependency only on an exactyes(matchingsbom.am), instead of forwarding on mere non-emptiness — so ano/empty value is no longer forwarded.sbom.amwas already correct and is unchanged.New
tests/test_dep_flags.py(yes records the dep, no omits it, and1/true/on/Y/""now fail loudly), wired intoselftest.yml. Full gen-sbom suite unchanged (162).Overlaps:
gen-sbomis also touched by #15 (identity), different region;selftest.ymlby several PRs. Addresses SBOM-gpex.7.