-
Notifications
You must be signed in to change notification settings - Fork 69
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.subtle.importKey does not accept ArrayBuffer (ArrayBuffer.prototype mismatch) #813
Comments
tksst
added a commit
to tksst/mobilepass-js
that referenced
this issue
Feb 24, 2024
Occuring the same issue while using gr2m/universal-github-app-jwt. They obviously generate an ArrayBuffer, but importKey fails with the exact same type error. I can also replicate it simply by doing |
I wrote a simple test code. new ArrayBuffer().constructor === ArrayBuffer above code evaluated as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Node.js 20.11.1
[email protected]
Bug Report
Current behavior
foo.js
:cmd:
result(error):
Expected behavior/code
Done without error
Additional context/screenshots
The above code has been verified to work with raw Node.js, Firefox and Chrome.
ArrayBuffer.prototype seems to be different from the original. Node.js checks here:
https://github.com/nodejs/node/blob/9b1bf44ea9e7785e38c93b7d22d32dbca262df6c/lib/internal/crypto/webidl.js#L183
Wrapping with uint8array is a workaround:
The text was updated successfully, but these errors were encountered: