dsprenkels / randombytes

A portable C library for generating cypto-secure random bytes
MIT License
96 stars 37 forks source link

Allow reads from /dev/urandom above SSIZE_MAX #5

Closed dsprenkels closed 6 years ago

dsprenkels commented 6 years ago

Before this change, reads from /dev/urandom may result in unspecified behaviour when the user supplies a buffer length that is greater than SSIZE_LEN. (https://linux.die.net/man/2/read)

This PR changes the way we read from /dev/urandom to read in chunks of at most SSIZE_MAX bytes.