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

GenerateRandomKey: do not swallow errors #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 8, 2023

  1. GenerateRandomKey: do not swallow errors

    The requirement to check for nil returns is so unexpected that even
    other Gorilla libraries get it wrong:
    
    <https://github.com/gorilla/sessions/blob/3eed1c4ffcde6f23b6f88068c63c1ef6190df331/store.go#L225>
    
    Since a malfunction of the system random number generator is pretty
    unrecoverable for most security-sensitive applications, I consider it
    fine to use a panic here. Most callers will have no better option than
    to just die anyway. If callers need a more specific behavior, they can
    implement these three lines of code themselves with application-specific
    error handling.
    majewsky committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    c2b1c19 View commit details
    Browse the repository at this point in the history