summaryrefslogtreecommitdiff
path: root/test/parallel/test-crypto-certificate.js
Commit message (Collapse)AuthorAgeFilesLines
* crypto: refactoring internals, add WebCryptoJames M Snell2020-10-071-12/+40
| | | | | | | | | | | | | 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>
* errors: improve ERR_INVALID_ARG_TYPERuben Bridgewater2019-12-201-4/+5
| | | | | | | | | | | | | | 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: move spkac certs to fixtures/keys/Alex Aubuchon2019-06-101-5/+6
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/27962 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* Revert "test: move all test keys/certs under `test/fixtures/keys/`"Sam Roberts2019-06-051-6/+5
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/28083 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com>
* test: move spkac certs to fixtures/keys/Alex Aubuchon2019-06-051-5/+6
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/27962 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: add checkMethods function for CertificateDaniel Bevenius2018-04-251-17/+7
| | | | | | | | | | | This commit adds a checkMethods function so that it can be reused to avoid duplicating the same code for instance methods, and static methods of the Certificate object. PR-URL: https://github.com/nodejs/node/pull/20224 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* test: remove crypto.DEFAULT_ENCODING usageDaniel Bevenius2018-04-251-2/+0
| | | | | | | | | | This commit removes the usage of the deprectated crypto.DEFAULT_ENCODING. PR-URL: https://github.com/nodejs/node/pull/20221 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib: always show ERR_INVALID_ARG_TYPE received partRuben Bridgewater2018-03-251-26/+13
| | | | | | | | | | | | | | This makes a effort to make sure all of these errors will actually also show the received input. On top of that it refactors a few tests for better maintainability. It will also change the returned type to always be a simple typeof instead of special handling null. PR-URL: https://github.com/nodejs/node/pull/19445 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* crypto: migrate Certificate to internal/errorsJames M Snell2017-10-151-0/+34
| | | | | | | | | Move argument type checking to js, use internal/errors PR-URL: https://github.com/nodejs/node/pull/15756 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* crypto: refactor the crypto moduleJames M Snell2017-09-181-14/+36
| | | | | | | | | | | | | * Split single monolithic file into multiple * Make Certificate methods static * Allow randomFill(Sync) to use any ArrayBufferView * Use internal/errors throughout * Improve arg validation in Hash/Hmac * Doc updates PR-URL: https://github.com/nodejs/node/pull/15231 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
* test: begin normalizing fixtures useJames M Snell2017-08-071-5/+4
| | | | | | | | | | | | | | | | | | | | | Adds a new `../common/fixtures' module to begin normalizing `test/fixtures` use. Our test code is a bit inconsistent with regards to use of the fixtures directory. Some code uses `path.join()`, some code uses string concats, some other code uses template strings, etc. In mnay cases, significant duplication of code is seen when accessing fixture files, etc. This updates many (but by no means all) of the tests in the test suite to use the new consistent API. There are still many more to update, which would make an excelent Code-n-Learn exercise. PR-URL: https://github.com/nodejs/node/pull/14332 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* test: simplify test skippingVse Mozhet Byt2017-07-041-5/+3
| | | | | | | | | | | | * Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
* test: reduce string concatenationsVse Mozhet Byt2017-05-051-3/+3
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
* meta: restore original copyright headerJames M Snell2017-03-101-0/+21
| | | | | | | | | | | | | | | A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
* test: improve crypto coverageAkito Ito2017-02-151-0/+3
| | | | | | | | | | | * call Certificate function directly * check exception when sign option is undefined PR-URL: https://github.com/nodejs/node/pull/11280 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: use eslint to fix var->const/letGibson Fahnestock2017-01-111-4/+4
| | | | | | | | | Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* test: use const for all require() callscjihrig2017-01-021-4/+4
| | | | | PR-URL: https://github.com/nodejs/node/pull/10550 Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: refactor test-crypto-certificateJosh Mays2016-12-041-6/+6
| | | | | | | | | assert.equal() -> assert.strictEqual() PR-URL: https://github.com/nodejs/node/pull/9911 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* test: abstract skip functionality to commonJeremiah Senkpiel2016-05-121-1/+1
| | | | | | | | | | The tap skipping output is so prevalent yet obscure in nature that we ought to move it into it's own function in test/common.js PR-URL: https://github.com/nodejs/node/pull/6697 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
* tools: disallow mixed spaces and tabs for indentsRich Trott2016-02-091-6/+8
| | | | | | | | | Enable eslint rule disallowing mixing tabs and spaces for indentation. Modify the one file that had been mixing tabs and spaces. PR-URL: https://github.com/nodejs/node/pull/5135 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* test: remove unused modulesRich Trott2016-01-011-1/+0
| | | | | | | | | | Many tests use require() to import modules that subsequently never gets used. This removes those imports and, in a few cases, removes other unused variables from tests. PR-URL: https://github.com/nodejs/node/pull/4475 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
* test: changing process.exit to return while skipping testsSakthipriyan Vairamani2015-07-201-1/+1
| | | | | | | | | This patch uses `return` statement to skip the test instead of using `process.exit` call. PR-URL: https://github.com/nodejs/io.js/pull/2109 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
* test: enable linting for testsRoman Reiss2015-05-191-0/+1
| | | | | | | | | | | | Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* test: refactor all tests that depends on cryptoJohan Bergström2015-03-051-0/+4
| | | | | | | | | | | we had a few ways versions of looking for support before executing a test. this commit unifies them as well as add the check for all tests that previously lacked them. found by running `./configure --without-ssl && make test`. also, produce tap skip output if the test is skipped. PR-URL: https://github.com/iojs/io.js/pull/1049 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
* Remove excessive copyright/license boilerplateisaacs2015-01-121-21/+0
| | | | | | | The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
* test: split test in parallel/sequentialFedor Indutny2014-12-171-0/+54
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139