[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] OpenSSH: PRNG is not seeded



On 12/17/13 00:17, Vincent Rivière wrote:
Hello.

I'm currently rebuilding OpenSSH for MiNT.
Basically, it works perfectly, but I face something which looks like a bug.

I run sshd on the ARAnyM side.
Then I connect from Windows using PuTTY/KiTTY/WinSCP.

When trying to get more than 1 or 2 simultaneous connexions, I get the following message in the server log:
PRNG is not seeded

I hunted it and I arrived into OpenSSL, file crypto/rand/rand_unix.c.
See line 324:
http://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=crypto/rand/rand_unix.c

The code tries to read /dev/urandom. It uses select() to determine if there is something to read, and avoid blocking. But it seems that something goes wrong in FreeMiNT, and sometimes select() does not indicate that data is available. Hence the damn "PRNG is not seeded" error.

If I replace the line 324 by "if (1)" to force:
/* can't use select, so just try to read once anyway */
    try_read = 1;
then it works perfectly and I don't have any trouble.

Is it possible that select() on /dev/urandom sometimes fails to signal that data is always available? Maybe that assumption is wrong? I'm not familiar with select() or even FreeMiNT devices, so I'm not sure to understand where the problem actually is.

Alan, did you encounter such trouble with sshd?

I think I remember once seeing this quite some time ago, but not recently and I use ssh every day with FreeMiNT.

Alan.