| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c36bb1d commit c68c7d0
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -209,11 +209,11 @@ const nidOnlyKeyPairs = { | |||
| 209 | 209 | function createJob(mode, type, options) { | |
| 210 | 210 | validateString(type, 'type'); | |
| 211 | 211 | ||
| 212 | - const encoding = new SafeArrayIterator(parseKeyEncoding(type, options)); | ||
| 213 | - | ||
| 214 | 212 | if (options !== undefined) | |
| 215 | 213 | validateObject(options, 'options'); | |
| 216 | 214 | ||
| 215 | + const encoding = new SafeArrayIterator(parseKeyEncoding(type, options)); | ||
| 216 | + | ||
| 217 | 217 | switch (type) { | |
| 218 | 218 | case 'rsa': | |
| 219 | 219 | case 'rsa-pss': | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,6 +89,21 @@ const isBoringSSL = process.features.openssl_is_boringssl; | |||
| 89 | 89 | message: 'The "options" argument must be of type object. ' + | |
| 90 | 90 | 'Received type number (0)' | |
| 91 | 91 | }); | |
| 92 | + | ||
| 93 | + for (const type of ['rsa', 'ed25519']) { | ||
| 94 | + assert.throws(() => generateKeyPairSync(type, null), { | ||
| 95 | + name: 'TypeError', | ||
| 96 | + code: 'ERR_INVALID_ARG_TYPE', | ||
| 97 | + message: 'The "options" argument must be of type object. ' + | ||
| 98 | + 'Received null' | ||
| 99 | + }); | ||
| 100 | + assert.throws(() => generateKeyPair(type, null, common.mustNotCall()), { | ||
| 101 | + name: 'TypeError', | ||
| 102 | + code: 'ERR_INVALID_ARG_TYPE', | ||
| 103 | + message: 'The "options" argument must be of type object. ' + | ||
| 104 | + 'Received null' | ||
| 105 | + }); | ||
| 106 | + } | ||
| 92 | 107 | } | |
| 93 | 108 | ||
| 94 | 109 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments