Closed Bug 1236176 Opened 9 years ago Closed 9 years ago

Incorrect crypto.getRandomValues() max length

Categories

(Core :: Security, defect)

43 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: lcf.vs, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:43.0) Gecko/20100101 Firefox/43.0 Build ID: 20151223140742 Steps to reproduce: Hi all, I'm trying to make a random values with a length between 0 and 65536 : crypto.getRandomValues(new Uint16Array(length)); Actual results: It fails if length is greater than 32768 (QuotaExceededError) Expected results: crypto.getRandomValues() must follow the related doc : "A QuotaExceededError DOMException is thrown if the requested length is greater than 65536 bytes."
Component: Untriaged → DOM: Security
Product: Firefox → Core
Component: DOM: Security → Security
(In reply to Lcf.vs from comment #0) > crypto.getRandomValues(new Uint16Array(length)); ... > It fails if length is greater than 32768 (QuotaExceededError) ... > "A QuotaExceededError DOMException is thrown if the requested length is > greater than 65536 bytes." Unless I'm misunderstanding, a Uint16Array of length longer than 32768 will have a length in bytes greater than 65536, so I believe the implementation is already spec-compliant here.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.