Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/internal/crypto/keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
}

const nidOnlyKeyPairs = {
__proto__: null,

Check failure on line 184 in lib/internal/crypto/keygen.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Inconsistently quoted property '__proto__' found
'ed25519': EVP_PKEY_ED25519,
'ed448': EVP_PKEY_ED448,
'x25519': EVP_PKEY_X25519,
Expand Down
14 changes: 14 additions & 0 deletions test/parallel/test-crypto-keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ const { hasOpenSSL3 } = require('../common/crypto');
code: 'ERR_INVALID_ARG_VALUE',
message: "The argument 'type' must be a supported key type. Received 'rsa2'"
});

for (const type of ['toString', 'constructor']) {
assert.throws(() => generateKeyPairSync(type, {}), {
name: 'TypeError',
code: 'ERR_INVALID_ARG_VALUE',
message: `The argument 'type' must be a supported key type. Received '${type}'`
});

assert.throws(() => generateKeyPair(type, {}, common.mustNotCall()), {
name: 'TypeError',
code: 'ERR_INVALID_ARG_VALUE',
message: `The argument 'type' must be a supported key type. Received '${type}'`
});
}
}

{
Expand Down
Loading