From c4b697966d587f2a11d7489c384cf842724c39e6 Mon Sep 17 00:00:00 2001 From: Colton Willey Date: Tue, 22 Jul 2025 10:06:15 -0700 Subject: [PATCH] Only restrict ECC signing with SHA1 if FIPS is enabled --- src/wp_ecdsa_sig.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp_ecdsa_sig.c b/src/wp_ecdsa_sig.c index 0b648e2f..008c76e2 100644 --- a/src/wp_ecdsa_sig.c +++ b/src/wp_ecdsa_sig.c @@ -428,6 +428,8 @@ static int wp_ecdsa_setup_md(wp_EcdsaSigCtx *ctx, const char *mdName, { int ok = 1; + (void)op; + if (mdProps == NULL) { mdProps = ctx->propQuery; } @@ -447,6 +449,7 @@ static int wp_ecdsa_setup_md(wp_EcdsaSigCtx *ctx, const char *mdName, { ok = 0; } +#ifdef HAVE_FIPS #if LIBWOLFSSL_VERSION_HEX >= 0x05007004 if ((ctx->hash.type == WC_HASH_TYPE_SHA) && (op == EVP_PKEY_OP_SIGN)) #else @@ -455,6 +458,7 @@ static int wp_ecdsa_setup_md(wp_EcdsaSigCtx *ctx, const char *mdName, { ok = 0; } +#endif if (ok) { #if LIBWOLFSSL_VERSION_HEX >= 0x05007004