crypto: resolve supports overloads by type · nodejs/node@1314d27 · GitHub
Skip to content

Commit 1314d27

Browse files
panvaaduh95
authored andcommitted
crypto: resolve supports overloads by type
Convert the third argument before checking the operation, and apply additional-algorithm checks only for that overload. Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex PR-URL: #66237 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent a855a46 commit 1314d27

3 files changed

Lines changed: 59 additions & 49 deletions

File tree

‎lib/internal/crypto/webcrypto.js‎

Lines changed: 21 additions & 47 deletions

‎test/fixtures/webcrypto/supports-level-2.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ export const vectors = {
268268
[hasX25519, 'X25519'],
269269
],
270270
'wrapKey': [
271-
[false, 'AES-KW'],
271+
[true, 'AES-KW'],
272272
[true, 'AES-KW', 'AES-CTR'],
273273
[true, 'AES-KW', 'HMAC'],
274274
],
275275
'unwrapKey': [
276-
[false, 'AES-KW'],
276+
[true, 'AES-KW'],
277277
[true, 'AES-KW', 'AES-CTR'],
278278
],
279279
'unsupported operation': [
Lines changed: 36 additions & 0 deletions

0 commit comments

Comments
 (0)