Bug 88988 - "openssl genrsa" hangs when -rand option used
Summary: "openssl genrsa" hangs when -rand option used
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: openssl
Version: 9
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-04-16 01:55 UTC by James Ralston
Modified: 2007-04-18 16:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-05-28 20:28:33 UTC
Embargoed:


Attachments (Terms of Use)

Description James Ralston 2003-04-16 01:55:35 UTC
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):
openssl-0.9.7a-5
(My test system is fully up-to-date w/respect to errata updates.)

How reproducible:
Always

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.)

Additional info:

This occurs on both 9 and 8.0; I haven't tested earlier releases yet.

Comment 1 Joe Orton 2003-05-28 20:28:33 UTC
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.


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