Merge pull request #10557 from dgarske/cryptocb_fips

Fix FIPS v6 or older build with crypto callbacks and SHA512
This commit is contained in:
Daniel Pouzzner
2026-06-01 13:32:08 -05:00
committed by GitHub
2 changed files with 16 additions and 2 deletions
+11 -1
View File
@@ -2033,10 +2033,20 @@ int wc_CryptoCb_Sha384Hash(wc_Sha384* sha384, const byte* in,
#ifdef WOLFSSL_SHA512
int wc_CryptoCb_Sha512Hash(wc_Sha512* sha512, const byte* in,
word32 inSz, byte* digest, size_t digestSz)
word32 inSz, byte* digest
#if !(defined(HAVE_FIPS) && FIPS_VERSION_LT(7,0))
, size_t digestSz
#endif
)
{
int ret = WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE);
CryptoCb* dev;
#if defined(HAVE_FIPS) && FIPS_VERSION_LT(7,0)
/* Older FIPS sha512.c snapshots call the 4-arg API (no digestSz). Treat as
* full-size SHA-512 with no variant dispatch, matching pre-digestSz
* behavior. */
size_t digestSz = WC_SHA512_DIGEST_SIZE;
#endif
/* locate registered callback */
#ifndef NO_SHA2_CRYPTO_CB
+5 -1
View File
@@ -871,7 +871,11 @@ WOLFSSL_LOCAL int wc_CryptoCb_Sha384Hash(wc_Sha384* sha384, const byte* in,
#endif
#ifdef WOLFSSL_SHA512
WOLFSSL_LOCAL int wc_CryptoCb_Sha512Hash(wc_Sha512* sha512, const byte* in,
word32 inSz, byte* digest, size_t digestSz);
word32 inSz, byte* digest
#if !(defined(HAVE_FIPS) && FIPS_VERSION_LT(7,0))
, size_t digestSz
#endif
);
#endif
#ifdef WOLFSSL_SHA3