From 1cd9caca020fc5e2118a17af4a5ceaeab9a558ae Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Fri, 10 Apr 2026 12:58:40 -0400 Subject: [PATCH] Line length fixup and repro in second impl. --- wolfcrypt/src/pwdbased.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index c8b1ad6827..0c30c0e22b 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -417,7 +417,8 @@ int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd, int passLen, iterations = 1; if (iterations > WC_PBKDF_MAX_ITERATIONS) { - WOLFSSL_MSG("PKCS12 PBKDF iteration count exceeds WC_PBKDF_MAX_ITERATIONS"); + WOLFSSL_MSG("PKCS12 PBKDF iteration count exceeds " + "WC_PBKDF_MAX_ITERATIONS"); return BAD_FUNC_ARG; } @@ -649,6 +650,12 @@ int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd, int passLen, iterations = 1; } + if (iterations > WC_PBKDF_MAX_ITERATIONS) { + WOLFSSL_MSG("PKCS12 PBKDF iteration count exceeds " + "WC_PBKDF_MAX_ITERATIONS"); + return BAD_FUNC_ARG; + } + /* u = hash output size. */ hashT = wc_HashTypeConvert(hashType); ret = wc_HashGetDigestSize(hashT);