Uh oh!
There was an error while loading. Please reload this page.
crypto: adjust types for getRandomValues - #41481
Conversation
nodejs-github-bot
commented
Jan 11, 2022
Review requested:
|
@LiviaMedeiros If this is ready (it seems so) please remove the draft status, otherwise CI does not run. Thank you. |
c3076ab to
e074f4bCompareLiviaMedeiros
commented
Jan 11, 2022
Sure, now it's ready. Also I should explicitly mention that this is a potentially breaking change, if someone actually uses this method with |
lpinca
commented
Jan 12, 2022
The Web Crypto API is experimental so I do not think we should label this as "semver-major". Can you please also update the doc to remove the no longer supported types? |
LiviaMedeiros
commented
Jan 12, 2022
That's great. Raw crypto.getRandomValues(newArrayBuffer(8));// DOMException [TypeMismatchError] |
6b067ef to
c108ea1CompareLiviaMedeiros
commented
Jan 12, 2022
Rebased to make linter happy, updated list of |
DerekNonGeneric
left a comment
There was a problem hiding this comment.
@LiviaMedeiros, thank you so much for this PR!
Did a light review, so pre-approving for now, but hope that we can get a more thorough review on this by other collaborators more involved in these parts — would like to see if further improvements can be made here. :)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c108ea1 to
1ee830bCompare81a5a97 to
1dc73afCompareUh oh!
There was an error while loading. Please reload this page.
prevents Web Crypto API's getRandomValues from accepting DataView - Fixes: nodejs#41480 - Refs: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
1dc73af to
213ea91CompareUh oh!
There was an error while loading. Please reload this page.
This reverts commit 5f1c397.
tniessen
commented
Jan 17, 2022
Thanks @LiviaMedeiros :) |
nodejs-github-bot
commented
Jan 22, 2022
panva
commented
Jan 22, 2022
Landed in b8de7aa |
prevents Web Crypto API's getRandomValues from accepting DataView Fixes: #41480 Refs: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues PR-URL: #41481 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
prevents Web Crypto API's getRandomValues from accepting DataView Fixes: #41480 Refs: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues PR-URL: #41481 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This was previously a `DataView`, not an integer-type TypedArray, throwing in Node 17.5.0: nodejs/node#41481
prevents Web Crypto API's getRandomValues from accepting DataView Fixes: #41480 Refs: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues PR-URL: #41481 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
prevents Web Crypto API's getRandomValues from accepting DataView Fixes: #41480 Refs: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues PR-URL: #41481 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
prevents Web Crypto API's getRandomValues from accepting DataView Fixes: #41480 Refs: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues PR-URL: #41481 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
prevents Web Crypto API's getRandomValues from accepting DataView Fixes: #41480 Refs: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues PR-URL: #41481 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Fixes: #41480
Prevents Web Crypto API's getRandomValues from accepting DataView
WIP/draft at this moment.
I'm not sure if
new DataView(buf.buffer)in this test was intentional:node/test/parallel/test-webcrypto-random.js
Lines 47 to 53 in 6b7b0b7