Skip to content

Commit 151e0d9

Browse files
authored
Merge pull request #10567 from douzzer/20260601-fixes
20260601-fixes
2 parents aec2756 + d037bd1 commit 151e0d9

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

tests/api/test_pkcs12.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,12 @@ int test_wc_PKCS12_PBKDF(void)
648648
ExpectIntEQ(XMEMCMP(derived, verify2, 24), 0);
649649

650650
/* iterations <= 0 must be rejected */
651+
#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0)
651652
ExpectIntEQ(wc_PKCS12_PBKDF(derived, passwd, (int)sizeof(passwd),
652653
salt, (int)sizeof(salt), 0, 24, WC_SHA256, 1), BAD_FUNC_ARG);
653654
ExpectIntEQ(wc_PKCS12_PBKDF(derived, passwd, (int)sizeof(passwd),
654655
salt, (int)sizeof(salt), -1, 24, WC_SHA256, 1), BAD_FUNC_ARG);
656+
#endif /* !HAVE_FIPS || FIPS_VERSION3_GE(7,0,0) */
655657
#endif
656658
return EXPECT_RESULT();
657659
}
@@ -717,12 +719,14 @@ int test_wc_PKCS12_PBKDF_ex(void)
717719
salt, (int)sizeof(salt), 1, 24, WC_SHA256, 3, NULL), 0);
718720

719721
/* iterations <= 0 must be rejected */
722+
#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0)
720723
ExpectIntEQ(wc_PKCS12_PBKDF_ex(derived, passwd, (int)sizeof(passwd),
721724
salt, (int)sizeof(salt), 0, 24, WC_SHA256, 1, NULL),
722725
BAD_FUNC_ARG);
723726
ExpectIntEQ(wc_PKCS12_PBKDF_ex(derived, passwd, (int)sizeof(passwd),
724727
salt, (int)sizeof(salt), -1, 24, WC_SHA256, 1, NULL),
725728
BAD_FUNC_ARG);
729+
#endif /* !HAVE_FIPS || FIPS_VERSION3_GE(7,0,0) */
726730
#endif
727731
return EXPECT_RESULT();
728732
}

tests/api/test_pwdbased.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ int test_wc_PBKDF1_ex_iterations(void)
2929
{
3030
EXPECT_DECLS;
3131
#if defined(HAVE_PBKDF1) && !defined(NO_PWDBASED) && !defined(NO_SHA) && \
32-
!defined(HAVE_SELFTEST)
32+
!defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0))
33+
3334
static const byte passwd[] = { 'p', 'a', 's', 's' };
3435
static const byte salt[] = { 0x78, 0x57, 0x8E, 0x5a,
3536
0x5d, 0x63, 0xcb, 0x06 };

wolfcrypt/src/evp_pk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ WOLFSSL_PKCS8_PRIV_KEY_INFO* wolfSSL_d2i_PKCS8_PKEY(
18931893
rawDer.buffer = pkcs8Der->buffer + inOutIdx;
18941894
rawDer.length = (word32)ret;
18951895
}
1896-
if (ret >= 0) {
1896+
if (ret > 0) {
18971897
ret = 0; /* good DER */
18981898
}
18991899
}

0 commit comments

Comments
 (0)