From: | epeisach@mit.edu |
Subject: | SVN Commit |
read_entropy_from_device() will loop in read until the desired number
of bytes are read from the device (/dev/random, /dev/urandom). I have
observed that for /dev/random, if there is not enough bits available
for reading - it will return a partial read. The code would loop in
this case, but never advance the location to place the new bytes -
hence the start of the buffer would be filled again - leaving the tail
end as stack garbage.
Commit By: epeisach
Revision: 19845
Changed Files:
U trunk/src/lib/crypto/prng.c
of bytes are read from the device (/dev/random, /dev/urandom). I have
observed that for /dev/random, if there is not enough bits available
for reading - it will return a partial read. The code would loop in
this case, but never advance the location to place the new bytes -
hence the start of the buffer would be filled again - leaving the tail
end as stack garbage.
Commit By: epeisach
Revision: 19845
Changed Files:
U trunk/src/lib/crypto/prng.c