wolfcw / libfaketime

libfaketime modifies the system time for a single application
https://github.com/wolfcw/libfaketime
GNU General Public License v2.0
2.71k stars 325 forks source link

/dev/[u]random #358

Closed ghost closed 2 years ago

ghost commented 2 years ago

"This functionality is intended to feed a sequence of deterministic, repeatable numbers to applications, which use getrandom(), instead of the random numbers provided by /dev/[u]random."

I just want to clarify that libfaketime will not work for /dev/urandom (I've tried it with the FAKE_RANDOM flag and it didn't work, but I just wanted to double-check that it is not intended to work.)

Many thanks, Ian

wolfcw commented 2 years ago

Not sure what you expect there. libfaketime can intercept system calls to getrandom(), but it does not intercept generic file I/O and treat read access to /dev/u?random somehow different. If you directly read from /dev/urandom, libfaketime has no effect at all.

dkg commented 2 years ago

As the person who motivated this feature initially, i agree with @wolfcw that there was never any intent to intercept /dev/random or /dev/urandom (or access to a USB hardware random generator, or any other source of entropy). It's just intercepting calls to the kernel's getrandom() syscall. I'm going to close this, but feel free to reopen and explain more if your question isn't answered here.