Skip to content

Commit ae376b7

Browse files
authored
Merge pull request #227 from ColtonWilley/wp_ecc_sign_check
Only restrict ECC signing with SHA1 if FIPS is enabled
2 parents 12cf801 + c4b6979 commit ae376b7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/wp_ecdsa_sig.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ static int wp_ecdsa_setup_md(wp_EcdsaSigCtx *ctx, const char *mdName,
428428
{
429429
int ok = 1;
430430

431+
(void)op;
432+
431433
if (mdProps == NULL) {
432434
mdProps = ctx->propQuery;
433435
}
@@ -447,6 +449,7 @@ static int wp_ecdsa_setup_md(wp_EcdsaSigCtx *ctx, const char *mdName,
447449
{
448450
ok = 0;
449451
}
452+
#ifdef HAVE_FIPS
450453
#if LIBWOLFSSL_VERSION_HEX >= 0x05007004
451454
if ((ctx->hash.type == WC_HASH_TYPE_SHA) && (op == EVP_PKEY_OP_SIGN))
452455
#else
@@ -455,6 +458,7 @@ static int wp_ecdsa_setup_md(wp_EcdsaSigCtx *ctx, const char *mdName,
455458
{
456459
ok = 0;
457460
}
461+
#endif
458462

459463
if (ok) {
460464
#if LIBWOLFSSL_VERSION_HEX >= 0x05007004

0 commit comments

Comments
 (0)