Solaris random device

Andreas Pommer apommer at cosy.sbg.ac.at
Thu May 11 16:04:11 CEST 2000


On May 10, Lars Hecking wrote:
[..]
>  After openssh failed when I upgraded to Solaris 8, I was looking for an
>  alternative to egd and found Andreas Maier's random device for Solaris
>  (http://www.cosy.sbg.ac.at/~andi/). It seems to work quite nicely with
>  openssl/openssh. I can generate keys, make connections, no problem.
[...]
> poll(0xFFBED588, 1, 3000)                       Err#6 ENXIO
> write(2, " s e l e c t ( )   e r r".., 16)      = 16
> write(2, " N o   s u c h   d e v i".., 25)      = 25
> write(2, "\n", 1)                               = 1
> [repeats over and over]
> 
>  Any suggestions? Is it possible that the current code is too Linux/BSD
>  specific?

the problem occurs in rndlinux.c gather_random() at the select() in line 128:

        if( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) ) {

this select() translates into poll(), which can be seen in the truss-dump above.

However, in the source of Andis random device one can read:

 * NOTE NOTE NOTE NOTE  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE 
[..]
 * -) /dev/random and /dev/urandom are the same (no blocking).
 * -) No ioctls, no poll.
 *
 * NOTE NOTE NOTE NOTE  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE 

That seems to be the answer. One possible solution would be to skip the
select() if the fact is known that the device does not block.
Another one would be to improve the random device (remember, still V0.1),
to provide a dummy-poll which succeeds every time.

HTH

Andreas



More information about the Gnupg-devel mailing list