Allow for FIPS builds without ED25519 & MD5 - #283
Open
lealem47 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves wolfCLU’s behavior (and test suite robustness) when building against wolfSSL configurations that omit MD5 and/or ED25519 (e.g., FIPS-focused builds), by returning NOT_COMPILED_IN with clearer messages and having tests skip appropriately instead of failing.
Changes:
- Added a shared Python test helper to detect
NOT_COMPILED_INvia wolfCLU’s"Error returned: -174."reporting and updated select tests toskipTest()when algorithms are not present. - Updated MD5-related setup paths (hash/dgst/bench/HMAC) to return
NOT_COMPILED_INand emit consistent “not compiled in” errors whenNO_MD5is enabled. - Updated ED25519 verify/sign codepaths to return
NOT_COMPILED_INwhen ED25519 support is not compiled in.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/wolfclu_test.py | Adds NOT_COMPILED_IN constant and not_compiled_in() helper for skipping optional-algorithm tests. |
| tests/hash/hash-test.py | Skips MD5 hash test when MD5 isn’t compiled into wolfSSL. |
| tests/genkey_sign_ver/genkey-sign-ver-test.py | Skips optional key-type generation when wolfSSL reports NOT_COMPILED_IN (e.g., ED25519 omitted). |
| tests/bench/bench-test.py | Skips MD5 benchmark when MD5 isn’t compiled into wolfSSL. |
| src/tools/clu_funcs.c | Adds NO_MD5 handling in HMAC hash selection for MD5. |
| src/sign-verify/clu_verify.c | Returns/logs NOT_COMPILED_IN when ED25519 verify is unavailable; silences unused params in stubs. |
| src/sign-verify/clu_sign.c | Returns NOT_COMPILED_IN for ED25519 sign when unavailable; silences unused params in stub. |
| src/sign-verify/clu_dgst_setup.c | Returns/logs NOT_COMPILED_IN for -md5 selection when NO_MD5. |
| src/hash/clu_hash_setup.c | Returns/logs NOT_COMPILED_IN for md5 shortcut when NO_MD5. |
| src/benchmark/clu_bench_setup.c | Ensures --md5 is recognized even under NO_MD5 so a targeted NOT_COMPILED_IN error can be returned. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1398
to
1402
| #else | ||
| wolfCLU_LogError("MD5 not compiled in"); | ||
| ret = NOT_COMPILED_IN; | ||
| #endif | ||
| case WC_HASH_TYPE_SHA: |
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.
Goes along with wolfSSL/wolfssl#11144