@@ -55,6 +55,20 @@ const { hasOpenSSL3 } = require('../common/crypto');
|
55 | 55 | code: 'ERR_INVALID_ARG_VALUE', |
56 | 56 | message: "The argument 'type' must be a supported key type. Received 'rsa2'" |
57 | 57 | }); |
| 58 | + |
| 59 | +for (const type of ['toString', 'constructor']) { |
| 60 | +assert.throws(() => generateKeyPairSync(type, {}), { |
| 61 | +name: 'TypeError', |
| 62 | +code: 'ERR_INVALID_ARG_VALUE', |
| 63 | +message: `The argument 'type' must be a supported key type. Received '${type}'` |
| 64 | +}); |
| 65 | + |
| 66 | +assert.throws(() => generateKeyPair(type, {}, common.mustNotCall()), { |
| 67 | +name: 'TypeError', |
| 68 | +code: 'ERR_INVALID_ARG_VALUE', |
| 69 | +message: `The argument 'type' must be a supported key type. Received '${type}'` |
| 70 | +}); |
| 71 | +} |
58 | 72 | } |
59 | 73 | |
60 | 74 | { |
|