Skip to content

Fix --enable-pqc build with --disable-wolfcrypt - #606

Merged
aidangarske merged 1 commit into
wolfSSL:masterfrom
dgarske:pqc_no_wolfcrypt_build
Sep 11, 2026
Merged

aidangarske merged 1 commit into
wolfSSL:masterfrom
dgarske:pqc_no_wolfcrypt_build

Conversation

@dgarske

@dgarske dgarske commented Sep 11, 2026

Copy link
Copy Markdown
Member

./configure --enable-pqc --enable-spi --disable-wolfcrypt && make failed to build: wc_ForceZero was declared only inside the wolfCrypt branch of tpm2_types.h, and tests/unit_tests.c included wc_mldsa.h gated only on WOLFTPM_MLDSA_SIGN, so wolfCrypt's BAD_MUTEX_E enumerator collided with wolfTPM's macro of the same name. Adds a wc_ForceZero fallback for the no-wolfCrypt branch, guards the include, stops configure from probing a wolfSSL this mode never links, and adds a standalone-pqc CI job that builds the examples and unit tests (every existing PQC row uses --disable-examples, which is why this escaped).

Fixes:

./configure --enable-pqc --enable-spi --disable-wolfcrypt && make
...
examples/pqc/pqc_mssim_e2e.c: In function ‘test_mlkem_roundtrip’:
examples/pqc/pqc_mssim_e2e.c:131:5: error: implicit declaration of function ‘wc_ForceZero’; did you mean ‘TPM2_ForceZero’? [-Werror=implicit-function-declaration]
  131 |     wc_ForceZero(ss1, sizeof(ss1));
      |     ^~~~~~~~~~~~
      |     TPM2_ForceZero

@dgarske dgarske self-assigned this Sep 11, 2026
Copilot AI lite review requested due to automatic review settings September 11, 2026 18:42
@tomoveu

tomoveu commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Nice quick fix.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The fallback may fail to compile because size_t is not guaranteed to be defined.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes standalone PQC builds when wolfCrypt is disabled and adds CI coverage.

Changes:

  • Adds a no-wolfCrypt wc_ForceZero fallback.
  • Guards wolfSSL-specific includes and configure probes.
  • Adds standalone PQC build jobs.
File summaries
File Summary
wolftpm/tpm2_types.h Adds the fallback; currently lacks a guaranteed size_t definition.
tests/unit_tests.c Guards the wolfSSL ML-DSA include.
configure.ac Skips unnecessary wolfSSL probes.
.github/workflows/pqc-build-matrix.yml Adds standalone PQC CI coverage.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread wolftpm/tpm2_types.h
@aidangarske
aidangarske merged commit 498a8e1 into wolfSSL:master Sep 11, 2026
222 checks passed
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.

4 participants