Skip to content

Reject zero PBKDF iterations without a positive time budget - #59

Merged
Coralesoft merged 1 commit into
mainfrom
fix/pbkdf-zero-iterations
Jul 19, 2026
Merged

Reject zero PBKDF iterations without a positive time budget#59
Coralesoft merged 1 commit into
mainfrom
fix/pbkdf-zero-iterations

Conversation

@Coralesoft

Copy link
Copy Markdown
Collaborator

Reported upstream as weidai11/cryptopp#1366.

PBKDF1, PBKDF2, and the PKCS #12 KDF silently treated zero iterations as one when no positive time budget was supplied.

Reject that input with InvalidArgument while preserving the existing timed mode where zero iterations are paired with a positive time budget.

Add rejection tests for all three KDFs, NaN handling, timed-mode controls, output-buffer preservation, and PBKDF2-HMAC-SHA256 vectors from RFC 7914.

PBKDF1, PBKDF2, and the PKCS #12 KDF silently treated zero iterations as one when no positive time budget was supplied.

Throw `InvalidArgument` instead while preserving the timed zero-iteration path. Add rejection, NaN, timed-mode, and RFC 7914 PBKDF2 tests.

Reported upstream as weidai11/cryptopp issue 1366.
@Coralesoft
Coralesoft merged commit 9455d45 into main Jul 19, 2026
47 checks passed
@Coralesoft
Coralesoft deleted the fix/pbkdf-zero-iterations branch July 19, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant