Skip to content

[FEATURE] Change signature of GenerateRandomKey #84

@SuperSandro2000

Description

@SuperSandro2000

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions