This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27771 - Should HKDF's derive bits operation throw OperationError if length is null?
Summary: Should HKDF's derive bits operation throw OperationError if length is null?
Status: RESOLVED MOVED
Alias: None
Product: Web Cryptography
Classification: Unclassified
Component: Web Cryptography API Document (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Ryan Sleevi
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-06 19:20 UTC by Nick Harper
Modified: 2016-05-24 00:45 UTC (History)
2 users (show)

See Also:


Attachments

Description Nick Harper 2015-01-06 19:20:11 UTC
The spec for HKDF's derive bits operation says to throw a TypeError if length is null. I'm wondering if OperationError would be a better choice.

For 3 of the 4 other algorithms that support the derive bits operation (ECDH, DH, PBKDF2), they throw an OperationError if the provided length is not valid (which includes if the length is null). The last one (CONCAT) doesn't specify, but it is implied that it would throw an OperationError. Since HKDF is the only one that throws a TypeError if length is null, it seems like it would make more sense to throw an OperationError instead to match the behavior of other algorithms.
Comment 1 Mark Watson 2016-05-24 00:23:13 UTC
Moved to https://github.com/w3c/webcrypto/issues/74