From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 24 14:47:08 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79F57106566B for ; Thu, 24 Dec 2009 14:47:08 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 0B86B8FC17 for ; Thu, 24 Dec 2009 14:47:07 +0000 (UTC) Received: by fxm27 with SMTP id 27so8368839fxm.3 for ; Thu, 24 Dec 2009 06:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=RTf7Rz7bEW3dPURrEN2dWwhhCvXJtifSn5pin+gx0+Y=; b=r4YPAkfHqNwcDl17g4hofww6DCPzbVQ2DNT8pkeNMrDxEZNwRJWtKeOTAale9lDXqe WjiC9/GhroCk+OAgKNsoatN+7j2DcoKTLK1VltKucFb0ROnv4sd2lSU/70pi9yTyHYEd HXBsx4Y8s/duIxhqofRO9VBzSTC41QamdSM14= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=nIXIP9K3RkdnARip7VdBI0uynHR+oU6ygZF8Mum8c4DLBECoOoTv9QSpsJzcFifm31 7H2J3KAIMQcrvOq8sJV8OEr5fY0D5yXG+TG/zJy/k/VtpYDO3L6AVzJu9vpn01Oq1lpe hGdwkWoiQGvQv5Im+Vw+R8dCp6k4xbCjW2TYw= Received: by 10.223.143.73 with SMTP id t9mr4929870fau.89.1261666026565; Thu, 24 Dec 2009 06:47:06 -0800 (PST) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id z10sm12840052fka.30.2009.12.24.06.47.05 (version=SSLv3 cipher=RC4-MD5); Thu, 24 Dec 2009 06:47:05 -0800 (PST) Date: Thu, 24 Dec 2009 14:47:03 +0000 From: RW To: freebsd-hackers@freebsd.org Message-ID: <20091224144703.482896eb@gumby.homeunix.com> In-Reply-To: <5a5b03660912240445x7df1498dt42e29d93105efebc@mail.gmail.com> References: <5a5b03660912240445x7df1498dt42e29d93105efebc@mail.gmail.com> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.5; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: yarrow random generator X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 14:47:08 -0000 On Thu, 24 Dec 2009 15:45:15 +0300 Paul Graphov wrote: > Hello guys, > > I've looked at FreeBSD 8.0 cryptographically secure pseudorandom > numbers generator and have a question. It looks like a bug but I'am > not sure. > > In file sys/dev/randomdev.c, function random_read: > > if (!random_systat.seeded) > error = (*random_systat.block)(flag); > > It blocks until PRNG is seeded. random_systat.seeded is initialized to 1 and it's never set to anything other than 1 I got impression that blocking was something that seemed like a good idea at the time, but fell-off half-way through coding. It's not a good idea to block /dev/random, without a separate urandom.