diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2019-04-04 15:07:51 -0700 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2019-04-08 09:44:36 -0700 |
commit | 0911e88056618766093a086fe643949eab430fa5 (patch) | |
tree | 679004cb4a1ff0bf1f7dc4ce5d62e0f696fd4cb0 /test/parallel/test-crypto-keygen.js | |
parent | f96a6608eb63f4c6710c9c2078916655e32cf003 (diff) | |
download | node-new-0911e88056618766093a086fe643949eab430fa5.tar.gz |
crypto: fix rsa key gen with non-default exponent
EVP_PKEY_CTX_set_rsa_keygen_pubexp() accepts ownership of the exponent
on success, so do not free it.
Fixes: https://github.com/nodejs/node/issues/27087
PR-URL: https://github.com/nodejs/node/pull/27092
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-crypto-keygen.js')
-rw-r--r-- | test/parallel/test-crypto-keygen.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index d327c7a078..07a0a18c30 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -87,7 +87,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // To make the test faster, we will only test sync key generation once and // with a relatively small key. const ret = generateKeyPairSync('rsa', { - publicExponent: 0x10001, + publicExponent: 3, modulusLength: 512, publicKeyEncoding: { type: 'pkcs1', @@ -160,7 +160,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // Now do the same with an encrypted private key. generateKeyPair('rsa', { - publicExponent: 0x10001, + publicExponent: 0x1001, modulusLength: 512, publicKeyEncoding, privateKeyEncoding: { |