Skip to content

Commit 03eb38e

Browse files
committed
fix EVP_BytesToKey
1 parent 319f1d6 commit 03eb38e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

wolfcrypt/src/evp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6757,6 +6757,10 @@ void wolfSSL_EVP_init(void)
67576757
if (ret == WC_NO_ERR_TRACE(WOLFSSL_FAILURE))
67586758
goto end;
67596759

6760+
/* OpenSSL treats count <= 0 as 1 iteration */
6761+
if (count <= 0)
6762+
count = 1;
6763+
67606764
ret = wc_PBKDF1_ex(key, (int)info->keySz, iv, (int)info->ivSz, data, sz,
67616765
salt, EVP_SALT_SIZE, count, hashType, NULL);
67626766
if (ret == 0)

0 commit comments

Comments
 (0)