Skip to content

Commit 3351caa

Browse files
crypto: add __proto__ null to nidOnlyKeyPairs
Signed-off-by: Jonathan Lopes <[email protected]>
1 parent 4776784 commit 3351caa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/internal/crypto/keygen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const {
44
FunctionPrototypeCall,
55
ObjectDefineProperty,
6-
ObjectPrototypeHasOwnProperty,
76
SafeArrayIterator,
87
} = primordials;
98

@@ -182,6 +181,7 @@ function parseKeyEncoding(keyType, options = kEmptyObject) {
182181
}
183182

184183
const nidOnlyKeyPairs = {
184+
__proto__: null,
185185
'ed25519': EVP_PKEY_ED25519,
186186
'ed448': EVP_PKEY_ED448,
187187
'x25519': EVP_PKEY_X25519,
@@ -357,7 +357,7 @@ function createJob(mode, type, options) {
357357
...encoding);
358358
}
359359
default: {
360-
if (!ObjectPrototypeHasOwnProperty(nidOnlyKeyPairs, type)) {
360+
if (nidOnlyKeyPairs[type] === undefined) {
361361
throw new ERR_INVALID_ARG_VALUE('type', type, 'must be a supported key type');
362362
}
363363
return new NidKeyPairGenJob(mode, nidOnlyKeyPairs[type], ...encoding);

0 commit comments

Comments
 (0)