Skip to content
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

[FEATURE] Change signature of GenerateRandomKey #84

Open
1 task done
SuperSandro2000 opened this issue Nov 8, 2023 · 0 comments
Open
1 task done

[FEATURE] Change signature of GenerateRandomKey #84

SuperSandro2000 opened this issue Nov 8, 2023 · 0 comments

Comments

@SuperSandro2000
Copy link

Is there an existing feature request for this?

  • I have searched the existing feature requests

Is your feature request related to a problem? Please describe.

It is not very secure by default that people are expected to check if GenerateRandomKey returns nil on an error and I've just made a friend aware of this that he missed checking it.

Describe the solution that you would like.

I would like to change the signate of GenerateRandomKey to (length int) ([]byte, err) to allow proper error checking and forwarding.

Describe alternatives you have considered.

None

Anything else?

I know that the error that could be created here is rare and unrealistic but cryptography that use nil for their secret on an error is pretty bad.

Also maybe this warrants a minor or major bump, not sure how strict the project is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant