]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virrandom: Make virRandomBits better
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 29 May 2018 06:26:18 +0000 (08:26 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 5 Jun 2018 08:31:19 +0000 (10:31 +0200)
commit60da4a114862d6fc0073cdcb6e765395a2f2f247
treef51fe0782fb087f6f3bc7a39eda2de392ed1b78a
parentb87dda7549e4bc6dadf8d3110afcc9e2d2866f7f
virrandom: Make virRandomBits better

Now that we have strong PRNG generator implemented in
virRandomBytes() let's use that instead of gnulib's random_r.

Problem with the latter is in way we seed it: current UNIX time
and libvirtd's PID are not that random as one might think.
Imagine two hosts booting at the same time. There's a fair chance
that those hosts spawn libvirtds at the same time and with the
same PID. This will result in both daemons generating the same
sequence of say MAC addresses [1].

1: https://www.redhat.com/archives/libvirt-users/2018-May/msg00097.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
bootstrap.conf
src/util/virrandom.c