Bug 165036 - openssl rand doesn't exit
Summary: openssl rand doesn't exit
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: openssl
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tomas Mraz
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-03 18:58 UTC by Sean Dilda
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-08-03 19:20:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sean Dilda 2005-08-03 18:58:49 UTC
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 19:20:29 UTC
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.