Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AK: Prevent passing lengths greater than 256 to getentropy()
From the getentropy() man page, "The maximum permitted value for the length argument is 256". Several of our tests were passing lengths of several thousand bytes, causing getentropy() to fail with EIO, which we were completely ignoring. This caused these tests to only test long sequences of 0x00. We now loop over the provided buffer to fill it 256 bytes at a time. If getentropy() fails for any reason, we fall back to the default method of filling it with one random byte at a time.
- Loading branch information