[PATCH 5/5] crypt_make_salt(): try to use actual random bytes for salt generation
Steffen Nurpmeso
steffen at sdaoden.eu
Mon Apr 15 19:05:25 UTC 2024
Rasmus Villemoes wrote in
<20240415125628.780178-6-rasmus.villemoes at prevas.dk>:
|Instead of limiting the possible generated salts to 2^32 different
|ones, try to get some actual random bits and mix those in. Keep the
|old pseudo-random generation in place, so that even if
|open_read_close() fails or only returns a partial result, we're not
|doing any worse than previously.
|
|In fact, even with /dev/urandom being unavailable, this might still
|improve things a bit since whatever sort-of random content might be in
|the p buffer on entry is then mixed in.
By that time i thought (completely unrelated with your work) that
the code from miscutils/seedrng.c which has a more broad view of
where to get random data from should possibly be generalized.
There are more than just one match for /dev/urandom, and they all
want some random bits.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
More information about the busybox
mailing list