Red Hat Bugzilla – Bug 88988
"openssl genrsa" hangs when -rand option used
Last modified: 2007-04-18 12:53:06 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
Description of problem:
The "openssl genrsa" command consistently hangs if the -rand option is used.
Specifically, it goes into a (seemingly) never-ending malloc/read loop.
(Using the -rand option is desirable, because by default, openssl gathers
entropy from /dev/urandom instead of /dev/random.)
Version-Release number of selected component (if applicable):
(My test system is fully up-to-date w/respect to errata updates.)
Steps to Reproduce:
openssl genrsa -rand /dev/urandom 1024
Actual Results: The openssl command goes into a malloc/read loop.
Expected Results: The openssl command should have generated a certificate to
stdout. (Removing the "-rand /dev/urandom" yields the expected results.)
This occurs on both 9 and 8.0; I haven't tested earlier releases yet.
Yes, that would be the expected behaviour. OpenSSL will try to seed the PRNG
with the entire contents of the file specified with the -rand option. Since
/dev/random never returns EOF, this will never terminate.