Bug 165036 - openssl rand doesn't exit
openssl rand doesn't exit
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: openssl (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Mraz
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-03 14:58 EDT by Sean Dilda
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-03 15:20:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sean Dilda 2005-08-03 14:58:49 EDT
If you run 'openssl rand -rand /dev/urandom -out /tmp/some.file 2048', then
openssl will chew up 100% and never exit.  From an strace, it seems to be
continually reading from /dev/urandom.

If you run 'openssl rand -out /tmp/some.file 2048', then it runs without a problem.
Comment 1 Tomas Mraz 2005-08-03 15:20:29 EDT
That's perfectly fine, because the -rand option means to read a file as a seed
to the random generator. So it tries to read the whole file and seed it into the
rng. However /dev/urandom is not a regular file but a device which can be read
forever so it openssl does it because it doesn't distinguish between a file an a
device.

If you want to obtain 2048 random bytes use 'dd if=/dev/urandom
of=/tmp/some.file count=1 bs=2048'

Note You need to log in before you can comment on or make changes to this bug.