Skip to content

Conversation

littledivy
Copy link
Contributor

Closes #274

@twiss twiss merged commit 6438d87 into w3c:main Sep 2, 2021
github-actions bot added a commit that referenced this pull request Sep 2, 2021
… if length is zero (#275)

SHA: 6438d87
Reason: push, by @twiss

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@twiss
Copy link
Member

twiss commented Sep 2, 2021

@littledivy Thanks for the PR!

twiss added a commit that referenced this pull request Oct 25, 2024
…erations if length is zero (#275)"

This reverts commit 6438d87.
twiss added a commit that referenced this pull request Nov 6, 2024
* Revert "Throw an OperationError in the PBKDF2 and HKDF derive bits operations if length is zero (#275)"

This reverts commit 6438d87.

* Properly handle length=0 in the PBKDF2 derive bits operation

RFC 8018 does not allow passing dkLen=0. Therefore, we explicitly
return an empty ArrayBuffer in that case.

* Explicitly return `ArrayBuffer`s in HKDF and PBKDF2

The algorithm registrations state that they return `ArrayBuffer`s,
but the operations did not.
javifernandez added a commit to javifernandez/web-platform-tests that referenced this pull request Nov 8, 2024
The PR#380 [1] changed the PBKDF2 deriveBits operation to allow
zero length and introduced an additional step to return an empty
string in that case. It also reversted the PR#275 [2] so that
HKDF also handles the zero length in the same way.

This PR updates the tests cases affecting this 2 algorithms on
the cases where zero was passed in the length parameter.

[1] w3c/webcrypto#380
[2] w3c/webcrypto#275
javifernandez added a commit to javifernandez/web-platform-tests that referenced this pull request Nov 8, 2024
The PR#380 [1] changed the PBKDF2 deriveBits operation to allow
zero length and introduced an additional step to return an empty
string in that case. It also reversted the PR#275 [2] so that
HKDF also handles the zero length in the same way.

This PR updates the tests cases affecting this 2 algorithms on
the cases where zero was passed in the length parameter.

[1] w3c/webcrypto#380
[2] w3c/webcrypto#275
javifernandez added a commit to javifernandez/web-platform-tests that referenced this pull request Nov 8, 2024
The PR#380 [1] changed the PBKDF2 deriveBits operation to allow
zero length and introduced an additional step to return an empty
string in that case. It also reversted the PR#275 [2] so that
HKDF also handles the zero length in the same way.

This PR updates the tests cases affecting this 2 algorithms on
the cases where zero was passed in the length parameter.

[1] w3c/webcrypto#380
[2] w3c/webcrypto#275
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 derive bits should throw OperationError when length is zero

2 participants