| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
|
#57273 will allow the implementation to share validation code with the actual algorithm operations. |
Sorry, something went wrong.
|
If I am understanding the implementation here correctly, "supports" is based largely on JS-level validation of the input arguments. It would be possible, however, for Node.js to be compiled against a different version of Openssl that does not actually have support for an algorithm that the JS side claims to support, correct? For instance, Ed448 is not supported by Node.js builds using BoringSSL but, unless I'm misunderstanding the implementation here, this might still claim that Ed448 is supported on such builds? Is that accurate or did I miss something? Btw, very happy to see this! |
Sorry, something went wrong.
|
@jasnell I did think of this. With everything being tied into the "normalize algorithm" routine, all it would take to make the algorithms conditional based on the underlying crypto lib support (both execution as well as their status in the supports API) is doing something similar to what we do for adding experimental algorithms here Therefore if we get the signal from internalBinding('crypto') that something isn't supported, we can make supports as well as the actual SubtleCrypto methods fail/false in JS before it gets to C++ |
Sorry, something went wrong.
| > Stability: 1.0 - Early development. SubleCrypto.supports is an experimental | ||
| > implementation based on [Modern Algorithms in the Web Cryptography API][] | ||
|
|
||
| This example derives a key from a password using Argon2, if available, |
There was a problem hiding this comment.
A bit more introductory text here at the start would be good, otherwise at first glance someone might thing this section is only about Argon2. Something like, The `SubtleCrypto.supports(...)` API provides a way of detecting if a particular algorithm or set of options are supported.
Sorry, something went wrong.
| throw new ERR_ILLEGAL_CONSTRUCTOR(); | ||
| } | ||
|
|
||
| static supports(operation, algorithm, lengthOrAdditionalAlgorithm = null) { |
There was a problem hiding this comment.
A comment here that explains the heuristics or points to the spec would be good as a reminder that this is implementing to a spec.
Sorry, something went wrong.
|
Thank you @jasnell, i'll incorporate these comments in a bigger PR for WebCrypto modern algos once https://redirect.github.com/nodejs/node/pull/59259 and https://redirect.github.com/nodejs/node/pull/59284 land |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Implementation of SubtleCrypto.supports.
While today we support all the methods and algorithms of Web Cryptography, this method will become really useful for interop when modern webcrypto algorithms start popping up
cc @twiss
This will remain a draft PR until this work is accepted by WICG as a proposal for the addition of its content to the Web Cryptography.