w3c / webcrypto

The W3C Web Cryptography API
https://w3c.github.io/webcrypto/
Other
267 stars 55 forks source link

Allow `length=0` in HKDF and PBKDF2 derive bits operations #380

Closed twiss closed 2 weeks ago

twiss commented 4 weeks ago

Fixes #370.

This PR reverts #275, and addresses #274 in an alternative way, namely by explicitly returning an empty ArrayBuffer for PBKDF2 when length=0 (as RFC 8018 does not allow dkLen=0).

Additionally, explicitly return an ArrayBuffer in all cases (the algorithm registrations already stated this, but the operations did not).


Preview | Diff

javifernandez commented 3 weeks ago

@nmahendru it´d be great if you could review this PR, to get also support from WebKit. Thanks.