Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2012 10:57:47 -0700
From:      David O'Brien <obrien@FreeBSD.org>
To:        Dag-Erling =?unknown-8bit?B?U23DuHJncmF2?= <des@des.no>
Cc:        Arthur Mesh <arthurmesh@gmail.com>, freebsd-security@FreeBSD.org, Doug Barton <dougb@FreeBSD.org>, freebsd-rc@FreeBSD.org, Mark Murray <markm@FreeBSD.org>
Subject:   Re: svn commit: r239569 - head/etc/rc.d
Message-ID:  <20120906175747.GC13179@dragon.NUXI.org>
In-Reply-To: <86y5kpcqc4.fsf@ds4.des.no>
References:  <201208221843.q7MIhLU4077951@svn.freebsd.org> <5043DBAF.40506@FreeBSD.org> <86y5kpcqc4.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 05, 2012 at 01:37:15AM +0200, Dag-Erling Smrgrav wrote:
> Speaking of rc.d and entropy, is the following code in /etc/rc.d/sshd
> really necessary?
> 	seeded=`sysctl -n kern.random.sys.seeded 2>/dev/null`
> 	if [ "x${seeded}" != "x" ] && [ ${seeded} -eq 0 ] ; then
> 		warn "Setting entropy source to blocking mode."
...
> 		echo "Just hit <enter> for fast+insecure startup."
> 		echo "===================================================="
> 		sysctl kern.random.sys.seeded=0 2>/dev/null
> 		read -t ${timeout} junk
> 		echo "${junk}" `sysctl -a` `date` > /dev/random

Likely this is inspired by 3.2 'How Compromises are Exploited',
'Compromise of High-Value Keys Generated From Compromised Key' paragraph.

    If the key that is being generated is vary valuable, the harm to the
    system owner can be very large.
    ...
    When we are about to generate a very valuable key, it is preferable
    to have what ever extra entropy there is in the PRNG's key.
    Therefore, the user can request en explicit reseed of the generator.

Now that we have 'postrandom' possibly we should utilize the
${entropy_file} (and call postrandom again).

Certainly [re]seeding with 'sysctl -a' and 'date' is poor and should be
changed.

-- 
-- David  (obrien@FreeBSD.org)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120906175747.GC13179>