Skip to content

Reject zero PBKDF iterations without a positive time budget (GH #1366) - #1367

Open
Coralesoft wants to merge 1 commit into
weidai11:masterfrom
Coralesoft:fix/issue-1366-pbkdf-zero-iterations
Open

Reject zero PBKDF iterations without a positive time budget (GH #1366)#1367
Coralesoft wants to merge 1 commit into
weidai11:masterfrom
Coralesoft:fix/issue-1366-pbkdf-zero-iterations

Conversation

@Coralesoft

Copy link
Copy Markdown
Contributor

Fixes #1366.

PBKDF1, PBKDF2, and the PKCS #12 KDF silently treated zero iterations as one when no positive time budget was supplied, guarded only by a debug assert that is inactive in release builds.

Throw InvalidArgument for zero iterations without a positive TimeInSeconds, including NaN. The existing timed mode, where zero iterations are paired with a positive time budget, is unchanged.

…i11#1366)

PBKDF1, PBKDF2, and the PKCS weidai11#12 KDF silently treated zero iterations as one when no positive time budget was supplied, guarded only by a debug assert.

Throw `InvalidArgument` instead while preserving the timed mode where zero iterations are paired with a positive time budget.
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.

PBKDF2 DeriveKey treats count 0 like count 1 when timeInSeconds is 0.0

1 participant