]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: ssl: openssl 0.9.8 doesn't open /dev/random before chroot
authorThierry Fournier <tfournier@exceliance.fr>
Thu, 24 Jan 2013 13:15:43 +0000 (14:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 20:16:41 +0000 (21:16 +0100)
commit383085f6c0823069afd84411be28d5d5a3fe8e4e
tree89b6a0a88a91cfd13cb80d303971d8e9819c8bcf
parent656233715e1e9810c43f05b12e13f8829ea4cad2
BUG/MEDIUM: ssl: openssl 0.9.8 doesn't open /dev/random before chroot

Openssl needs to access /dev/urandom to initialize its internal random
number generator. It does so when it needs a random for the first time,
which fails if it is a handshake performed after the chroot(), causing
all SSL incoming connections to fail.

This fix consists in calling RAND_bytes() to produce a random before
the chroot, which will in turn open /dev/urandom before it's too late,
and avoid the issue.

If the random generator fails to work while processing the config,
haproxy now fails with an error instead of causing SSL connections to
fail at runtime.
src/ssl_sock.c