We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5198573 commit 6f975dbCopy full SHA for 6f975db
2 files changed
lib/internal/crypto/webcrypto.js
@@ -865,7 +865,7 @@ async function importKey(
865
866
webidl ??= require('internal/crypto/webidl');
867
const prefix = "Failed to execute 'importKey' on 'SubtleCrypto'";
868
- webidl.requiredArguments(arguments.length, 4, { prefix });
+ webidl.requiredArguments(arguments.length, 5, { prefix });
869
format = webidl.converters.KeyFormat(format, {
870
prefix,
871
context: '1st argument',
test/parallel/test-webcrypto-export-import.js
@@ -435,3 +435,11 @@ if (!process.features.openssl_is_boringssl) {
435
subtle.importKey('jwk', jwk, { name: 'HMAC', hash: 'SHA3-256' }, false, ['sign', 'verify']).then(common.mustCall());
436
}
437
438
+
439
+{
440
+ const keyData = new Uint8Array(32);
441
+ assert.rejects(
442
+ subtle.importKey('raw', keyData, { name: 'HMAC', hash: 'SHA-256' }, false),
443
+ { code: 'ERR_MISSING_ARGS' }
444
+ ).then(common.mustCall());
445
+}
0 commit comments