dsprenkels / randombytes

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

linux: Implement /proc/.../entropy_avail fallback #19

Closed dsprenkels closed 5 years ago

dsprenkels commented 5 years ago

This commit implements a fallback for the /dev/urandom entropy estimate retrieval, for when the ioctl on /dev/random fails (see also issue #17). We still poll on /dev/random, but instead of ioctl'ing, we read from /proc/sys/kernel/random/entropy_avail to get the entropy count.

This PR updates test_issue_17 accordingly.

Fixes issue #17.