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

Check for crypto/rand errors and ReadFull io.Readers #417

Merged
merged 2 commits into from Mar 16, 2023
Merged

Conversation

bwesterb
Copy link
Member

In practice crypto/rand.Read never returns an error, but that is not guaranteed. Check for those errors.

In contrast to crypto/rand.Reader, a user-provided io.Reader, might not fill the buffer without returning an error. Though marginal, we should deal with that corner-case as well.

@bwesterb bwesterb requested a review from armfazh March 16, 2023 16:35
In practice crypto/rand.Read never returns an error, but that is not
guaranteed. Check for those errors.

In contrast to crypto/rand.Reader, a user-provided io.Reader,
might not fill the buffer without returning an error. Though marginal,
we should deal with that corner-case as well.
New version panic()s if reads from crypto/rand fail.
@armfazh armfazh merged commit f4c0e87 into main Mar 16, 2023
10 checks passed
@armfazh armfazh deleted the bas/rand-read-err branch March 16, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants