Skip to content

Conversation

@nbougalis
Copy link

Per its documentation, noise_rand_bytes returns "cryptographically-strong random bytes from the operating system."

On Windows, the existing implementation of the function does not check that the CryptGenRandom API succeeds. While failure is unlikely, it is prudent to actually check.

If merged this commit will cause the process to exit if the function is not able to generate the requested number of random bytes; the code also checks that the provided buffer is non-null and that the number of bytes requested is non-zero.

Per its documentation, `noise_rand_bytes` returns "cryptographically-strong
random bytes from the operating system."

On Windows, the existing implementation of the function does not check that
the `CryptGenRandom` API succeeds. While failure is unlikely, it is prudent
to actually check.

If merged this commit will cause the process to exit if the function is not
able to generate the requested number of random bytes; the code also checks
that the provided buffer is non-null and that the number of bytes requested
is non-zero.
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.

1 participant