* Check if node version supports asymmetricKeyDetails
* Validate algorithms for ec key type
* Rename variable
* Rename function
* Add early return for symmetric keys
* Validate algorithm for RSA key type
* Validate algorithm for RSA-PSS key type
* Check key types for EdDSA algorithm
* Rename function
* Move validateKey function to module
* Convert arrow to function notation
* Validate key in verify function
* Simplify if
* Convert if to switch..case
* Guard against empty key in validation
* Remove empty line
* Add lib to check modulus length
* Add modulus length checks
* Validate mgf1HashAlgorithm and saltLength
* Check node version before using key details API
* Use built-in modulus length getter
* Fix Node version validations
* Remove duplicate validateKey
* Add periods to error messages
* Fix validation in verify function
* Make asymmetric key validation the latest validation step
* Change key curve validation
* Remove support for ES256K
* Fix old test that was using wrong key types to sign tokens
* Enable RSA-PSS for old Node versions
* Add specific RSA-PSS validations on Node 16 LTS+
* Improve error message
* Simplify key validation code
* Fix typo
* Improve error message
* Change var to const in test
* Change const to let to avoid reassigning problem
* Improve error message
* Test incorrect private key type
* Rename invalid to unsupported
* Test verifying of jwt token with unsupported key
* Test invalid private key type
* Change order of object parameters
* Move validation test to separate file
* Move all validation tests to separate file
* Add prime256v1 ec key
* Remove modulus length check
* WIP: Add EC key validation tests
* Fix node version checks
* Fix error message check on test
* Add successful tests for EC curve check
* Remove only from describe
* Remove `only`
* Remove duplicate block of code
* Move variable to a different scope and make it const
* Convert allowed curves to object for faster lookup
* Rename variable
* Change variable assignment order
* Remove unused object properties
* Test RSA-PSS happy path and wrong length
* Add missing tests
* Pass validation if no algorithm has been provided
* Test validation of invalid salt length
* Test error when signing token with invalid key
* Change var to const/let in verify tests
* Test verifying token with invalid key
* Improve test error messages
* Add parameter to skip private key validation
* Replace DSA key with a 4096 bit long key
* Test allowInvalidPrivateKeys in key signing
* Improve test message
* Rename variable
* Add key validation flag tests
* Fix variable name in Readme
* Change private to public dsa key in verify
* Rename flag
* Run EC validation tests conditionally
* Fix tests in old node versions
* Ignore block of code from test coverage
* Separate EC validations tests into two different ones
* Add comment
* Wrap switch in if instead of having an early return
* Remove unsupported algorithms from asymmetric key validation
* Rename option to allowInvalidAsymmetricKeyTypes and improve Readme
* 9.0.0
* adding migration notes to readme
* adding changelog for version 9.0.0
Co-authored-by: julienwoll <[email protected]>
* fix!: Disable use of weak RSA key sizes for asymmetric algorithms
Added checks to prevent invalid secrets from being used with the HS*** algorithms when signing and verifying
Added checks to prevent the use of insecure asymmetric key sizes except when explicitly overriden via options
Prevented Buffers containing malicious objects from being used as key material.
BREAKING CHANGE: Requires node 12.x or later to allow use of `KeyObject`
* Updating Node version in package.json
Updated Node version from 0.12 to 1.4 in package.json engines
* Updated node version
Updated Node version from 0.12 to 4 in package.json Engines Spec
Fixes Issue #509
* Add extension to ESLint config file
The .eslintrc file without an extension was deprecated a few years ago,
so this change renames the file to add the required extension.
See: https://github.com/eslint/eslint/commit/c9a8883d450d63a8d044a9e66d275f5b1973a3ba
* Add ESLint to package.json
This change adds ESLint as a dev-dependency and adds a lint script that
will run ESLint.
* Complete switch from JSHint to ESLint
Convert all the JSHint rules to the ESLint equivalents where possible.
The no-undef rule in ESLint caught a few cases of undefined usages in
the tests, so they were also fixed.
* Add a .eslintignore file
The HTML coverage report is currently being linted, which causes a lot
if invalid linting errors. This change adds a ignore file to ensure these
files are properly skipped during linting.
* Introduction of the secret callback
Without the more contentious 'none'-changes
* Removed some spaces...
I should really add a editor.config and eslint to this project ;-)
* Removed xtend as a dependency, as the native Object.Assign can do this as well
* Removed xtend as a dependency, as the native Object.Assign can do this as well
* Resolve feedback from review
* Added extra test and fixed the associated bug
* The return of the header
* Forgot to change this one as well... Sorry bout that
* Updated the readme and made the if-statements consistent
* Space; The final frontier
Bump node-jws version number from 3.1.3 -> 3.1.4.
Version 3.1.3 has a dependency on base64url ~1.0.4 which is throwing the
NodeJS Buffer DeprecationWarning. version 3.1.4 pulls in base64url ^2.0.0
which address the issue.