Open mrdomino opened 1 month ago
That is a good question! I think I started out just reading from /dev/urandom, then I added some platform-specific syscalls to get entropy. If there are better syscalls to use, then that should be considered a bug and it should be fixed.
The most important criteria is that the randomness source should not be able to fail.
On Fri 17. May 2024 at 01:27, Jōshin @.***> wrote:
Out of curiosity, any reason you're not using getentropy? It's in OS X since 10.12 as well as Linux since some years-old version of glibc.
— Reply to this email directly, view it on GitHub https://github.com/xfbs/passgen/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF775A2A3OCNUNH5PR7FNLZCU6FPAVCNFSM6AAAAABH3DZLMOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYDCNJUGE4DCMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
On Linux, getentropy is just a shim around getrandom. I'm not sure what the Darwin implementation does, but the OpenBSD man page seems to suggest that it just uses random(4) under the hood.
I guess using getentropy might slightly simplify the preprocessor conditionals in src/util/random.c
, but I don't have a strong preference one way or the other.
I can give that a shot!
Out of curiosity, any reason you're not using
getentropy
? It's in OS X since 10.12 as well as Linux since some years-old version of glibc.