From: Lutz Jaenicke <[EMAIL PROTECTED]>

Lutz.Jaenicke> On Fri, Jan 05, 2001 at 09:49:56PM +0100, Richard Levitte - VMS Whacker 
wrote:
Lutz.Jaenicke> I don't know how select() would act on a regular
Lutz.Jaenicke> file. /dev/random (and/or /dev/urandom) are no regular
Lutz.Jaenicke> files, so we could first call stat() and only continue
Lutz.Jaenicke> when S_ISCHR() is true (character device).

My question about regular files was with the thought that one could
hack RAND_load_file() with something similar.

Lutz.Jaenicke> > If select() is useable before read() for a standard
Lutz.Jaenicke> > file, then it would perhaps be possible to use
Lutz.Jaenicke> > possibly blocking devices like /dev/random and still
Lutz.Jaenicke> > not get impatient developpers on our throats :-).
Lutz.Jaenicke> Hmm, I would consider using non-blocking
Lutz.Jaenicke> reads. Select() does not know how many bytes you intend
Lutz.Jaenicke> to read, so it will return "available" if just one byte
Lutz.Jaenicke> is there and the second byte will block. Of course we
Lutz.Jaenicke> could read byte-per-byte...

That is a solution, but if we want to do reads with a timeout (say
20ms), that would mean a loop with a polling read with a definitely
higher frequency than we wold get with a select().  On the other hand,
non-blocking doesn't stop us from select()ing, does it?  Hmm, perhaps
it's a thought after all...

Lutz.Jaenicke> This brings me to related point. Would it make sense to
Lutz.Jaenicke> define a "default" place to look for an egd-socket? I
Lutz.Jaenicke> had several contacts with people using my prngd (egd
Lutz.Jaenicke> replacement) that installed prngd and did expect
Lutz.Jaenicke> openssl to magically find it.

That would be a good idea, I think.  Personally, I'd say
/etc/.egd-socket rather than /etc/egd-socket.  This removes some
possibilities for "accidents" as well.  Yes, this is security by
obscurity...

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
Redakteur@Stacken   \      SWEDEN       \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to