| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -865,7 +865,7 @@ async function importKey( | |||
| 865 | 865 | ||
| 866 | 866 | webidl ??= require('internal/crypto/webidl'); | |
| 867 | 867 | const prefix = "Failed to execute 'importKey' on 'SubtleCrypto'"; | |
| 868 | - webidl.requiredArguments(arguments.length, 4, { prefix }); | ||
| 868 | + webidl.requiredArguments(arguments.length, 5, { prefix }); | ||
| 869 | 869 | format = webidl.converters.KeyFormat(format, { | |
| 870 | 870 | prefix, | |
| 871 | 871 | context: '1st argument', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -435,3 +435,11 @@ if (!process.features.openssl_is_boringssl) { | |||
| 435 | 435 | subtle.importKey('jwk', jwk, { name: 'HMAC', hash: 'SHA3-256' }, false, ['sign', 'verify']).then(common.mustCall()); | |
| 436 | 436 | } | |
| 437 | 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 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments