Subject: Re: /dev/random apparently not configured (partly fixed)
To: None <port-sparc@NetBSD.org>
From: Barrie Bremner <netbsd@barriebremner.com>
List: port-sparc
Date: 12/10/2005 10:13:51
Hello again,

I've been doing some playing with rndctl and I've got /dev/random
(mostly) functioning once I run a few commands.

Following boot, rndctl -s suggests there is no entropy available and
/dev/random reports device not configured. From rndctl -l it appears
that only the CD drive is being used as a source of entropy, which is
fairly pointless, given that drive isn't used on my system:

root@sparc:~> dd if=/dev/random bs=8 count=8
dd: /dev/random: Device not configured
root@sparc:~> rndctl -s
               25 bits mixed into pool
                0 bits currently stored in pool (max 4096)
                0 bits of entropy discarded due to full pool
               25 hard-random bits generated
            11463 pseudo-random bits generated

root@sparc:~> rndctl -l
Source                 Bits Type      Flags
cd0                       0 disk estimate, collect
hme3                      0 net
hme2                      0 net
hme1                      0 net
hme0                      0 net
le0                       0 net


I started playing around with adding about the only useful source of
entropy that I could add, the internal network interface, hme0.

For some reason enabling entropy collection without entropy estimation
has no effect. The two options had to be set together:

root@sparc:~> rndctl -e -c -d hme0
root@sparc:~> rndctl -l
Source                 Bits Type      Flags
cd0                       0 disk estimate, collect
hme3                      0 net
hme2                      0 net
hme1                      0 net
hme0                    889 net  estimate, collect
le0                       0 net
root@sparc:~> rndctl -s
              978 bits mixed into pool
              441 bits currently stored in pool (max 4096)
                0 bits of entropy discarded due to full pool
              537 hard-random bits generated
            11463 pseudo-random bits generated

root@sparc:~> dd if=/dev/random bs=8 count=8
[ randomness output, dd killed by me after some time ]
5+0 records in
5+0 records out
40 bytes transferred in 11.091 secs (3 bytes/sec)

I'd hardly call 3 bytes/second helpful, but it's better than "device
not configured". Left for a while (I'm assuming that passing traffic
through hme0 was good too) helps:

root@sparc:~> rndctl -s
            76942 bits mixed into pool
             4096 bits currently stored in pool (max 4096)
            55253 bits of entropy discarded due to full pool
            17593 hard-random bits generated
            12743 pseudo-random bits generated
root@sparc:~> dd if=/dev/random bs=8 count=8
[ randomness ]
8+0 records out
64 bytes transferred in 0.006 secs (10666 bytes/sec)

So, I've got an improved system, but I still don't understand quite
why things are so wierd, nor what the permanent solution is.

Can anyone else shed some light on this?

Cheers,
-- 
Barrie J. Bremner
netbsd [at] barriebremner.com     http://barriebremner.com/