crypt: Add workaround for non-fork-safe PRGs.
authorAndre Noll <maan@systemlinux.org>
Thu, 22 Aug 2013 21:13:37 +0000 (23:13 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 24 Sep 2013 10:07:13 +0000 (12:07 +0200)
commita496f5831278c7e724d02de45f6cc6eba115b95c
tree02796215a8f57820a90737df9a6f697db21cb5f4
parent282a5e463090205ef8a12f50a9ecf6498b860e88
crypt: Add workaround for non-fork-safe PRGs.

Some PRNGs implementations suffer from the problem that after a fork()
the PRNG state of parent and child process differ only by the child pid
which is mixed into the state. Certain versions of openssl are known to
contain this flaw.

On such implementations two command handlers will generate the same
challenge and session keys if their pid is identical. This may happen
due to pid wrapping.

This patch works around this shortcoming by reading some pseudo random
bytes in the parent process after each fork().
server.c