Subject: Re: /dev/random without random sources blocking forever?
To: Garrett D'Amore <garrett_damore@tadpole.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 08/21/2006 13:38:39
--t0UkRYy7tHLRMCai
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Mon, Aug 21, 2006 at 01:20:59PM -0700, Garrett D'Amore wrote:
> Jorge Acereda Maci? wrote:
> > Hi,
> >
> > I've noticed that reading from /dev/random without attaching a random
> > source (or specifying only a source of type RND_TYPE_NET) blocks
> > forever. Is this the intended behaviour?
> >
> > I'm running -current for ofppc which ATM doesn't attach any random
> > sources.
>=20
> Yes, without random sources, you can't get any entropy bits. Solution
> is to add sources for entropy. Alternatively, use /dev/urandom which
> gives back data without blocking, but might not be cryptographically robu=
st.
If you don't have ANY entropy sources, wouldn't it be better to error out=
=20
on the read? Yes, if you don't have any entropy sources, you shouldn't use=
=20
/dev/random. But "Don't do that" seems a better response than blocking=20
forever.
Take care,
Bill
--t0UkRYy7tHLRMCai
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)
iD8DBQFE6hnPWz+3JHUci9cRAu5wAJ9x0Dg+aMHwratEF+3bGOS+omL04wCffnUl
vwJItmW4PrpyItVemCI2+iE=
=FfxL
-----END PGP SIGNATURE-----
--t0UkRYy7tHLRMCai--