random.c: fix fips v7 define guards.#10885
Open
philljj wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request aligns wolfcrypt/src/random.c with the existing FIPS v7+ / non-FIPS define guards already present in wolfssl/wolfcrypt/random.h, preventing FIPS=v6 builds from compiling non-prototyped (and apparently unsupported) DRBG state/disable APIs.
Changes:
- Wrapped the runtime DRBG disable-state globals and mutex helpers in
random.cwith the same!HAVE_SELFTEST && (!HAVE_FIPS || FIPS_VERSION3_GE(7,0,0))guard used by the header. - Moved/adjusted preprocessor
#endifboundaries so the guarded functions inrandom.cmatch the header’s visibility and avoid-Wmissing-prototypesfailures. - Tightened the compile guards for the extended SHA-256 DRBG health-test entrypoint to exclude selftest / older FIPS builds.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return ret; | ||
| } | ||
| #endif /* !NO_SHA256 */ | ||
| #endif /* !NO_SHA256 && !HAVE_SELFTEST && FIPS v7+ */ |
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.
Description
Add some fips v7 define guards to
random.c. They were present inrandom.h, but missing for the corresponding functions inrandom.c.Fixes fips=v6 build errors on freebsd userspace:
Requires:
Testing