Page MenuHomePhabricator

JS errors in Firefox 16-21 due to missing crypto.getRandomValues()
Closed, ResolvedPublic

Description

Since T78449 generateRandomSessionId tries to use crypto.getRandomValues(), but it tests only the existence of window.crypto. At least in Firefox window.crypto exists longer (as non-standard implementation, at least since FF16) than crypto.getRandomValues() (starting with FF21). The implementation for generateRandomSessionId should check not only window.crypto, but also crypto.getRandomValues before calling it to avoid this error, even though this only affects old browsers.

Event Timeline

Schnark raised the priority of this task from to Needs Triage.
Schnark updated the task description. (Show Details)
Schnark subscribed.
Aklapper renamed this task from JS errors in old Firefox due to missing crypto.getRandomValues() to JS errors in Firefox 16-21 due to missing crypto.getRandomValues().Mar 3 2015, 9:07 AM
Aklapper triaged this task as Lowest priority.
Aklapper added a project: good first task.
Aklapper set Security to None.

Change 194156 had a related patch set uploaded (by Umherirrender):
Check crypto.getRandomValues in mw.user.js before use

https://gerrit.wikimedia.org/r/194156

matmarex subscribed.

Change 194156 merged by jenkins-bot:
mediawiki.user: Check crypto.getRandomValues before use

https://gerrit.wikimedia.org/r/194156