Skip to content

gate wc_RNG_HealthTest* exports and tests on WOLFSSL_FIPS_EXPORT_LOCAL_APIS - #11960

Merged
philljj merged 6 commits into
wolfSSL:masterfrom
lealem47:WOLFSSL_PUBLIC_HT
Nov 4, 2026
Merged

philljj merged 6 commits into
wolfSSL:masterfrom
lealem47:WOLFSSL_PUBLIC_HT

Conversation

@lealem47

@lealem47 lealem47 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Make wc_RNG_HealthTest* APIs WOLFSSL_LOCAL unless WOLFSSL_FIPS_EXPORT_LOCAL_APIS is defined. These will now not be exported in FIPS builds to strictly comply with FIPS 140-3 IG 9.3.A requirements and avoid testing arbitrary seeds.

WOLFSSL_FIPS_EXPORT_LOCAL_APIS will continue to be enabled for non-fips builds and for FIPS testing builds with HAVE_FORCE_FIPS_FAILURE

Testing

How did you test?

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@lealem47 lealem47 self-assigned this Nov 2, 2026
Copilot AI balanced review requested due to automatic review settings November 2, 2026 22:14
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

stm32-sim-stm32h753

  • FLASH: .text +64 B (+0.0%, 203,756 B / 2,097,152 B, total: 10% used)

zephyr-frdm_rw612

  • FLASH: log_const_area -8 B, rodata -8 B, text +1,552 B (+0.5%, 284,000 B / 67,108,864 B, total: 0% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

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

Health-test export gating remains incomplete: some shared FIPS builds still expose the functions, while Rust and C# bindings and tests fail when the exports are removed.

3 open issues
What changed in this PR

This PR restricts RNG health-test API exports in FIPS builds to support FIPS 140-3 compliance, while preserving access for non-FIPS and forced-failure testing builds.

Changes:

  • Defines WOLFSSL_PUBLIC_HT for non-FIPS builds and builds using HAVE_FORCE_FIPS_FAILURE.
  • Selects public or local visibility for health-test APIs through HT_API.
  • Gates C health-test calls and test vectors on public API availability.
File Description
wolfssl/​wolfcrypt/​settings.h Defines when health-test APIs are public.
wolfssl/​wolfcrypt/​random.h Applies conditional visibility to health-test declarations.
wolfcrypt/​test/​test.c Guards health-test vectors and calls with WOLFSSL_PUBLIC_HT.
tests/​api/​test_random.c Gates API health tests on public availability.

Review effort: Balanced

Comment thread wolfssl/wolfcrypt/random.h Resolved
Comment thread wolfssl/wolfcrypt/random.h Resolved
Comment thread wolfssl/wolfcrypt/random.h Resolved
@lealem47

lealem47 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Tests will fail until https://github.com/wolfSSL/testing/pull/1090 is in

SparkiDev
SparkiDev previously approved these changes Nov 3, 2026
@lealem47

lealem47 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Reworking this PR to have a more generic application (WOLFSSL_FIPS_PRIVATE_API) based on the teams feedback

@lealem47 lealem47 changed the title gate wc_RNG_HealthTest* exports and tests on WOLFSSL_PUBLIC_HT gate wc_RNG_HealthTest* exports and tests on !WOLFSSL_FIPS_PRIVATE_API Nov 3, 2026
@lealem47
lealem47 requested a review from SparkiDev November 3, 2026 23:55
@lealem47

lealem47 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Ready for re-review

@SparkiDev

SparkiDev commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Jenkins: retest this please

SparkiDev
SparkiDev previously approved these changes Nov 4, 2026

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.

🔵 Needs a closer look

Unavailable licensed FIPS sources and companion wolfSSL/fips PR #424 prevent verification of symbol exports and self-tests across production, opt-in, and forced-failure builds.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@SparkiDev

Copy link
Copy Markdown
Contributor

unrecognized macros used:
WOLFSSL_EXPOSE_FIPS_PRIVATE_API

@philljj

philljj commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

tests good with multi-test with gcc-c89, c89-clang-tidy, etc scenarios

@lealem47 lealem47 changed the title gate wc_RNG_HealthTest* exports and tests on !WOLFSSL_FIPS_PRIVATE_API gate wc_RNG_HealthTest* exports and tests on WOLFSSL_FIPS_EXPORT_LOCAL_APIS Nov 4, 2026
@lealem47 lealem47 assigned douzzer and philljj and unassigned lealem47 Nov 4, 2026

@douzzer douzzer 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.

tested with

wolfssl-multi-test.sh ...
check-source-text
all-crypto-only-intelasm-fips-dev-linuxkm-next-insmod-optest-acvp
quantum-safe-wolfssl-all-linuxkm-defaults-clang-tidy
quantum-safe-wolfssl-all-crypto-only-intelasm-sp-asm-fips-dev-linuxkm-next-clang-tidy
quantum-safe-wolfssl-all-crypto-only-intelasm-sp-asm-fips-dev-linuxkm-next-insmod

@philljj

philljj commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

note: some PRB failures expected until this is merged:

Merge both PRs together.

@lealem47

lealem47 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Jenkins retest this please

@philljj
philljj merged commit b64bbaa into wolfSSL:master Nov 4, 2026
452 of 453 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.

7 participants