fips: auto-detect --enable-fips version from a tree manifest - #11258
Draft
jackctj117 wants to merge 1 commit into
Draft
fips: auto-detect --enable-fips version from a tree manifest#11258jackctj117 wants to merge 1 commit into
jackctj117 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR adds a FIPS bundle manifest and wiring so builds can reliably auto-detect and validate the bundled FIPS module version (including keeping IDE/VS builds consistent with autotools).
Changes:
- Generate a
.wolfssl-fips-bundlemanifest during FIPS bundle assembly and include it inmake distoutput when present. - Update
configure.acto auto-detect--enable-fipsfrom the manifest and error early on mismatches. - Stamp Visual Studio
user_settings.hwith the same derived FIPS version macros that./configureproduces.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
fips-check.sh |
Writes the bundle manifest and stamps IDE user_settings.h from wolfssl/options.h. |
configure.ac |
Reads the manifest to auto-detect/cross-check --enable-fips and improves mismatch errors. |
Makefile.am |
Conditionally copies the manifest into make dist tarballs when present. |
IDE/WIN10/user_settings.h |
Adds a generated region for FIPS version macros that fips-check.sh rewrites. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [cert4718],[FIPS_REQUESTED_NORM="v5"], | ||
| [v7-ready],[FIPS_REQUESTED_NORM="ready"], | ||
| [v7-dev],[FIPS_REQUESTED_NORM="dev"]) | ||
| AS_IF([test "x$FIPS_BUNDLE_OPTION" != "x" && test "x$FIPS_REQUESTED_NORM" != "x$FIPS_BUNDLE_OPTION"], |
| WOLFSSL_FIPS_BUNDLE_FILE=".wolfssl-fips-bundle" | ||
| FIPS_BUNDLE_OPTION= | ||
| AS_IF([test -r "$srcdir/$WOLFSSL_FIPS_BUNDLE_FILE"], | ||
| [FIPS_BUNDLE_OPTION=`sed -n 's/^FIPS_OPTION=//p' "$srcdir/$WOLFSSL_FIPS_BUNDLE_FILE" 2>/dev/null | head -1`]) |
| body=$(mktemp "${TMPDIR:-/tmp}/fips-check.XXXXXX") || return 1 | ||
| for macro in HAVE_FIPS HAVE_FIPS_VERSION HAVE_FIPS_VERSION_MAJOR \ | ||
| HAVE_FIPS_VERSION_MINOR HAVE_FIPS_VERSION_PATCH; do | ||
| line=$(grep -E "^#define ${macro}( |\$)" "$options_h" | head -1) |
|
Can one of the admins verify this patch? |
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.
This pull request introduces a system for reliably tracking and verifying the FIPS module version in source trees and builds. It does so by generating a manifest file at assembly time, updating configuration scripts to reference this manifest, and ensuring that IDE builds (such as Visual Studio) use the same FIPS version macros as autotools builds. The changes help prevent mismatches and confusing build errors when working with FIPS bundles.
Key changes include:
FIPS Version Manifest and Configuration Integration:
fips-check.shto generate a.wolfssl-fips-bundlemanifest, recording the FIPS module version and build recipe used to assemble the source tree. This ensures that the correct FIPS version is always known and can be referenced later. [1] [2]configure.acto read the manifest and auto-detect or cross-check the requested FIPS version, providing immediate, clear errors if there is a mismatch between the build option and the bundled module. [1] [2] [3]IDE Build Consistency:
IDE/WIN10/user_settings.hthat is rewritten byfips-check.shto reflect the correct FIPS version macros, ensuring Visual Studio builds use the same values as autotools builds. [1] [2] [3]Distribution and Packaging Improvements:
Makefile.amto include the FIPS manifest in release tarballs only when present, preventing distribution errors for non-FIPS releases.These changes collectively improve build reliability and developer experience when working with FIPS-enabled source trees.