Skip to content
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

[question] Prevent nextTick from being used when possible #203

Closed
panva opened this issue Jul 14, 2018 · 1 comment · Fixed by #214
Closed

[question] Prevent nextTick from being used when possible #203

panva opened this issue Jul 14, 2018 · 1 comment · Fixed by #214

Comments

@panva
Copy link
Contributor

panva commented Jul 14, 2018

Would you accept a change where this block was not applied in node environment? Or could we get rid of it altogether (seems forge has some resolved IE-related issues about setImmediate).

// Prevent nextTick from being used when possible
if ("function" === typeof setImmediate) {
  forge.util.setImmediate = forge.util.nextTick = function(callback) {
    setImmediate(callback);
  };
}

I'm tracing a lot of eventloop blocks to node-jose and forge and started a fork where I remove all the browser specifics and convert to async syntax, wanted to see where forge is needed, etc. (that's how i found RS256 and the like don't use native crypto at all, see #202). I could not verify this is the cause of the loop blocks but it's definitely not pretty.

In my fork i plan to put the browser and forge fallbacks back in place once i have node coverage up to 100% and then open a pr with a webpack build in place.

@linuxwolf
Copy link
Member

I think we can get rid of this altogether. We can try it and see if SauceLabs squaks, at least.

linuxwolf pushed a commit that referenced this issue Sep 10, 2018
* fix algorithms/rsaes.js header comment

* fix: use native node crypto for RS signing

* feat: use native node crypto for AES-KW Key-Wrapping

* feat: use native node crypto for RSA-OAEP and RSA1_5 encryption

* feat: use native node crypto for RSA1_5 decryption

* feat: use native node crypto for RSA-PSS

* test all ecdsa

* fix: remove setImmediate/nextTick hack

closes #203

* fix: correct jws verify input validation check

fixes #210

* feat: use native node crypto for ECDSA

* gracefully resolve node <= 6.12.0 && 7.0.0 as before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants