-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto is not exposed to webworkers #33
Comments
Firefox bug filed: https://bugzilla.mozilla.org/show_bug.cgi?id=1111150 |
In addition, we can potentially restructure web workers to hang off of the hidden DOM window, rather than being workers directly created from the JSM context. Finding the different types & definitions in the firefox code base is quite painful. |
core.crypto? On Sat, Dec 13, 2014 at 7:53 PM, Will [email protected] wrote:
|
There are enough libraries I've encountered that rely on a synchronous |
Refactored freedom-for-firefox to use |
Just noting that this is also blocking e2e working in Firefox - seems like it is stalled at the time being on the Firefox side though. |
Would be great if we could all vote for this issue to be fixed. (signin with mozilla persona account on the bug page and click on the vote button) |
```javascript freedom['core.crypto']().getRandomBytes(n).then(function (buffer) { ... }); ``` address freedomjs/freedom-for-firefox#33
To update - this issue is still outstanding. There's relatively little visible progress on the Firefox bug (last comment in February, somebody assigned in March, few cc's since then). freedom.js has a new core.crypto provider meant to facilitate work-around, but unfortunately this requires being able to change the code making the randomness calls (as the provider is async and needs a buffer). For a working example: https://github.com/willscott/freedomjs-anonymized-metrics/blob/master/src/crypto.js In the case of freedom-pgp-e2e, the calls to So, that's the current status - I'll spend a bit more time seeing if it's possible for us to reasonably buffer randomness even without really controlling the
Opinions on the alternatives are welcome. Thanks! |
Just to point out that modules don't need to block on this. As long as you know ahead of time how much randomness you'll go through, you can buffer it in advance and then have the getRandomValue work as expected. |
Yeah I've played with that a bit, the problem is the knowing how much randomness ahead of time. The buffer was either inadequate or caused Firefox itself to throw odd errors. It's possibly still doable, I'll take another fresh look in the near future. |
You could make a version to return 0's, record how much buffer is requested
On Tue, Jul 14, 2015 at 3:24 PM, soycode [email protected] wrote:
|
Actually, a brief revisiting on my outstanding branch has lead to some initial promise (I got the demo to run in Firefox). I'll tweak a bit further and open a pull request for discussion. Thanks! |
Our polyfill has been working, but just to note - it looks like there was movement on Bugzilla on this issue about a week ago (https://bugzilla.mozilla.org/show_bug.cgi?id=842818#c60), so we may see a more native resolution and not need to depend on core.crypto for Firefox webworkers in the near future. @dborkan as an FYI since I know you're looking at related issues. |
And it looks like the bug is now resolved:
Firefox 46 (which I'm assuming will have these changes) is due to be released next week (4/26), so we should be able to close this out after then. |
crypto.getRandomValues
API does not appear to be defined in firefox webworkers - at least in firefox 34.The text was updated successfully, but these errors were encountered: