Skip to content

fips: auto-detect --enable-fips version from a tree manifest - #11258

Draft
jackctj117 wants to merge 1 commit into
wolfSSL:masterfrom
jackctj117:fips-autodetect-version
Draft

fips: auto-detect --enable-fips version from a tree manifest#11258
jackctj117 wants to merge 1 commit into
wolfSSL:masterfrom
jackctj117:fips-autodetect-version

Conversation

@jackctj117

Copy link
Copy Markdown
Contributor

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:

  • Added logic in fips-check.sh to generate a .wolfssl-fips-bundle manifest, 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]
  • Updated configure.ac to 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:

  • Introduced a generated region in IDE/WIN10/user_settings.h that is rewritten by fips-check.sh to reflect the correct FIPS version macros, ensuring Visual Studio builds use the same values as autotools builds. [1] [2] [3]

Distribution and Packaging Improvements:

  • Modified Makefile.am to 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.

@jackctj117 jackctj117 self-assigned this Aug 25, 2026
Copilot AI lite review requested due to automatic review settings August 25, 2026 15:40

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.

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-bundle manifest during FIPS bundle assembly and include it in make dist output when present.
  • Update configure.ac to auto-detect --enable-fips from the manifest and error early on mismatches.
  • Stamp Visual Studio user_settings.h with the same derived FIPS version macros that ./configure produces.

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.

Comment thread configure.ac
[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"],
Comment thread configure.ac
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`])
Comment thread fips-check.sh
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)
@wolfSSL-Bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

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