summaryrefslogtreecommitdiff
path: root/test/parallel/test-crypto-keygen.js
Commit message (Collapse)AuthorAgeFilesLines
* src: replace impossible THROW with CHECKTobias Nießen2023-03-221-1/+1
| | | | | | | | | | The JS layer already verifies that divisor_bits is either a non-negative 32-bit signed integer or null/undefined, in which case it passes -1 to the C++ layer. In either case, the C++ layer receives a 32-bit signed integer greater than or equal to -1. PR-URL: https://github.com/nodejs/node/pull/47168 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* test: cover publicExponent validation in OpenSSLTobias Nießen2023-02-181-0/+11
| | | | | | | | | | | Add a test case for public exponents that are invalid according to some internal OpenSSL validation logic, but which are accepted by node's own validation logic. PR-URL: https://github.com/nodejs/node/pull/46632 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
* crypto: return correct bit length in KeyObject's asymmetricKeyDetailsFilip Skokan2023-01-071-0/+28
| | | | | | PR-URL: https://github.com/nodejs/node/pull/46106 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* crypto: improve RSA-PSS digest error messagesTobias Nießen2022-08-221-2/+2
| | | | | | | | | | | md and mgf1_md are internal variable names and should not appear in JS error messages. Also include the invalid digest name in the error message. PR-URL: https://github.com/nodejs/node/pull/44307 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* test: add coverage for invalid RSA-PSS digestsTobias Nießen2022-08-201-0/+18
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/44271 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* crypto: add CFRG curves to Web Crypto APIFilip Skokan2022-06-041-16/+0
| | | | PR-URL: https://github.com/nodejs/node/pull/42507 Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* lib: refactor `validateInt32` and `validateUint32`mawaregetsuka2022-05-221-28/+0
| | | | | | PR-URL: https://github.com/nodejs/node/pull/43071 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* crypto: cleanup validationMohammed Keyvanzadeh2022-04-041-43/+184
| | | | | | | | Many of the validations could be simplified and cleaned up by using validators and to keep consistency. PR-URL: https://github.com/nodejs/node/pull/39841 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* test: fix comments in test filesDaeyeon Jeong2022-03-311-1/+1
| | | | | | | | This commit fixes typos found in test files. PR-URL: https://github.com/nodejs/node/pull/42536 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* test,crypto: add and update empty passphrase regression testsDarshan Sen2022-03-191-33/+54
| | | | | | | | | Refs: https://github.com/openssl/openssl/pull/17507 Refs: https://github.com/nodejs/node/issues/41428 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42319 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* lib: replace validator and errorMohammed Keyvanzadeh2022-02-051-3/+2
| | | | | | | | | | Refs: https://github.com/nodejs/node/pull/41660 PR-URL: https://github.com/nodejs/node/pull/41678 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: update OpenSSL3 error messages for 3.0.0+quicDaniel Bevenius2021-09-131-2/+4
| | | | | | | | | | | | This commit updates two OpenSSL 3.0.0 error messages required for OpenSSL 3.0.0+quic. PR-URL: https://github.com/nodejs/node/pull/40093 Refs: https://github.com/nodejs/build/pull/2759 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
* crypto: fix RSA-PSS default saltLengthTobias Nießen2021-09-091-0/+37
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/39999 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
* crypto: fix default MGF1 hash for OpenSSL 3Tobias Nießen2021-09-091-0/+22
| | | | | | | | Refs: https://github.com/nodejs/node/pull/39999 PR-URL: https://github.com/nodejs/node/pull/40031 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
* crypto: add rsa-pss keygen parametersFilip Skokan2021-09-051-15/+68
| | | | | PR-URL: https://github.com/nodejs/node/pull/39927 Reviewed-By: James M Snell <jasnell@gmail.com>
* crypto: fix regression in RSA-PSS keygenTobias Nießen2021-09-011-0/+23
| | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/39936 Refs: https://github.com/nodejs/node/pull/35093 PR-URL: https://github.com/nodejs/node/pull/39937 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: use `assert.match` instead of `regexp.test`Michaël Zasso2021-08-311-19/+19
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/39928 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
* crypto: add RSA-PSS params to asymmetricKeyDetailsTobias Nießen2021-08-291-2/+8
| | | | | | | | | Fixes: https://github.com/nodejs/node/issues/39837 Refs: https://github.com/openssl/openssl/pull/10568 PR-URL: https://github.com/nodejs/node/pull/39851 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
* crypto: fix `generateKeyPair` with encoding 'jwk'himself652021-07-261-0/+114
| | | | | | | | Fixes: https://github.com/nodejs/node/issues/39205 PR-URL: https://github.com/nodejs/node/pull/39319 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: update OpenSSL3 error messages for beta-1Daniel Bevenius2021-07-211-4/+2
| | | | | | | | | | | This commit updates error messages that have changed while these tests were disabled. PR-URL: https://github.com/nodejs/node/pull/39437 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* Revert "test: skip tests for openssl-3.0.0-alpha15"Daniel Bevenius2021-07-211-3/+0
| | | | | | | | | | This reverts commit 2ff93c8975508736bbc07b98cf84f47d68b47201. PR-URL: https://github.com/nodejs/node/pull/39437 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: skip tests for openssl-3.0.0-alpha15Daniel Bevenius2021-05-061-0/+3
| | | | | | | | | | | | | | | This commit skips some test when OpenSSL 3.0.0-alpha15 is used as there is an issue that causes them to fail. This is only a temp solution until there is new OpenSSL release. Fixes: https://github.com/nodejs/node/issues/38373 PR-URL: https://github.com/nodejs/node/pull/38451 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: update OpenSSL 3.0.0-alpha15 error messagesDaniel Bevenius2021-05-061-5/+10
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/38451 Fixes: https://github.com/nodejs/node/issues/38373 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* crypto: fix generateKeyPair type checksNitzan Uziely2021-04-261-1/+76
| | | | | | | | | | | | | | | Change saltLength, divisorLength, primeLength and generator checks in generateKeyPair to int32 from uint32, to align with c++ code. fixes: https://github.com/nodejs/node/issues/38358 PR-URL: https://github.com/nodejs/node/pull/38364 Fixes: https://github.com/nodejs/node/issues/38358 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: update parallel/test-crypto-keygen for OpenSSL 3Richard Lau2021-04-071-2/+4
| | | | | | | | | OpenSSL 3 returns a different error code. PR-URL: https://github.com/nodejs/node/pull/38136 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
* src: fix error handling for CryptoJob::ToResultTobias Nießen2021-04-021-0/+31
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/37076 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: prepare for consistent comma-dangle lint ruleRich Trott2021-04-011-1/+1
| | | | | | | | | Make changes so that tests will pass when the comma-dangle settings applied to the rest of the code base are also applied to tests. PR-URL: https://github.com/nodejs/node/pull/37930 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
* test: add OpenSSL 3.0 checks to test-crypto-keygenDaniel Bevenius2021-03-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently test-crypto-keygen.js fails when dynamically linking against OpenSSL 3.0 which the following error: === debug test-crypto-keygen === Path: parallel/test-crypto-keygen node:assert:901 throw newErr; ^ AssertionError [ERR_ASSERTION]: ifError got unwanted exception: error:05000072:dsa routines::bad ffc parameters at DsaKeyPairGenJob.<anonymous> (/nodejs/openssl/test/common/index.js:342:12) at DsaKeyPairGenJob.<anonymous> (/openssl/test/common/index.js:379:15) at DsaKeyPairGenJob.job.ondone (node:internal/crypto/keygen:77:23) { generatedMessage: false, code: 'ERR_ASSERTION', actual: [Error: error:05000072:dsa routines::bad ffc parameters], expected: null, operator: 'ifError' } Command: node /nodejs/openssl/test/parallel/test-crypto-keygen.js This commit adds a check and adjusts the modulus length when linking against OpenSSL 3.0. PR-URL: https://github.com/nodejs/node/pull/37860 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* src,test: support dynamically linking OpenSSL 3.0Daniel Bevenius2021-03-161-28/+43
| | | | | | | | | | | | | | | This commit enables node to dynamically link against OpenSSL 3.0. The motivation for opening this PR even though OpenSSL 3.0 has not been released yet is to allow a nightly CI job to be created. This will allow us stay on top of changes required for OpenSSL 3.0, and also to make sure that changes to node crypto do not cause issues when linking to OpenSSL 3.0. PR-URL: https://github.com/nodejs/node/pull/37669 Refs: https://github.com/nodejs/node/issues/29817 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
* crypto: generateKeyPair('ec') should not support NODE-ED* and NODE-X*Filip Skokan2021-01-271-0/+16
| | | | | | | | | Fixes https://github.com/nodejs/node/issues/37055 PR-URL: https://github.com/nodejs/node/pull/37063 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* crypto: add keyObject.asymmetricKeyDetails for asymmetric keysFilip Skokan2021-01-141-4/+77
| | | | | | | | | | | | | | | | | | This API exposes key details. It is conceptually different from the previously discussed keyObject.fields property since it does not give access to information that could compromise the security of the key, and the obtained information cannot be used to uniquely identify a key. The intended purpose is to determine "security properties" of keys, e.g. to generate a new key pair with the same parameters, or to decide whether a key is secure enough. closes #30045 PR-URL: https://github.com/nodejs/node/pull/36188 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
* crypto: pass empty passphrases to OpenSSL properlyTobias Nießen2020-11-041-0/+39
| | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/35898 PR-URL: https://github.com/nodejs/node/pull/35914 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* test: add common.mustSucceedTobias Nießen2020-10-171-52/+18
| | | | | | PR-URL: https://github.com/nodejs/node/pull/35086 Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* crypto: refactoring internals, add WebCryptoJames M Snell2020-10-071-6/+7
| | | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/678 Refs: https://github.com/nodejs/node/issues/26854 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35093 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODINGDenys Otrishko2020-09-111-61/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will be a start to generalize all argument validation errors. As currently we throw ARG/OPT, OUT_OF_RANGE, and other more specific errors. The OPT errors didn't bring much to the errors as it's just another variant of ARG error which is sometimes more confusing (some of our code used OPT errors to denote just argument validation errors presumably because of similarity of OPT to 'option' and not 'options-object') and they don't specify the name of the options object where the invalid value is located. Much better approach would be to just specify path to the invalid value in the name of the value as it is done in this PR (i.e. 'options.format', 'options.publicKey.type' etc) Also since this decreases a variety of errors we have it'd be easier to reuse validation code across the codebase. Refs: https://github.com/nodejs/node/pull/31251 Refs: https://github.com/nodejs/node/pull/34070#discussion_r467251009 Signed-off-by: Denys Otrishko <shishugi@gmail.com> PR-URL: https://github.com/nodejs/node/pull/34682 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* errors: improve ERR_INVALID_OPT_VALUE errorDenys Otrishko2020-08-141-13/+24
| | | | | | | | | | * use util.inspect for value presentation * allow to optionally specify error reason PR-URL: https://github.com/nodejs/node/pull/34671 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
* crypto: assign and use ERR_CRYPTO_UNKNOWN_CIPHERTobias Nießen2020-01-231-0/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31437 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* errors: make use of "cannot" consistentTobias Nießen2020-01-221-1/+1
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31420 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* crypto: add DH support to generateKeyPairTobias Nießen2020-01-211-0/+69
| | | | | | | | This allows using the generateKeyPair API for DH instead of the old stateful DH APIs. PR-URL: https://github.com/nodejs/node/pull/31178 Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
* test: refactor common.expectsErrorRuben Bridgewater2019-12-311-74/+74
| | | | | | | | | | | | | | | | | | | | | | | This completely refactors the `expectsError` behavior: so far it's almost identical to `assert.throws(fn, object)` in case it was used with a function as first argument. It had a magical property check that allowed to verify a functions `type` in case `type` was passed used in the validation object. This pattern is now completely removed and `assert.throws()` should be used instead. The main intent for `common.expectsError()` is to verify error cases for callback based APIs. This is now more flexible by accepting all validation possibilites that `assert.throws()` accepts as well. No magical properties exist anymore. This reduces surprising behavior for developers who are not used to the Node.js core code base. This has the side effect that `common` is used significantly less frequent. PR-URL: https://github.com/nodejs/node/pull/31092 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* errors: improve ERR_INVALID_ARG_TYPERuben Bridgewater2019-12-201-6/+6
| | | | | | | | | | | | | | ERR_INVALID_ARG_TYPE is the most common error used throughout the code base. This improves the error message by providing more details to the user and by indicating more precisely which values are allowed ones and which ones are not. It adds the actual input to the error message in case it's a primitive. If it's a class instance, it'll print the class name instead of "object" and "falsy" or similar entries are not named "type" anymore. PR-URL: https://github.com/nodejs/node/pull/29675 Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: rsa-pss generateKeyPairSync invalid option hashEvgenii Shchepotev2019-05-301-0/+14
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27883 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* test: add test cases for paramEncoding 'explicit'oksana2019-05-301-0/+92
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27900 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: add test case for checking typeof mgf1HashLevin Eugene2019-05-291-0/+36
| | | | | | | | | | | | | | add test case to cover uncovered test mgf1Hash param of generateKeyPair, check typeof PR-URL: https://github.com/nodejs/node/pull/27892 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* test: ec2 generateKeyPairSync invalid parameter encodingRuwan Geeganage2019-04-161-0/+23
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/27212 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* crypto: fix rsa key gen with non-default exponentSam Roberts2019-04-081-2/+2
| | | | | | | | | | | | | 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>
* crypto: add support for RSA-PSS keysTobias Nießen2019-04-081-11/+60
| | | | | | | | | | | This commit adds support for RSA-PSS keys, including - KeyObjects of type rsa-pss, - key pair generation for RSA-PSS, and - signing and verification using RSA-PSS keys. PR-URL: https://github.com/nodejs/node/pull/26960 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
* crypto: decode missing passphrase errorsTobias Nießen2019-03-301-14/+30
| | | | | | | | | | | | When a user attempts to load an encrypted key without supplying a passphrase, a cryptic OpenSSL error is thrown. This change intercepts the OpenSSL error and throws a nice error code instead. PR-URL: https://github.com/nodejs/node/pull/25208 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
* benchmark,doc,lib: capitalize more commentsRuben Bridgewater2019-03-271-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/26849 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
* crypto: add support for x25119 and x448 KeyObjectsFilip Skokan2019-03-251-2/+3
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/26774 Refs: https://github.com/nodejs/node/issues/26626 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>