-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardening #20
Comments
Thank you for the recommendations! The type check is fine, if the return value of What do you think about instead of throwing a warning, we add an option like |
Sounds good. You could also add something like:
So setting |
What is the runtime environment where that happens and that you care about? The odds are fair that it's an environment that is unsuitable for generating key material. |
Type checking
See:
keypair/index.js
Line 1020 in 9596418
Please change from:
to
For such critical lib there are too less type checkings in this lib, normally such critical libs should only work in strict mode! :-)
Fallbacks
Currently you're using too many fallbacks to prevent errors. Each fallback/weakening) should be optional. Examples in your code:
keypair/index.js
Line 984 in 9596418
Recommendation:
In future versions such fallbacks can be added, but just as option. E.g. if crypto is not available you could output an error with a security warning, how to disable required usage of crypto. Same with weaker entropy...
The text was updated successfully, but these errors were encountered: