back out sha512 hash type tests and leave only single macro guard in …#369
Closed
JacobBarthelmeh wants to merge 1 commit into
Closed
back out sha512 hash type tests and leave only single macro guard in …#369JacobBarthelmeh wants to merge 1 commit into
JacobBarthelmeh wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backs out the “build/test SHA-512 without WOLFSSL_SHA512_HASHTYPE” configuration and simplifies SHA-512 test compilation guards, primarily around the DMA-related test paths.
Changes:
- Remove
WOLFSSL_SHA512_HASHTYPEpreprocessor guards around SHA-512 async test helpers and their invocation. - Remove the
NO_SHA512_HASHTYPEMakefile option and theWHTEST_NO_SHA512_HASHTYPEuser_settings conditional. - Remove the CI workflow job that built/tests DMA with
WOLFSSL_SHA512_HASHTYPEdisabled.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
test/wh_test_crypto.c |
Removes WOLFSSL_SHA512_HASHTYPE gating around SHA-512 async (including DMA) tests. |
test/Makefile |
Deletes the NO_SHA512_HASHTYPE build option and related defines. |
test/config/user_settings.h |
Makes WOLFSSL_SHA512_HASHTYPE unconditional for the test configuration. |
.github/workflows/build-and-test.yml |
Removes the CI job that tested DMA builds without WOLFSSL_SHA512_HASHTYPE. |
Comments suppressed due to low confidence (2)
test/wh_test_crypto.c:5031
- The SHA-512 async test helper is now compiled whenever WOLFSSL_SHA512 is enabled, but it calls wh_Client_Sha512* async APIs that are only compiled when WOLFSSL_SHA512_HASHTYPE is also defined (see src/wh_client_crypto.c guarded by
#if defined(WOLFSSL_SHA512) && defined(WOLFSSL_SHA512_HASHTYPE)). This will break builds where SHA-512 is enabled but HASHTYPE is not (notably WOLFSSL_LIB=1 against an installed wolfSSL). Reintroduce aWOLFSSL_SHA512_HASHTYPEguard here (or make the client async APIs available without that macro).
This issue also appears on line 11306 of the same file.
/* Direct exercise of the new async non-DMA SHA512 primitives. */
static int whTest_CryptoSha512Async(whClientContext* ctx, int devId,
WC_RNG* rng)
{
int ret = WH_ERROR_OK;
test/wh_test_crypto.c:11310
- The DMA SHA-512 async test is now gated only by WOLFHSM_CFG_DMA, but the underlying client SHA-512 DMA async APIs are also guarded by WOLFSSL_SHA512_HASHTYPE in src/wh_client_crypto.c. If SHA-512 is enabled without HASHTYPE, this will lead to missing symbols at link time. Consider restoring
&& defined(WOLFSSL_SHA512_HASHTYPE)(or otherwise ensuring the DMA async APIs are built in that configuration).
#ifdef WOLFHSM_CFG_DMA
if (ret == WH_ERROR_OK) {
ret = whTest_CryptoSha512DmaAsync(client, WH_DEV_ID_DMA, rng);
}
#endif /* WOLFHSM_CFG_DMA */
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
…DMA section
Reverts CI test from #357